Ortwerk
stop order check
Computes the planned tour length (great-circle distance × detour factor, or your distance matrix) from the depot through the stops in order (and back), then searches a shorter order: exhaustively for up to 8 stops, otherwise nearest neighbour followed by 2-opt and Or-opt moves (segments of 1-3 stops, both directions) until no improvement — a heuristic that is not guaranteed optimal. Reports the saving, the improved order, pairs of planned legs that properly cross (each crossing means a 2-opt.
POST https://ort.halowerk.com/v1/stop-order-checkInputs
| Field | Type | Required | Description |
|---|---|---|---|
| depot | object | Yes | Start (and end) of the tour. |
| stops | array | Yes | Stops in planned order. |
| return_to_depot | boolean | No | Tour ends at the depot. |
| detour_factor | number | No | Factor on great-circle distances (your assumption; does not change the order). |
| matrix_km | array | No | Optional road distance matrix in km; index 0 = depot, then stops in the given order. |
| tolerance_pct | number | No | Saving up to which the order is called plausible. |
Show full input schema
{
"type": "object",
"additionalProperties": false,
"required": [
"depot",
"stops"
],
"properties": {
"depot": {
"type": "object",
"additionalProperties": false,
"required": [
"lat",
"lon"
],
"properties": {
"lat": {
"type": "number",
"minimum": -90,
"maximum": 90,
"description": "Latitude in WGS84 degrees."
},
"lon": {
"type": "number",
"minimum": -180,
"maximum": 180,
"description": "Longitude in WGS84 degrees."
}
},
"description": "Start (and end) of the tour."
},
"stops": {
"type": "array",
"minItems": 2,
"maxItems": 200,
"description": "Stops in planned order.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"id",
"lat",
"lon"
],
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Stop reference."
},
"lat": {
"type": "number",
"minimum": -90,
"maximum": 90,
"description": "Latitude."
},
"lon": {
"type": "number",
"minimum": -180,
"maximum": 180,
"description": "Longitude."
}
}
}
},
"return_to_depot": {
"type": "boolean",
"default": true,
"description": "Tour ends at the depot."
},
"detour_factor": {
"type": "number",
"minimum": 1,
"maximum": 3,
"default": 1,
"description": "Factor on great-circle distances (your assumption; does not change the order)."
},
"matrix_km": {
"type": "array",
"maxItems": 201,
"items": {
"type": "array",
"maxItems": 201,
"items": {
"type": "number",
"minimum": 0,
"maximum": 100000
}
},
"description": "Optional road distance matrix in km; index 0 = depot, then stops in the given order."
},
"tolerance_pct": {
"type": "number",
"minimum": 0,
"maximum": 100,
"default": 5,
"description": "Saving up to which the order is called plausible."
}
}
}Published input example
{
"depot": {
"lat": 52,
"lon": 7
},
"stops": [
{
"id": "N",
"lat": 52.009,
"lon": 7
},
{
"id": "S",
"lat": 51.991,
"lon": 7
},
{
"id": "E",
"lat": 52,
"lon": 7.0146
},
{
"id": "W",
"lat": 52,
"lon": 6.9854
}
]
}Result & documentation
Machine-readable documentation of this hub
Source of this page: the published HALOWERK catalog. Updated: 2026-11-17 UTC.
More endpoints in this hub
- Ortwerk0.01 USDC
area coverage
POSThttps://ort.halowerk.com/v1/area-coverageRuns one multi-source Dijkstra from all origins (Routing runs on HALOWERK's own graph of the German road and path network built from OpenStreetMap (Geofabrik germany-latest.osm.pbf, data until 2026-11-12, ODbL 1.0; 25 million nodes, edges a
- Ortwerk0.004 USDC
autobahn roadworks
POSThttps://ort.halowerk.com/v1/autobahn-roadworksFetches live roadworks (long- and short-term) and closures per motorway from the public Autobahn App API of Die Autobahn GmbH des Bundes (no key; https://verkehr.autobahn.de/o/autobahn). The free-text periods are parsed into concrete interv
- Ortwerk0.004 USDC
avalanche bulletin
POSThttps://ort.halowerk.com/v1/avalanche-bulletinFresh official WSL SLF CAAMLv6 JSON for one Swiss warning region, in de/en/fr/it with explicit actual-language fallback. Includes the complete unmodified bulletin, all elevation/aspect/time distinctions, publication and validity times, sour