Tour
A tour is a closed route that visits the required locations and returns to its starting location.
Grokking AI Algorithms, Second Edition
A tour is a complete route constructed by an ant through the locations or attractions of a routing problem.
- How it is used
- Uses a complete visit sequence as the unit ants construct, compare, and repeat while solving routing problems.
- How deep it goes
- Explains construction, unvisited-destination constraints, distance comparison, and iteration, while deferring broader route theory.
- Examples
- Demonstrates tours with carnival attractions, an optimal six-stop sequence, distance tables, and Python selection and evaluation routines.
- What you can do after
- Apply it via Python to construct candidate routes, measure their distances, and retain the shortest completed tour.
Read how Grokking AI Algorithms, Second Edition explains tour →
Advanced Algorithms and Data Structures
A tour is a closed sequence of locations that visits the required locations and returns to its starting location.
- How it is used
- Optimizes a delivery truck’s closed route after its destinations and load are fixed.
- How deep it goes
- Defines tour constraints, cost minimization, and symmetry-based pruning, but defers cross-truck assignment.
- Examples
- Uses delivery trucks, city maps, complete graphs, weighted edges, and equivalent city permutations.
- What you can do after
- Evaluate candidate closed routes and reduce redundant permutations before searching for a minimum-cost tour.
Read how Advanced Algorithms and Data Structures explains tour →
Related concepts
- objective functionmeasured by · An objective function assigns values to candidate solutions, predictions, or parameter settings according to a criterion to be minimized or maximized.
- permutationequivalent to · A permutation is a bijective rearrangement of the elements of a finite set, equivalently an ordering in which each element appears exactly once.
- cyclekind of · A cycle is a recurring sequence of connected elements or events that returns to an earlier point, forming a loop.
- brute-force searchused by · Brute-force search systematically tests many or all candidates in a defined search space, without relying on selective shortcuts to narrow it.
- locally optimal solutionequivalent to · A locally optimal solution is a feasible point whose objective value is no worse than those of sufficiently nearby points, though a better solution may exist elsewhere.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

