igraph-help
[Top][All Lists]
Advanced

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

[igraph] Neighbors & Degree not matching


From: Thomas
Subject: [igraph] Neighbors & Degree not matching
Date: Tue, 12 Feb 2013 09:05:26 +0000

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? The code for reading in g is included below and I took out loops so it shouldn't be joined to itself.

> j <- 153
> neighbors(g,j)
[1] 156
> degree(g,j)
[1] 2

g <- read.graph("EL.txt", format=c("edgelist"))
g <- simplify(g, remove.multiple = TRUE, remove.loops = TRUE)
g <- delete.vertices(g,which(degree(g) < 1)-1)

I'm using iGraph in R.

Thank you,

Thomas



reply via email to

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