In the class Graph, each property derives from the dictionary of edges and weights. Many properties just return some information computed from such dictionary. Others, like perfect_matchings and state_catalog require so much computation time that we store them.
When we modify the dictionary, we need to update some properties, and the order in which we do it matters too much. This should be simplified with in a single update method which takes care of everything.
In the class
Graph, each property derives from the dictionary of edges and weights. Many properties just return some information computed from such dictionary. Others, likeperfect_matchingsandstate_catalogrequire so much computation time that we store them.When we modify the dictionary, we need to update some properties, and the order in which we do it matters too much. This should be simplified with in a single
updatemethod which takes care of everything.