getPaths now creates circular directed graphs