igraph-help
[Top][All Lists]
Advanced

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

[igraph] Error in using the function subcomponent( )


From: address@hidden
Subject: [igraph] Error in using the function subcomponent( )
Date: Sun, 23 Feb 2014 22:43:56 +0800

Hello!
 
I am trying to use the subcomponent() to find the in-component and out-component from a given vertice.
Here is the source code and result:
 
> g<-read.graph("input.txt", "edgelist")
> subcomponent(g, 4, "in")
[1] 4
> subcomponent(g, 4, "out")
[1] 4 3
> subcomponent(g, 4, "all")
[1]  4  3 10  5  7  6  8  2  9
 
Here is the input file "input.txt" (a directed network with 10 nodes and 10 edges):
1   5
1   7
3   2
4   5
4   7
4   9
9   4
6   9
8   7
9   2
 
But the actual result is should be:
subcomponent(g, 4, "in"):  4 6 9
subcomponent(g, 4, "out"):  2 4 5 7 9
subcomponent(g, 4, "all"):  2 4 5 6 7 9
 
Why is the results computed by using the function subcomponent( ) different from the actual result?
 
best
Xueming
 

address@hidden

reply via email to

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