Euler Paths and Circuits
Euler Paths and Circuits
It was believed that it was impossible to do but why? Could Euler explain the reason?
The problem now becomes one of drawing this picture without retracing any line and without picking your pencil up off the paper.
Euler saw that there were 5 vertices that each had an odd number of lines connected to it. He stated they would either be the beginning or end of his pencil-path.
If a node has an odd degree, and the circuit starts at this node, then it must end elsewhere. This is because after we leave the node the first time the node has even degree, and every time we return to the node we must leave it. (On the paired arc.)
If a node is odd, and the circuit begins else where, then it must end at the node. This is a contradiction, since a circuit must end where it began.
Euler Circuit?
Algorithm: Step One: Randomly move from node to node, until stuck. Since all nodes had even degree, the circuit must have stopped at its starting point. (It is a circuit.) Step Two: If any of the arcs have not been included in our circuit, find an arc that touches our partial circuit, and add in a new circuit.
Each time we add a new circuit, we have included more nodes. Since there are only a finite number of nodes, eventually the whole graph is included.
A detail
We said that if the number of odd degree vertices =0, then Euler circuit =2, then path What if =1????
If at each node the number in = number out, then there is an Euler circuit If at one node number in = number out +1 and at one other node number in = number out -1, and all other nodes have number in = number out, then there is an Euler path.
Hamilton Circuit
Given a graph, when is there a circuit passing through each node exactly one time?
Hard to solve only general algorithm known is to try each possible path, starting at each vertex in turn. For K n there are n! possible trials.
A salesman needs to visit n cities and return home. What is the cheapest way to do this? Cinn
170 Bos 279 346 197 340 Atl
459
Den
TSP
The traveling salesman problem is NP complete. Practically, this means that there is no know polynomial-time algorithm to solve the problem and there is unlikely to be one.