Open amirziai opened 3 years ago
This is actually intended, as we do not distinguish between directed and undirected graphs. If you want your graph to be undirected, you will need to add edges for both directions.
👍
open to adding a comment clarifying this in the docstring? i can create a PR if you think it'd be useful. it can be a bit confusing.
Sure, feel free to create a PR.
🐛 Bug
Number of edges for an undirected graph is double counted.
To Reproduce
Steps to reproduce the behavior:
this line returns the number of items in the adjacency list, which is going to double count
Expected behavior
i think the number of edges should be divided by 2 when the graph is undirected. here's an example: