igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] Counting the # of chains


From: Csardi Gabor
Subject: Re: [igraph] Counting the # of chains
Date: Sat, 30 Aug 2008 13:25:01 +0200
User-agent: Mutt/1.5.9i

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 
dense.

Gabor

On Tue, Aug 26, 2008 at 10:52:37AM -0700, Eric Sun wrote:
> Hi,
> 
> 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!
> Eric

> _______________________________________________
> igraph-help mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/igraph-help


-- 
Csardi Gabor <address@hidden>    MTA RMKI, ELTE TTK




reply via email to

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