2. NP-COMPLETE PROBLEMS
• •The upper bound suggests the problem is intractable
• •The lower bound suggests the problem is tractable
• •The lower bound is linear: O(N)
• •They are all reducible to each other
• If we find a reasonable algorithm (or prove intractability) for one, then we can do it for all
of them!
3. TRAVELING
SALESMAN
• Given a complete graph and an assignment of weights
to
• the edges, find a Hamiltonian cycle of minimum
weight.
• This is the optimization version of the problem. In the
• decision version, we are given a weighted complete
graph
• and a real number c, and we want to know whether or
not
• there exists a Hamiltonian cycle whose combined
weight of
• edges does not exceed c.
4. HAMILTONIAN
PATH
• In the mathematical field of graph
theory, a Hamiltonian path (or
traceable path) is a path in an
undirected or directed graph that
visits each vertex exactly once.
5. BACKTRACKING
• Effective for decision problems
• Systematically traverse through possible paths to locate solutions or dead ends
• At the end of the path, algorithm is left with (x, y) pair. x is remaining subproblem, y is set of
choices made to get to x
• Initially (x, Ø) passed to algorithm