rustworkx icon indicating copy to clipboard operation
rustworkx copied to clipboard

Add Graph difference

Open nahumsa opened this issue 3 years ago • 5 comments

Related to #440

Adds the difference between two graphs for PyDiGraph and PyGraph.

nahumsa avatar Mar 10 '22 21:03 nahumsa

Pull Request Test Coverage Report for Build 2779975375

  • 62 of 62 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.001%) to 97.131%

Totals Coverage Status
Change from base Build 2778191284: -0.001%
Covered Lines: 12425
Relevant Lines: 12792

💛 - Coveralls

coveralls avatar Mar 10 '22 22:03 coveralls

Users have only indirect control over node indices since we assign them internally. In union we distinguish two nodes/edges based on their data payloads and it's probably better to do the same in this PR too. In more detail I'm thinking that we should:

  1. Verify that we can match every node of the first graph into a unique node in the second graph with the same data payload.
  2. Remove an edge e = (u, v) from the first graph if the second graph has an edge with endpoints e' = (m[u], m[v]), where m is the matching found in step (1.), and the edge data payloads agree.

georgios-ts avatar Mar 31 '22 16:03 georgios-ts