aplbrain / grandiso-networkx

Performant, pure-Python subgraph isomorphism and monomorphism search (aka "motif search")
Apache License 2.0
56 stars 10 forks source link

Add `count_motifs` endpoint #3

Closed j6k4m8 closed 4 years ago

j6k4m8 commented 4 years ago

For sufficiently common motifs, len(find_motifs(...)) has an unnecessarily large memory footprint. If the user is just looking for a count rather than an enumeration of each monomorphism, we can increment a count rather than saving a copy of monomorphisms in a list.