Skip to content

Main content

Random Traveling Salesman with Time Windows Instance Generator

Generate integer-coordinate cities, ceiling-Euclidean travel times in abstract time units, fixed customer service times and inclusive windows around a feasible randomized depot-return tour; no optimality or real routing claim.

Loading tool…

Description

Generate integer-coordinate cities, ceiling-Euclidean travel times in abstract time units, fixed customer service times and inclusive windows around a feasible randomized depot-return tour; no optimality or real routing claim.

An optimization instance defines choices, constraints, and an objective. A feasible witness demonstrates that its stated constraints can be met; it establishes optimality only when the tool actually computes and verifies an optimum.

Generate integer-coordinate cities, ceiling-Euclidean travel times in abstract time units, fixed customer service times and inclusive windows around a feasible randomized depot-return tour; no optimality or real routing claim.

When to use this tool

Use this generator to create reproducible traveling salesman time windows instance cases from the supplied model or bank. Inspect the returned evidence before using cases in a test or exercise.

How to use the tool and how it works

  1. Supply cityCount, minimumCoordinate, maximumCoordinate, serviceDuration, windowSlack in the field shapes below. Set seed when you need an explicit replay.
  2. Run the tool and correct any input error. For generated controls, distinguish a successful fixture containing an invalid case from failure to generate the fixture.
  3. Read points, travelTimes, serviceDurations, timeWindows, tour, arrivalTimes, returnTime. Use the conventions below and keep answer-bearing fields separate when presenting an exercise.

Draw integer-coordinate cities and round Euclidean distances upward into integer travel times. Shuffle a depot-return tour, add customer service durations, and place inclusive time windows around that tour’s arrival times; return its schedule as a feasible witness.1

Input fieldMeaning and unitsAccepted input
cityCountCity CountRequired. Safe integer; minimum 2; maximum 64.
minimumCoordinateMinimum CoordinateRequired. Safe integer.
maximumCoordinateMaximum CoordinateRequired. Safe integer.
serviceDurationService DurationRequired. Safe integer; minimum 0; maximum 9007199254740991.
windowSlackWindow SlackRequired. Safe integer; minimum 0; maximum 9007199254740991.
seedOptional numeric seed; takes precedence over context randomness. Without either, use the fixed tool.io default seed.Optional. Safe integer.
Output fieldInterpretationReturned shape
pointsPointsRequired. Array of Array of Safe integer.; minimum items 2; maximum items 2.; minimum items 2; maximum items 64.
travelTimesTravel TimesRequired. Array of Array of Safe integer; minimum 0; maximum 9007199254740991.; minimum items 2; maximum items 64.; minimum items 2; maximum items 64.
serviceDurationsService DurationsRequired. Array of Safe integer; minimum 0; maximum 9007199254740991.; minimum items 2; maximum items 64.
timeWindowsTime WindowsRequired. Array of Array of Safe integer; minimum 0; maximum 9007199254740991.; minimum items 2; maximum items 2.; minimum items 2; maximum items 64.
tourTourRequired. Array of Safe integer; minimum 0; maximum 63.; minimum items 2; maximum items 65.
arrivalTimesArrival TimesRequired. Array of Safe integer; minimum 0; maximum 9007199254740991.; minimum items 3; maximum items 65.
returnTimeReturn TimeRequired. Safe integer; minimum 0; maximum 9007199254740991.
randomnessReplay metadata: source is seed or context; seed is the normalized 32-bit seed or null for a context source.Required. Object; no unknown keys.
randomness.seedOptional numeric replay seed; normalization and precedence are explained below.Required. Safe integer. or Null.
randomness.sourceSourceRequired. Text; one of "context", "seed".

An explicit safe-integer seed takes precedence over injected context randomness and is normalized to an unsigned 32-bit integer. With no seed and no context source, replay uses the fixed tool.io default seed. A context source must return finite values from zero inclusive to one exclusive; its advancing state must be retained separately. randomness records the source and normalized seed, or null for context. These generators are not cryptographic random sources.

json
{
  "input": {
    "cityCount": 4,
    "minimumCoordinate": -10,
    "maximumCoordinate": 10,
    "serviceDuration": 2,
    "windowSlack": 3,
    "seed": 42
  },
  "output": {
    "points": [
      [
        2,
        -1
      ],
      [
        7,
        4
      ],
      [
        -7,
        1
      ],
      [
        -5,
        3
      ]
    ],
    "travelTimes": [
      [
        0,
        8,
        10,
        9
      ],
      [
        8,
        0,
        15,
        13
      ],
      [
        10,
        15,
        0,
        3
      ],
      [
        9,
        13,
        3,
        0
      ]
    ],
    "serviceDurations": [
      0,
      2,
      2,
      2
    ],
    "timeWindows": [
      [
        0,
        56
      ],
      [
        24,
        30
      ],
      [
        7,
        13
      ],
      [
        39,
        45
      ]
    ],
    "tour": [
      0,
      2,
      1,
      3,
      0
    ],
    "arrivalTimes": [
      0,
      10,
      27,
      42,
      53
    ],
    "returnTime": 53,
    "randomness": {
      "seed": 42,
      "source": "seed"
    }
  }
}

Limitations and assumptions

  • Time units are abstract and supplied slack controls windows. The witness need not be optimal and does not model real travel conditions, road restrictions or an operational dispatch schedule.
  • A replay requires the same complete input and implementation. Randomized construction does not guarantee uniform coverage of every feasible output; finite samples can repeat unless a distinct-selection rule is explicitly stated.
  • The field tables state structural bounds; cross-field constraints and bounded search or output budgets also apply. Unknown keys are rejected where the object contract disallows them. Input errors are distinct from null fields and deliberate invalid controls in a successful output.

Alternative or Complementary methods

For a supplied example, inspect the returned construction or delegated check directly. To evaluate a consumer, also test cases chosen for its own boundaries; a generated finite corpus does not establish exhaustive coverage.

References

  1. Tool behavior and example: Random Traveling Salesman With Time Windows Instance Generator — tool.io

Similar or alternative tools

  • Random Euclidean Traveling Salesman Instance Generator

    Generate labeled integer-coordinate cities and their complete symmetric Euclidean distance matrix, plus a randomized depot-return tour and its measured length; coincident cities are allowed and the tour is not claimed optimal.

  • Random Interval Scheduling Challenge Generator

    Generate synthetic positive-duration half-open jobs and solve the declared count or weight objective exactly with finish-time dynamic programming, retaining one optimum with exclusion on objective ties.