I'd like to perform node-induced subgraph matching, which do not need to be fully connected, including node and edge attribute matching with networkx (see this image). Let's say I have a large graph G1 and a subgraph G2, where I would like to see whether G2 matches a subgraph of G1. Both graphs are undirected.
Using:
GM = networkx.algorithms.isomorphism.GraphMatcher(G1, G2, edge_match = edge_match_func, node_match = node_match_func)
and applying
GM.subgraph_is_monomorphic()
Does not seem to work for my case.
Does anyone know how one can solve this? Or potentially hints to algorithms solving this?
I found one solution: