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
- Supply cityCount, minimumCoordinate, maximumCoordinate, serviceDuration, windowSlack in the field shapes below. Set seed when you need an explicit replay.
- 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.
- 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 field | Meaning and units | Accepted input |
|---|---|---|
| cityCount | City Count | Required. Safe integer; minimum 2; maximum 64. |
| minimumCoordinate | Minimum Coordinate | Required. Safe integer. |
| maximumCoordinate | Maximum Coordinate | Required. Safe integer. |
| serviceDuration | Service Duration | Required. Safe integer; minimum 0; maximum 9007199254740991. |
| windowSlack | Window Slack | Required. Safe integer; minimum 0; maximum 9007199254740991. |
| seed | Optional numeric seed; takes precedence over context randomness. Without either, use the fixed tool.io default seed. | Optional. Safe integer. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| points | Points | Required. Array of Array of Safe integer.; minimum items 2; maximum items 2.; minimum items 2; maximum items 64. |
| travelTimes | Travel Times | Required. Array of Array of Safe integer; minimum 0; maximum 9007199254740991.; minimum items 2; maximum items 64.; minimum items 2; maximum items 64. |
| serviceDurations | Service Durations | Required. Array of Safe integer; minimum 0; maximum 9007199254740991.; minimum items 2; maximum items 64. |
| timeWindows | Time Windows | Required. Array of Array of Safe integer; minimum 0; maximum 9007199254740991.; minimum items 2; maximum items 2.; minimum items 2; maximum items 64. |
| tour | Tour | Required. Array of Safe integer; minimum 0; maximum 63.; minimum items 2; maximum items 65. |
| arrivalTimes | Arrival Times | Required. Array of Safe integer; minimum 0; maximum 9007199254740991.; minimum items 3; maximum items 65. |
| returnTime | Return Time | Required. Safe integer; minimum 0; maximum 9007199254740991. |
| randomness | Replay 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.seed | Optional numeric replay seed; normalization and precedence are explained below. | Required. Safe integer. or Null. |
| randomness.source | Source | Required. 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.
{
"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
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.