[Top][All Lists]

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

Re: [igraph] graph.edgelist() behavior

From: Tamas Nepusz
Subject: Re: [igraph] graph.edgelist() behavior
Date: Mon, 16 Jun 2008 09:55:40 +0200

and give the command graph.edgelist(E, directed = FALSE), I instead
get 8 edges. The adjacency matrix for this graph instead has zeros and
twos, which means that 1 2 and 2 1 were counted separately and they're
NOT the same.
That's the expected behaviour (and I hope you intended to write 6 edges instead of 8, otherwise it is really a bug :)). Consider this as follows: if you have an undirected graph, then adding an edge from vertex A to B "automatically creates" its counterpart from vertex B to A. After that, adding an edge from B to A creates _another_ edge along with its counterpart. You simply get multiple edges between A and B. If you want to get rid of multiple edges, you can use simplify() on your graph after creation -- this removes multiple and loop edges.


reply via email to

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