added more graph helper functions (now possible to reduce the graph)