3-6x faster matching!

This commit is contained in:
Joeri Exelmans 2024-12-04 16:34:06 +01:00
parent 54845b2a4a
commit abe9b5705c

View file

@ -255,8 +255,10 @@ class MatcherVF2:
else: else:
guest_components_to_try = self.guest_component_to_vtxs guest_components_to_try = self.guest_component_to_vtxs
for g_candidate_vtxs in guest_components_to_try: for g_component in guest_components_to_try:
for g_candidate_vtx in g_candidate_vtxs: # we only need to pick ONE vertex from the component
# in the future, this can be optimized further by picking the vertex of the type with the fewest instances
g_candidate_vtx = g_component[0]
if g_candidate_vtx in state.mapping_vtxs: if g_candidate_vtx in state.mapping_vtxs:
print_debug("skip (already matched)", g_candidate_vtx) print_debug("skip (already matched)", g_candidate_vtx)
continue continue