Should the Iterator that Graph.findPath returns be over a “list” of just vertices, or over an alternating “list” of vertex / edge (starting and ending with a vertex), as the textbook discusses paths?
Yes indeed, a path can be expressed in either of those two ways: • A list of vertices. (This includes the guarantee that every pair of adjacent vertices in the list really do have an edge between them.) • An alternating list of vertex / edge, starting and ending with a vertex. For the project, the first way is to be used: a list of vertices. Graph’s addEdge does not return an edge name or label. So the Labyrinth application (or any other application) would not understand any edge label that Graph might return. For this type of application, just working with vertices seemed to make more sense. Note furthermore that Graph.findPath returns an iterator over a “list” of vertex labels, not over a “list” of vertex objects / positions. The vertex labels Graph uses should be the same that the outside caller used when calling addVertex to establish the vertices.