aplbrain/dotmotif

Upgrade grandiso version to use limits and iterable

j6k4m8 opened this issue · 2 comments

In grandiso v1.1.0 and above, there is an optional limit argument to the find_motifs call which short-circuits motif counting if a certain number of valid mappings are found.

Right now, NetworkX and GrandIso executors implement the dotmotif limit parameter by finding all motifs and then downselecting, which is super inefficient and lame. We could pretty substantially improve performance by supporting the GrandIso limit arg.

A notable challenge: We perform an additional downselect after running grandiso (to double-check attribute filters). So we may need to store a list of mappings temporarily in order to backfill the results list if candidate mappings are filtered out.

In light of the new find_motifs_iter form in grandiso, this last point is moot — we can now continue searching until we meet the limit criteria, without wasting time on extra searches. (Thanks to @Raphtor!)