mgmt
mgmt copied to clipboard
pgraph: Fix GraphCmp function
The previous algorithm would fail on the newly added tests due to the fact that it would check for duplicate vertices. The newer algorithm doesn't use any fancy isomorphism algorithms. It exploits the fact that nodes can be expected to have the same label in the two graphs being compared. This allows us to create a sorted list of vertices based on the label of a node and the labels of its neighbors.
Once the two graphs are in sorted order, we simply use the vertexCmpFn on vertices at the same index, and run the edgeCmpFn on each of the vertices' respective edges.
Resolves #199