Traveling Salesperson Calculator
Find an exact minimum-cost tour visiting each node once and returning to node zero in a small directed cost matrix.
YOUR CALCULATION
Result
—
Calculation steps
Work through one step at a time or reveal the complete calculation. The steps use your current inputs.
How to calculate
Use Held–Karp subset dynamic programming, allowing asymmetric entered costs while fixing the starting node at zero.
DP[visited,last]=min(DP[visited without last,previous]+cost(previous,last)); close tour to node 0
Worked example
The four-node default symmetric matrix has minimum tour cost 80, for example 0→1→3→2→0.
Assumptions and input details
Complete matrix of nonnegative costs, 2–14 nodes. No missing edges, road data, traffic, time windows or vehicle constraints; costs are consistent numerical units. One optimal tour is shown when several tie. Exact exponential-size search is bounded for browser use.
Using this calculator
Can I enter my own problem?
Yes. Replace the example values with your own inputs. The result, calculation steps, tables and applicable diagrams update from those inputs. Blank or invalid values clear the result; example values are never silently substituted for missing inputs.
Are the results exact?
Results use floating-point arithmetic and displayed rounding. Read the formula, assumptions and any stated data precision before interpreting the result.
Is my input uploaded?
The calculation runs in your browser. No account, file upload or external AI service is required. Inputs are not saved between page reloads.
Find a least-cost route through a small directed or undirected edge graph with nonnegative costs.
Plan a sequence of entered distances, average speeds and breaks with dated arrival times.
Calculate earliest and latest task times, total slack and critical tasks in a dependency network.
Reserved advertising space.