Hi everyone,

   I've been working around with graph-tool and I have found a strange
behaviour.

   A have this input .dot file

graph G {
0 ;
10 ;
200 ;
1000 ;
0--200 ;
10--200 ;
1000--200 ;
1000--10 ;
}

I load the graph in graph_tool using g=load_graph("example.dot") and
everything is OK. Now I want to know the output_degree of the node with
identifier 200 (index 2). I use:

g.vertex(2).out_degree() that returns 2

Obviously vertex with identifier 200 (index 2) must return 3.

I have executed g.save("graphtool_dump.dot") with the following output:
graph G {
0;
10;
1000;
200;
0--200 ;
10--200 ;
1000--200 ;
1000--10 ;
}

The nodes have been reordered (probably following alphabetic order) and now
the vertex with identifier "200" is in position 3 instead of 2. This
behaviour can be very annoying in some cases, and can lead to confusion.
Does exist any way to avoid this reordering?

Thanks in advance,

Juan
_______________________________________________
graph-tool mailing list
graph-tool@forked.de
http://lists.forked.de/mailman/listinfo/graph-tool

Reply via email to