Polynomial time describes an algorithm whose running time or computational cost grows according to a polynomial function of input size. Problems solvable in polynomial time are generally called tractable. section 2.1.1
Traveling salesperson problem
For the traveling salesperson problem, input size can be measured by the number of cities to visit. Finding an optimal route illustrates why feasible search spaces and computational cost matter. section 2.1.1
Polynomial time helps distinguish major problem classes:
- P contains decision problems solvable in polynomial time by deterministic algorithms. section 2.1.1
- NP problems have solutions that are hard to find but easy to verify in polynomial time. section 2.1.1
- NP-complete problems are both NP-hard and verifiable in polynomial time; NP-hard problems commonly use approximation or heuristic solvers. section 2.1.1
Problem classes based on hardness and completeness. Problems can be categorized into NP-hard, NP-complete, NP, or P.
Use the classification figure to compare P, NP, NP-complete, and NP-hard problem categories. section 2.1.1
