Hamiltonian graphs and TSP Flashcards
What is a hamiltonian cycle, path, graph?
Cycle: Visits every vertex once starting and ending at same
Path: Path that visits vertex once and doesnt end at start
Graph: Graph posessing hamiltonian cycle
Under which conditions is a graph necessarily hamiltonian?
- Degree of AT LEAST 2
What are the steps for the closest insertion heuristic?
- Start at depot, add smallest cylce from nearest node
- Look for node with shortest distance from cycle. Find ij in current cycle such that d(i, k) + d(k, j) - d(i,j) is minimum.
What are the steps for the cheapest insertion heuristic?
- Start with smallest cycle
- Consider each node k not yet part of cycle. Find distance that is at minimum.
- Calculate all options from those vertices at different positions in the cycle.
What are the steps for the nearest-neighbour heuristic and how is it done from a weighted matrix?
- Start at depot
- From last node in route, find shortest and add to route.
Matrix: Search in corresponding row/col for smallest unvisited distance.
What is the 1-tree lower bound and how is it calculated?
Estimnate how close given solution is to optimal. If far, use different heuristic or improve on current solution.
Calculate:
1. Choose node, remove it and all arcs.
2. Determine MST
3. Put node back in MST with two shortest arcs. Length = |MST| + 2
4. Repeat for all nodes until best lower bound obtained. Higher bound = better for TSP.
Why is NN a bad heuristic?
- Greediness in immediate gains approach
- Increased num neighbours -> extra distance.