The length of a path is the number of edges in it.