Fixed graph library to create all paths up to a given depth