Update TSP.ipynb

This commit is contained in:
Peter Norvig
2025-12-07 09:58:48 -08:00
committed by GitHub
parent 64d60e62ee
commit c562e477aa

View File

@@ -31,10 +31,10 @@
"\n",
"|   |   |\n",
"|--------|--------|\n",
"|*Given a **set of cities***|I'll represent them with a set of points in the (*x*, *y*) plane|\n",
"|*and the **distance** between each pair of cities*,|I'll define a function `distance(A, B)`|\n",
"|*what is the **shortest***| I'll use `shortest(tours)` to find this, and `tour_length(tour)` to compute the length of each candidate tour.|\n",
"|***tour***|A **tour** will be represented by a list. `[A, B, C]` is the tour from `A` to `B` to`C` and back to `A` . |\n",
"|*Given a set of cities*|I'll represent them with a set of points in the (*x*, *y*) plane|\n",
"|*and the distance between each pair of cities*,|I'll define a function `distance(A, B)`|\n",
"|*what is the shortest*| I'll use `shortest(tours)` to find this, and `tour_length(tour)` to compute the length of each candidate tour.|\n",
"|*tour*|A **tour** will be represented by a list. `[A, B, C]` is the tour from `A` to `B` to`C` and back to `A` . |\n",
"|*that visits each city exactly once, and returns to the starting city?*|The function `valid_tour(tour)` will check this.|\n",
"\n",
"Four more basic concepts, implied by the definition:\n",