Moved graph helper functions to graph_helper file.