dwavesystems / minorminer

minorminer is a heuristic tool for minor embedding: given a minor and target graph, it tries to find a mapping that embeds the minor into the target.
https://docs.ocean.dwavesys.com/en/stable/docs_minorminer/source/sdk_index.html
Apache License 2.0
48 stars 40 forks source link

fixed sporadic (1/15th of the time) failure reported in #227 #229

Closed boothby closed 1 year ago

boothby commented 1 year ago

Testing the graph cache identifier involved randomly deleting an edge from a pegasus graph and testing that the identifier would change. Since the graph identifier is a sha256 hash of a serialized form of the graph, this should be a simple test, right? Oops. Only, roughly 1/15th of the time, the randomly-chosen edge represents an odd coupler -- an edge which is ignored by the busclique algorithm.

So I've split the test into two -- it first filters the edges into two sets (odd edges and relevant edges) and then tests that the identifier changes when a relevant edge is deleted and does not change when an odd edge is deleted. In the chance that we ever account for odd edges in the busclique algorithm, the bifurcated test will rear its head and we can update it from there.