I’m wondering what the procedure is in iGraph for adding in edges with capacity one at a time. In NetworkX, to find max flow, I would do something like:
> G = nx.Graph()
> for edge in edges_with_capacity: # get edge info format like ('a', 'b', 5)
> G.add_edge(edge[0], edge[1], capacity=edge[2])
> max_flow = nx.maximum_flow_value(G, 'a', 'z')
1 . The issue is that in edges_with_capacity
I will have repeated node names (that are the same node) or even edges (that I would want to update). In NetworkX, a new node is only added when adding an edge if the node name doesn’t already exist (otherwise the existing node is used for constructing the new edge) and adding a duplicate edge updates the existing edge, is this something I have to handle manually in iGraph?
2.When using the maxflow method of an iGraph graph, I think using the string node name for source/sink is not supported? If so, what’s the ‘correct way’ of extracting the source and sink node index given string names of the nodes, is it just g.vs[“name”].index(“name of node”)?
3.Similar to the above, what’s the ‘correct way’ to retrieve the edge capacity given just the string name of the to/from vertex?