A train problem using directed graphs to get to a solution.