Skip to content
Prev 138552 / 398506 Next

vertex labels in igraph from adjacency matrix

Mark, graph.adjacency always preserves the order of the vertices,
so the vertex at row/column 1 will be vertex #0 in the igraph graph,
etc. I'll document this in a minute. 

This means that you can always do

g <- graph.adjacency(A)
V(g)$name <- colnames(A)

But i completely agree that this should be done by default,
i'll do that in the near future.

Btw, weighted shortest path calculation (= where the edges have 
weights or capacities) is only implemented in the development 
version of igraph. Just in case you're looking for that.

Best,
Gabor
On Wed, Mar 05, 2008 at 01:39:41AM -0500, Mark W Kimpel wrote: