Read the symmetric distances for a tiny TSP instance. This is a small deterministic example, not solver engineering.

Example

Read the symmetric distances for a tiny TSP instance. The travelling-salesman problem asks for the shortest tour that visits every city once and returns home. Symmetric means the distance from one city to another is the same both ways, so the table is mirrored across its diagonal and each pair of cities needs only a single value.

highlighted = computed this step

Step 1 — Cities

Set up the exact small combinatorics values.

cities(A, B, C, D)\begin{array}{c|c}\text{cities}&\text{(A, B, C, D)}\end{array}

Step 2 — Distances

Compute the highlighted combinatorics value.

undirected distances((A, B, 4), (A, C, 7), (A, D, 3), (B, C, 6), (B, D, 5), (C, D, 2))\begin{array}{c|c}\text{undirected distances}&\hlmath{\text{((A, B, 4), (A, C, 7), (A, D, 3), (B, C, 6), (B, D, 5), (C, D, 2))}}\end{array}
combinatorics-search Every row is intentionally ordered and pinned to the lesson specification.