This is a basic subgraph enumeration routine based on map reduce context