Hi all,
Recently I was trying to use igraph for building a graph. I first started with networkx where I was adding nodes which have a name associated with them. networkx nicely avoids duplicate nodes but igraph does not.
# Session with networkx graph
import networkx as nx
graph = nx.DiGraph()
graph.add_node('A')
graph.nodes()
Out[5]: ['A']
graph.add_node('A')
graph.nodes()
Out[7]: ['A']
So networkx does not allow duplicate nodes. This is not the case with igraph (igraph uses the attribute 'name' to store the node label, but does not do duplicate checking on this attribute). Because of this in my case, igraph is slower than networkx! Is there a way I can do the same thing in igraph as networkx without maintaining a separate datastructure checking in it if I have added it to the igraph before adding a node?
Thanks,
Krishna Dubba