AI engineering glossary · Data structures algorithms

What is TSP (traveling salesman problem)?

Traveling salesman problem (also called TSP): The problem of finding the shortest tour that visits each city exactly once and returns to the start. It is NP-hard, so exact solutions take exponential time and practical work uses heuristics or approximations.

Level: advancedTopic: Data structures algorithms

Traveling salesman problem: an example

Visiting 20 cities has about 20!/2 possible tours, which is far too many to check one by one.

Related terms

More Data structures algorithms terms

Where you learn it

Traveling salesman problem is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.

Before you go

Take the cheat sheet with you

One free PDF: the key AI-engineering terms, formulas and Python idioms. No spam; unsubscribe any time.