shortest path in a dag and ienumerable for stack