Finding the Shortest Path passing through all Routes

117 Views Asked by At

I'm wondering if there's actually an easy technique (other than trial & error) to find the shortest path (which covers all paths).

I googled and discovered that all paths in this diagram cannot be passed only exactly once based on the Euler Theory (correct me if I'm wrong). I am a first-year maths student so I haven't studied graph theory yet!

Still hoping that I can get some insights on some techniques on solving this enter image description here
as I doubt that the minimum value I got is accurate.

Thanks in advance!

1

There are 1 best solutions below

3
On

A first step is to count the number of odd vertices. As you have seen, you can make a Eulerean path in those graphs with two odd vertices and a Eulerean cycle in those graphs with none. If there are two, the path must start at one odd vertex and end at another. In your example there are four odd vertices: $B,D,F,H$. Given the entry and exit constraint, you need to duplicate a path from $B$ to $H$, so pretend there is one more link. The shortest path from $B$ to $H$ has length $300$ so that will be your added length. Now that you have added this path, you have only two odd vertices and are asked to start at one and end at the other, so the minimum length will be the total of all the paths plus $300$.