Performance of weighed graphs

I always wondered why we are using a sparse matrix to store weights instead of using an adjacency list storage. Glad to see someone questioning it. A drawback will probably a slightly slower access to neighbors, but switching to it would also solve other issues like the fact that zero weights are not supported. Maybe there is a tradeoff decision, and we could have both implementations existing. I will open an issue on SimpleWeightedGraphs.

Edit: An other drawback is that querying weight between two vertices will be slower, and generating the weight matrix will be costly.

On the other side, the idea to iterate on the edges rather than the vertices has been discussed recently (here and here), this could allow this type of optimization.