[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
## [igraph] graph.edgelist() behavior

**From**: |
Melody Lam |

**Subject**: |
[igraph] graph.edgelist() behavior |

**Date**: |
Sun, 15 Jun 2008 21:18:15 -0500 |

Dear List:
I've been working with igraph for a few weeks for a research project
and I noticed this strange behavior with graph.edgelist() -
Say I have a simple edge list like this (named E):
1 2
2 3
3 4
4 5
graph.edgelist(E, directed = FALSE) gives out 4 edges, which is
correct. The adjacency matrix for this edge list only has zeros and
ones.
but if I had this edge list:
1 2
2 1
3 4
4 3
4 5
5 4
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.
So I'm wondering why in igraph the edge connecting vertex 1 to 2 is
not the same as the edge from 2 to 1 if the graph is undirected.
Melody Lam

**[igraph] graph.edgelist() behavior**,
*Melody Lam* **<=**