igraph-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [igraph] issue with giant component in python-igraph


From: Tamas Nepusz
Subject: Re: [igraph] issue with giant component in python-igraph
Date: Tue, 4 Nov 2008 08:36:47 +0000

Dear Anirban,

G = igraph.load(sys.argv[1], format="edgelist", directed=True)
components = G.clusters(igraph.WEAK)
igraph.save(components.subgraph(0), "giantcomponent.txt", format="edgelist")
That looks OK, the only thing I'd done differently is that VertexClustering objects (like what you got in components) have a method called .giant(), so you don't have to check the component sizes manually. So theoretically it's OK what you are doing. You might try the following to find out where the bug is:

- instead of G.clusters(igraph.WEAK), try igraph.GraphBase.clusters(G, igraph.WEAK) which calls the underlying C implementation directly and results a single list l where l[i] equals the index of the cluster where the ith vertex belongs to. There might be a bug in the creation of a VertexClustering object.

- try to go even deeper and write the above program in C -- it boils down to calling igraph_read_graph_edgelist, igraph_clusters and igraph_write_graph_edgelist in the right order ;)

- if your graph is not confidential, you can try to upload it somewhere and send me the URL where I can download it form. I will try to reproduce your bug in my own machine. (Otherwise, if you manage to construct a similar graph that also reproduces the problem, that's fine).

--
Tamas





reply via email to

[Prev in Thread] Current Thread [Next in Thread]