If the graph directory is provided, make sure it's created first