Easy and Hard Problem

The traveling salesman problem, Hamiltonian cycle problem, longest path problem, and many other important computational problems have been shown to be NP-complete.

This is the basis for many algorithms that are used to solve these problems in practice.

Traveling Salesman Problem

According to the definition below, TSP is a search problem. This is because, when the order of vertices is given, determining whether the cost is less than $b$ and visiting all vertices can be solved within polynomial time proportional to the length of the vertices.

Figure 7.1 Definition of TSP.

Figure 7.1 Definition of TSP.

An easy version of the TSP is the Minimum Spanning Tree Problem.

Figure 7.2 Easy version of TSP.

Figure 7.2 Easy version of TSP.

The difference is that MST looks for a tree while TSP looks for a path. The problem is finding the shortest simple cycle in the graph.

The decision problem form is:

Given a graph $G=(V,E)$ and integer $b$, does the graph contain a simple cycle that passes through all vertices and has length $\leq b$?