igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] Neighbors & Degree not matching


From: Tamás Nepusz
Subject: Re: [igraph] Neighbors & Degree not matching
Date: Tue, 12 Feb 2013 19:50:37 +0100

> In the code/output below Node 153 has one neighbor (Node 156) but the degree 
> function returns 2. Does anyone know why this would happen?
Your graph is directed and node 153 has an outgoing and an incoming edge. 
degree() returns the "undirected" degree by default, i.e. it counts both the 
incoming and the outgoing edges, while neighbors() returns the "outbound" 
neighbors. Use the mode= argument of neighbors() or degree() to change this 
behaviour; mode=... may be "in" for incoming edges only, "out" for outbound 
edges only and "all" for both.

-- 
T.




reply via email to

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