pnevyk / gryf

Graph data structure library aspiring to be convenient, versatile, correct and performant.
MIT License
73 stars 1 forks source link

Fix adding duplicate edge to AdjMatrix #14

Closed pnevyk closed 1 year ago

pnevyk commented 2 years ago

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.

pnevyk commented 1 year ago

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