Title: Chapter 2 Methods For Finding A Hamiltonian Circuit Complete Graph
1Chapter 2Methods For Finding A Hamiltonian
Circuit(Complete Graph)
- I. Brute Force Method
- II. Nearest Neighbor Algorithm
- III. Sorted Edges Algorithm
2Credits
- COMAP, For All Practical Purposes, 5th ed.
3I. Brute Force Method
- Use Fundamental Counting Principle to obtain
number of possible paths, K -
- Find to obtain total of
different paths - Pick vertex create tree diagram (delete
duplicate paths) - Add distances of each different path, choose path
with smallest total - Always gives optimal solution
4(No Transcript)
5Using graph on left, draw the tree diagram
6Add up distances. Pick shortest path
1985
2040
1877
7II. Nearest Neighbor Algorithm
- Select a starting vertex
- Select the edge with the shortest path to the
next vertex - Continue sequentially in this manner until you
reach the original vertex and you have covered
all vertices in the graph. - Remember If your selection will create a
subcircuit, select an alternate shortest edge to
the next vertex.
8We will begin with vertex CFollow the path to
the nearest vertexRemember you cant form
subcircuit
9III. Sorted Edges Algorithm
- Sort the distances in increasing order 1,2,3,
- Select the edge with distance 1
- Select the next edge with distance 2 (unless that
edge leads to a subcircuit or to a vertex with 3
edges)then skip edge with distance 2 and select
edge with distance 3 - Continue until you return to starting point
10Sort graphs edges 300,349,425,541,562,774Begin
with shortest edge, continue sequentiallyCant
form subcircuit, or 3 edges into a vertex
11Traveling Salesman Problem
- Find a minimum-cost Hamiltonian circuit in a
complete graph where each edge has been assigned
a cost or weight. - Can use any of the three methods described
previously.