solved the infinite_graph for p1