ratio.

Find a tool

Browse all tools and categories ↗
TRAVELING SALESPERSON

Traveling Salesperson Calculator

Find an exact minimum-cost tour visiting each node once and returning to node zero in a small directed cost matrix.

Enter your values

01 / INPUT
Calculated on your device

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.

    RELATED TOOL · GRAPH THEORYWeighted Graph Shortest Route Calculator

    Find a least-cost route through a small directed or undirected edge graph with nonnegative costs.

    RELATED TOOL · TIMETravel Leg and Arrival Time Calculator

    Plan a sequence of entered distances, average speeds and breaks with dated arrival times.

    RELATED TOOL · PLANNINGCritical Path and Project Slack Calculator

    Calculate earliest and latest task times, total slack and critical tasks in a dependency network.

    ADVERTISEMENT

    Reserved advertising space.