simply finished the subgraph matching code using dynamic programming