pnevyk/gryf

Fix adding duplicate edge to AdjMatrix

Closed this issue · 1 comments

AdjMatrix::add_edge now adds 1 to the internal edge counter unconditionally. However, adjacency matrix does not support multiple edges between two vertices and a new edge always replaces the previous one. In such case, the internal edge counter must remain unchanged.

An alternative behavior to replacing the edge is to return an error once #34 is implemented.