I have a list of interconnected edges (E
), how to find the shortest path connecting from one vertex to another?
I am thinking about using lowest common ancestors, but the edges don't have a clearly defined root, so I don't think the solution works.
Shortest path is defined by the minimum number of vertexes treversed.
Note: There could be a multi-path connecting two vertices, so obviously breadth first search won't work