Added Parameter $path_to_graph_files to ensure the graph directory exists