igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] getting k-connected nodes from a vertex


From: Tamás Nepusz
Subject: Re: [igraph] getting k-connected nodes from a vertex
Date: Sat, 8 Dec 2012 17:27:13 +0100

> "The neighborhood of a given order o of a vertex v includes all vertices
> which are closer to v than the order. Ie. order 0 is always v itself, order
> 1 is v plus its immediate neighbors, order 2 is order 1 plus the immediate
> neighbors of the vertices in order 1, etc.", is order 1 yielding "immediate
> neighbors" instead? In my case, passing 0 will actually return nothing
> rather than vertex v itself... 
Because there are no _edges_ between vertex v and itself and you are saving an 
edge list into a file. If you simply inspect the returned graph for order zero, 
you will see that the zero-order neighborhood returns a graph with a single 
vertex and no edges:

> g <- graph.famous("petersen")
> V(g)$name <- LETTERS[1:10]
> g2 <- graph.neighborhood(g, 0, "A")[[1]]
> g2
IGRAPH UN-- 1 0 -- petersen
+ attr: name (g/c), name (v/c)
> vcount(g2)
[1] 1
> ecount(g2)
[1] 0

-- 
T.


reply via email to

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