Creating folders for directed and undirected graphs