Branch/vf2 optimisations (#2500)

* Remove out_1 and out_2, only need for directed graphs.

* Variable renaming, no other changes.

* Fix a couple things that were forgotten during the rename

* Only one of these counts is updated now.

* Add ifdef to enable/disable VF2Pruning

* Add degree bound check, could be pushed down to the generic VertexCheck predicate.

* The stack knows at each point what was added, by passing these into the Backtrack call the clone allocation can be removed.

* Indent and rename added_node1 to node1.

* Now the clone is removed we can add a member function to handle the recursion cleanly.

* Also make for MatchAll a member function.

* Set lim=0 to mean infinity.

* VF2Plus optimisation, when candidate is in the terminal set select from a mapped neighbours adjacency list.

* Optimisation hint.

* Use a struct for the Pair removing the need for double pointer and heap alloc/delete of the iterators.

* disable pruning by default (it's a bit quicker to not do this)

* update expected test results

The updated VF2 code can return symmetric results in a different order
than we were getting previously. The results are still correct, but they
change some of the downstream things that don't do symmetrization

* update expected java results
This commit is contained in:
John Mayfield
2019-06-30 03:49:24 +01:00
committed by Greg Landrum
parent e0bea03a2e
commit 76ed536c87
6 changed files with 265 additions and 262 deletions

View File

@@ -65,7 +65,7 @@ public class AlignTests extends GraphMolTest {
ROMol m1 = RWMol.MolFromMolFile(fname1);
Transform3D trans = new Transform3D();
double res = m0.getAlignmentTransform(m1, trans);
assertEquals(res, 0.6578, 0.001);
assertEquals(res, 1.0345, 0.001);
m0.delete();
m1.delete();
}