Am 14.12.18 um 11:36 schrieb Christopher Morris: > Given an *undirected* graph g with four vertices, I add edges by > > g.add_edge_list([(0, 1), (0, 2), (0, 3), (1, 0), (1, 2), (1, 3), (2, 0), (2, > 1), (2, 3), (3, 0), (3, 1), (3, 2)]) . > > When calling g.num_edges() the result is 12. In my opinion it should be 6, > as the graph is undirected? Any ideas?
Since the graph is undirected, adding (1, 2) and (2, 1) just amounts to adding the same edge _twice_. In graph-tool, the Graph data structure store multigraphs (directed or not). It's up to the user to ensure that there are no parallel edges. Best, Tiago -- Tiago de Paula Peixoto <[email protected]> _______________________________________________ graph-tool mailing list [email protected] https://lists.skewed.de/mailman/listinfo/graph-tool
