|Subject:||Re: [igraph] Counting the # of chains|
|Date:||Tue, 2 Sep 2008 09:45:52 -0700|
Hi Eric, what is a 'chain' for you? A chain is a shortest path?
Or just any path? If the former, just do
length(get.all.shortest.paths(graph, from, to, mode="out"))
It is slighly overkill, because we don't actually need all the paths
themselves, but might work if your graphs are not very big or not very
On Tue, Aug 26, 2008 at 10:52:37AM -0700, Eric Sun wrote:
> I’m wondering if it’s possible, using the igraph R interface, to count the #
> of chains of a certain length.
> I am familiar with path.length.hist(), but that double-counts chains because
> all the 1-length chains are included in the 2-length chains, etc. The
> nonpredictable structure of my graph may not allow me to calculate a
> non-double-counting histogram using the results of path.length.hist().
> Ideally I would like to count the number of chains of length X from a node
> with degree(mode=”in”) == 0 [i.e., a root node] to a node with
> degree(mode=”out”) == 0 [i.e., a leaf node].
> Is this possible?
> Thank you very much!
> igraph-help mailing list
Csardi Gabor <address@hidden> MTA RMKI, ELTE TTK
igraph-help mailing list
|[Prev in Thread]||Current Thread||[Next in Thread]|