Algorithm Pseudocode - aplbrain/grandiso-networkx GitHub Wiki
- Accept arguments:
- M := a motif
- H := a host graph
- Create an empty list for result storage, R.
- Create an empty queue, Q.
- Preprocessing
- Identify the most "interesting" node in motif M, m1.
- Add to Q a set of mappings with a single node, with one map for all
nodes in H that satisfy the requirements of m1: degree, attributes, etc
- Motif Search
- "Pop" a partial-mapping B from Q
- Identify as m1 the most interesting node in motif M that does not yet
have a mapping assigned in B.
- Identify all nodes that are valid mappings from the partial-mapping to m1,
based upon degree, attributes, etc.
- If multiple nodes are valid candidates, add each new partial-mapping to Q.
- Otherwise, when all nodes in M have a valid mapping in B to H, add
the mapping to the results set R.
- Continue while there are still partial-mapping in Q.
- Reporting
- Return the set R to the user.