rigraph
rigraph copied to clipboard
indexing of graph_from_adj_list
The documentation of graph_from_adj_list says
the maximum throughout all vectors in the list must be less than the number of vectors (=the number of vertices in the graph). Note that the list is expected to be 0-indexed
Yet, it is not 0-indexed. E.g. a ring graph:
> graph_from_adj_list(list(1,2,3,0)) Fehler in .Call("R_igraph_adjlist", adjlist, mode, duplicate, PACKAGE = "igraph") : At structure_generators.c:84 : Invalid (negative) vertex id, Invalid vertex id > graph_from_adj_list(list(2,3,4,1)) IGRAPH D--- 4 4 -- + edges: [1] 1->2 2->3 3->4 4->1