So I’m doing this problem, and I can’t seem to figure out how to calculate the cost of a path. I can easily tell if a single point or edge is on a shortest path for the commuter pass, but I can’t tell if a series of paths are, resulting in an incorrect output.

Could anyone help?