TSP SOLVER 2026

TSP Solver – User Guide

Official HTML manual for TSP Solver (2026 edition). Includes algorithms, performance, settings, and workflows.

Author: Ing. Robert Polák (RoboPol) Contact: robopol@gmail.com Manual: 2026

Oficiálna HTML príručka pre TSP Solver (edícia 2026). Obsahuje algoritmy, výkonnosť, nastavenia a postupy.

Autor: Ing. Robert Polák (RoboPol) Kontakt: robopol@gmail.com Príručka: 2026

Contents

Obsah

Introduction

TSP Solver works with the Traveling Salesman Problem (TSP): search for a very short route that visits all points exactly once and returns to the start. It is useful for logistics, route planning, PCB drilling, CNC/laser workflows, robotics, and drone path planning (2D and 3D).

The app includes multiple algorithms (LKH, LKH + Robopol hybrids, Robopol Fast/Precise/Refined) and supports both straight-line (air) distance and road distance based on real road networks.

Úvod

TSP Solver pracuje s problémom obchodného cestujúceho (TSP): hľadá čo najkratšiu trasu, ktorá navštívi všetky body presne raz a vráti sa na začiatok. Hodí sa pre logistiku, plánovanie trás, vŕtanie DPS, CNC/laser, robotiku aj plánovanie trás pre drony (2D aj 3D).

Aplikácia obsahuje viacero algoritmov (LKH, LKH + Robopol hybridy, Robopol Fast/Precise/Refined) a podporuje výpočet vzdušnou čiarou aj cestné vzdialenosti podľa reálnej cestnej siete.

Quick start

  1. Choose distance type: Air (points) or Road (addresses).
  2. Add points by clicking on the canvas, or import points from a .txt file.
  3. Select an algorithm (recommendation: Fast for large data, LKH + Robopol Refined for quality-focused runs).
  4. Click Calculate to compute and draw the route.
  5. Export points / image / SVG or save the project as .json.

Rýchly štart

  1. Zvoľ typ vzdialenosti: Air (body) alebo Road (adresy).
  2. Vytvor body kliknutím na plátno alebo importuj body z .txt súboru.
  3. Vyber algoritmus (odporúčanie: Fast pre veľké dáta, LKH + Robopol Refined pre výpočty zamerané na kvalitu).
  4. Klikni Calculate – vypočíta a vykreslí trasu.
  5. Exportuj body/obrázok/SVG alebo ulož projekt ako .json.

Program overview

TSP Solver main screen.
Main screen (example).
  • Program menu
  • Function buttons
  • Canvas – input/output (points + route)
  • Text output – route details and logs

The Canvas and Route Details panel are resizable. On desktop you can also move these panels.

Prehľad programu

Hlavná obrazovka TSP Solveru.
Hlavná obrazovka (príklad).
  • Programové menu
  • Funkčné tlačidlá
  • Plátno – vstup/výstup (body + trasa)
  • Textový výstup – detaily trasy a logy

Plátno aj panel Route Details sú nastaviteľné (resize). Na desktope ich vieš aj presúvať.

Layout & Fullscreen

On desktop, Canvas and Route Details (System Log) behave like floating panels: you can move and resize them to build your preferred workspace. The app remembers the layout.

Move panels

  • Canvas: drag by the border/edge (cursor changes to “move”). Double‑click the edge to reset position.
  • Route Details: drag using the grip bar at the top (appears on hover).

Resize panels

  • Use the browser resize handle (bottom‑right) on both Canvas and Route Details.
  • For huge datasets, enable Skip Drawing in Visual Config to keep the UI responsive.

Fullscreen Canvas + hamburger menu

  1. Click Fullscreen (expand icon) in the top‑right corner of the Canvas.
  2. Canvas fills the entire screen and the side panels are hidden to maximize workspace.
  3. A hamburger menu appears — use it to access File/Method/Data/Edit/Settings/Help/License while fullscreen.
  4. Exit fullscreen by clicking the fullscreen button again (compress icon).
  5. Use Reset View to restore default canvas size/position (also exits fullscreen if active).

On mobile/small screens the app switches to a stacked layout; dragging/resizing is primarily for desktop use.

Rozloženie & Fullscreen

Na desktope sa Canvas a Route Details (System Log) správajú ako „plávajúce“ panely: vieš ich presúvať a meniť veľkosť, aby si si poskladal vlastné pracovné rozloženie. Aplikácia si rozloženie pamätá.

Presúvanie panelov

  • Canvas: presúvaj chytením okraja/rámiku (kurzor sa zmení na „move“). Dvojklik na okraj resetuje pozíciu.
  • Route Details: presúvaj cez úchyt (grip bar) hore (zobrazí sa po nabehnutí myšou).

Zmena veľkosti

  • Veľkosť Canvas aj Route Details zmeníš cez resize úchyt (spodný pravý roh).
  • Pri extrémne veľkých datasetoch zapni v Visual Config Skip Drawing, aby bolo UI plynulé.

Fullscreen Canvas + hamburger menu

  1. Klikni Fullscreen (ikona expand) v pravom hornom rohu Canvas.
  2. Canvas sa prepne na celú obrazovku a ostatné panely sa skryjú, aby bolo maximum miesta.
  3. Zobrazí sa hamburger menu — cez neho sa dostaneš k File/Method/Data/Edit/Settings/Help/License aj vo fullscreen.
  4. Fullscreen vypneš kliknutím na fullscreen tlačidlo znova (ikona compress).
  5. Reset View vráti defaultnú veľkosť/pozíciu Canvas (a vypne fullscreen, ak je aktívny).

Na mobile/menších obrazovkách sa rozloženie automaticky preklopí do „stack“ režimu; presúvanie/resize je primárne pre desktop.

AIR 3D (x, y, z) + 3D view

TSP Solver supports 3D points in Air Distance mode: each point can have coordinates x, y, z (where z represents height). When 3D is enabled, the solver computes distances in 3D and the app opens an interactive 3D VIEW window.

Enable 3D mode

  1. Select Air distance type.
  2. Enable AIR 3D (x,y,z) (checkbox).
  3. Use the Z slider to set the current Z value for newly added points.
Z range: the Z slider supports values from -1000 to 1000 (step 1).

3D VIEW window

  • Draggable: drag by the header bar.
  • Resizable: resize the window corner/edge.
  • Close button: hides the viewer (does not disable 3D mode).
  • Reopen: a SHOW 3D VIEW button appears in the AIR 3D controls if the viewer is hidden.
  • Controls hint: rotate (drag), zoom (mouse wheel), touch drag/pinch (if supported).

Import / Export (3D)

  • x y (2D) or x y z (3D) per line are supported.
  • Numbered lines are supported only with explicit delimiters (examples: 1) x y z, 1: x y, 1, x y).
  • Export automatically includes Z when 3D is enabled (or when any point has non‑zero Z).

AIR 3D (x, y, z) + 3D view

TSP Solver podporuje 3D body v režime Air Distance: každý bod má súradnice x, y, z (kde z je výška). Keď zapneš 3D, vzdialenosti sa počítajú v 3D a otvorí sa interaktívne okno 3D VIEW.

Ako zapnúť 3D režim

  1. Zvoľ Air typ vzdialenosti.
  2. Zapni AIR 3D (x,y,z) (checkbox).
  3. Nastav Z slider – určuje aktuálne Z pre novo pridávané body.
Rozsah Z: slider podporuje hodnoty od -1000 do 1000 (krok 1).

Okno 3D VIEW

  • Presúvateľné: ťahaním za horný header.
  • Resizable: zmeníš veľkosť potiahnutím rohu/okraja.
  • Close: iba skryje 3D viewer (3D režim ostáva zapnutý).
  • Znovuotvorenie: po skrytí sa v AIR 3D ovládaní zobrazí tlačidlo SHOW 3D VIEW.
  • Ovládanie: rotácia ťahaním, zoom kolieskom, na dotyk drag/pinch (ak je podporované).

Import / Export (3D)

  • Podporované riadky x y (2D) alebo x y z (3D).
  • Číslovanie riadkov funguje len s explicitným oddeľovačom (príklady: 1) x y z, 1: x y, 1, x y).
  • Export automaticky pridá Z, keď je zapnutý 3D režim (alebo keď má niektorý bod nenulové Z).

Function buttons

  • Add points
  • Delete points
  • Remove lines
  • Clear all
  • Calculate
Note: These are quick actions. The same features are available in the top menu.

Funkčné tlačidlá

  • Add points
  • Delete points
  • Remove lines
  • Clear all
  • Calculate
Poznámka: Toto sú rýchle akcie. To isté je dostupné aj v hornom menu.

Algorithms

LKH‑3.0.10

Lin‑Kernighan‑Helsgaun is a well-known high-quality heuristic benchmark for large instances.

LKH + Robopol Escape Polish

Hybrid AIR TSP method: LKH first builds a strong route, then Robopol tries targeted escape/polish steps around that route. It can use lower Robopol Refined parameters and still find very good results, because the search starts from a high-quality LKH baseline.

LKH + Robopol Refined

The most quality-oriented preset in the current desktop version. It combines the LKH baseline with full Robopol Refined exploration and keeps LKH as a safety baseline.

Robopol Fast

Fast method for large datasets. Includes TURBO/SUPERBOOST modes and is designed for very large point sets; practical scale depends on hardware, memory, and settings.

Robopol Precise

Higher accuracy method based on Fast. Adds additional local search and refinement to improve route quality.

Robopol Refined

Iterated Local Search (ILS) refinement aimed at small/medium instances where route quality matters. Can sometimes improve on an LKH result on selected instances when settings are tuned.

Enable Edge-Guided Search is the fast Refined mode. When it is enabled, Refined uses the current tour, ranked candidate edges, long/hot edges, and reduction edges to decide where 3-opt, 5-opt, double-bridge, and 2-opt attempts are worth spending time. This makes the calculation much faster, but it can be less precise because the search is narrower and skips many broad fallback moves.

With Edge-Guided Search disabled, Refined behaves closer to the older heavy mode: it allows broader random fallback perturbations and searches a larger space. Use disabled mode when precision is more important than runtime. It is usually slower, but it can find a better route on difficult, larger, or clustered instances.

Nearest Neighbor

Very fast baseline heuristic (lower quality), useful for quick checks.

Quality note: For quality-focused runs, try LKH + Robopol Refined. The hybrid modes can often lower Robopol Refined budgets such as runs, beam width, and ILS iterations while still producing strong results.
First run note: Robopol methods use NUMBA JIT compilation. The first run can be slower, subsequent runs are significantly faster.

Algoritmy

LKH‑3.0.10

Lin‑Kernighan‑Helsgaun je známa benchmarková heuristika pre kvalitné riešenia veľkých inštancií.

LKH + Robopol Escape Polish

Hybridná AIR TSP metóda: LKH najprv postaví silnú trasu a Robopol sa ju potom snaží cielene vyleštiť a uniknúť z lokálneho minima. Hybridy umožňujú znížiť parametre Robopol Refined a stále nájsť veľmi dobré výsledky, pretože štartujú z kvalitnej LKH trasy.

LKH + Robopol Refined

Najviac na kvalitu zameraný režim v aktuálnej desktop verzii. Kombinuje LKH baseline s plným Robopol Refined prieskumom a drží LKH ako bezpečný základ.

Robopol Fast

Rýchla metóda pre veľké datasety. Obsahuje TURBO/SUPERBOOST režimy a je navrhnutá pre veľmi veľké množiny bodov; praktický rozsah závisí od hardvéru, pamäte a nastavení.

Robopol Precise

Presnejšia metóda postavená na Fast. Pridáva dodatočné lokálne optimalizácie pre lepšiu kvalitu trasy.

Robopol Refined

Iterated Local Search (ILS) refinovanie pre malé/stredné inštancie, kde záleží na kvalite trasy. Pri správnych nastaveniach môže na vybraných inštanciách zlepšiť výsledok oproti LKH.

Enable Edge-Guided Search je rýchly režim pre Refined. Keď je zapnutý, Refined používa aktuálnu trasu, zoradené kandidátne hrany, dlhé/hot hrany a redukčné hrany na to, aby vedel, kde má zmysel míňať 3-opt, 5-opt, double-bridge a 2-opt pokusy. Výpočet je tým výrazne rýchlejší, ale môže byť menej presný, pretože hľadanie je užšie a preskakuje veľa širokých fallback krokov.

Keď je Edge-Guided Search vypnutý, Refined sa správa bližšie k staršiemu heavy režimu: povoľuje širšie náhodné fallback perturbácie a prehľadáva väčší priestor možností. Vypnutý režim použi vtedy, keď je presnosť dôležitejšia než rýchlosť. Je zvyčajne pomalší, ale pri ťažkých, väčších alebo klastrovaných inštanciách môže nájsť lepšiu trasu.

Nearest Neighbor

Veľmi rýchla baseline heuristika (nižšia kvalita), vhodná na rýchle testy.

Poznámka ku kvalite: Pre výpočty zamerané na kvalitu použi LKH + Robopol Refined. Hybridné režimy často dovolia znížiť rozpočty Robopol Refined, napríklad počet behov, beam width a ILS iterácie, a stále dosiahnuť veľmi dobré výsledky.
Poznámka k prvému spusteniu: Robopol metódy používajú NUMBA JIT kompiláciu. Prvé spustenie môže byť pomalšie, ďalšie výpočty sú výrazne rýchlejšie.

Performance

  • Robopol Fast is very fast on large AIR datasets where speed is the priority.
  • Turbo mode: about 100,000 points in about 1 minute on a regular PC.
  • Superboost mode: optimized for very large datasets and lower RAM use; speedup depends on data and settings.
  • Quality: route quality depends on dataset, algorithm, and settings; Fast prioritizes speed, while Refined and hybrid modes prioritize quality.
  • 3D support: 2D and 3D (x, y, z) with interactive visualization.
  • Road distance: computes routes on real road networks, exportable to Google Maps.

Výkonnosť

  • Robopol Fast je veľmi rýchly pri veľkých AIR datasetoch, kde je prioritou rýchlosť.
  • Turbo režim: približne 100 000 bodov za približne 1 minútu na bežnom PC.
  • Superboost režim: optimalizovaný pre veľmi veľké datasety a nižšiu spotrebu RAM; zrýchlenie závisí od dát a nastavení.
  • Kvalita: kvalita trasy závisí od datasetu, algoritmu a nastavení; Fast prioritizuje rýchlosť, Refined a hybridné režimy kvalitu.
  • 3D podpora: 2D aj 3D (x, y, z) s interaktívnou vizualizáciou.
  • Cestné vzdialenosti: trasy po reálnej cestnej sieti s exportom do Google Maps.
Source: RoboPol TSP Solver product page. Zdroj: produktová stránka RoboPol TSP Solver.

Settings (recommended)

Method selection

  • Very large point sets: Robopol Fast (Turbo / Superboost).
  • Large (1,000–10,000): Robopol Fast or LKH (time/quality trade‑off).
  • Medium (100–1,000): Robopol Precise or LKH.
  • Small/medium with a quality-focused goal: LKH + Robopol Refined.
  • Fast high-quality hybrid: LKH + Robopol Escape Polish with reduced Refined-style parameters.

Robopol Refined – tuned parameters (for n < 1000)

  • Num Runs > 1
  • Beam Width > 3
  • ILS Iterations ≥ 2000
  • Perturbation Candidates = 16
  • Candidate Edges/Node = 10

For the LKH + Robopol hybrid methods, these values can often be reduced because LKH already provides a high-quality starting route. This can keep quality high while shortening calculation time.

Choose Enable Edge-Guided Search based on your goal: enabled = much faster, but potentially less precise; disabled = slower heavy-style search, but often better when you need maximum route quality.

Nastavenia (odporúčania)

Výber metódy

  • Veľmi veľké množiny bodov: Robopol Fast (Turbo / Superboost).
  • Veľké (1 000–10 000): Robopol Fast alebo LKH (kompromis čas/kvalita).
  • Stredné (100–1 000): Robopol Precise alebo LKH.
  • Malé/stredné s dôrazom na kvalitu: LKH + Robopol Refined.
  • Rýchly kvalitný hybrid: LKH + Robopol Escape Polish so zníženými Refined parametrami.

Robopol Refined – ladené parametre (pre n < 1000)

  • Num Runs > 1
  • Beam Width > 3
  • ILS Iterations ≥ 2000
  • Perturbation Candidates = 16
  • Candidate Edges/Node = 10

Pri LKH + Robopol hybridoch sa tieto hodnoty často dajú znížiť, pretože LKH už dodá kvalitnú štartovaciu trasu. Výsledok môže ostať veľmi dobrý a výpočet sa pritom skráti.

Enable Edge-Guided Search zvoľ podľa cieľa: zapnuté = výrazne rýchlejšie, ale môže byť menej presné; vypnuté = pomalšie heavy hľadanie, ale často lepšie, keď potrebuješ maximálnu kvalitu trasy.

File operations

New Project

Resets to the initial state (clears canvas/output, keeps settings).

Save As

Saves the project as .json (air: tsp_air_data.json, road: tsp_road_data.json).

Open Project

Loads a saved .json project created by TSP Solver.

Import / Export Image

Import a background template and export the current visualization as an image.

Export SVG

Exports route + points as scalable vector graphics (.svg).

Súbory (File operations)

New Project

Reset na úvodný stav (vymaže plátno/výstup, ponechá nastavenia).

Save As

Uloží projekt ako .json (air: tsp_air_data.json, road: tsp_road_data.json).

Open Project

Načíta uložený .json projekt vytvorený v TSP Solver.

Import / Export Image

Import obrázka ako podklad a export aktuálnej vizualizácie do obrázka.

Export SVG

Export trasy + bodov do vektorového formátu (.svg).

Import / Export data

Import points

Accepted coordinate formats (AIR 2D/3D):

  • x y (2D) or x y z (3D), separators: space / comma / semicolon
  • x, y or x, y, z
  • x; y or x; y; z
  • n) x y / n) x y z (numbered, delimiter ))
  • n: x y / n: x y z (numbered, delimiter :)
  • n, x y / n, x y z (numbered, delimiter ,)

Numbering is recognized only when it has an explicit delimiter (), :, ,). This prevents breaking valid 3D files where the first coordinate is an integer.

The first row is treated as the start point. If last equals first, the input is treated as a closed loop.

Decimals must use dot (.), not comma.

Export points

Exports route points to .txt. The exporter preserves your coordinate delimiter (space/comma/semicolon) and numbering style when possible.

  • If AIR 3D is enabled (or any point has non‑zero Z), export uses x y z.
  • Otherwise export uses x y.

Multi-vehicle (mTSP) TXT format

When a multi-vehicle route exists, TSP Solver exports a structured .txt file (for machines/tools) with explicit sections. The format starts with a header and then contains POINTS and ROUTES.

  • # TSP_SOLVER_TXT 1
  • # mode: air or # mode: road
  • # depot: 1, # vehicles: k, # objective: MINSUM|MINMAX|MINMAX_SIZE
  • POINTS section: id x y [z] (AIR) or id lat lon "address" (ROAD)
  • ROUTES section: V <vehicle_id> cost=<cost> stops: id id id ...

IDs in the structured export are 1..n (by point order in the file). Routes reference these IDs.

Random points

Generates random points (for performance testing) and then calculates a route.

Import / Export dát

Import bodov

Podporované formáty súradníc (AIR 2D/3D):

  • x y (2D) alebo x y z (3D), oddeľovače: medzera / čiarka / bodkočiarka
  • x, y alebo x, y, z
  • x; y alebo x; y; z
  • n) x y / n) x y z (číslované, oddeľovač ))
  • n: x y / n: x y z (číslované, oddeľovač :)
  • n, x y / n, x y z (číslované, oddeľovač ,)

Číslovanie sa rozpozná iba vtedy, keď má explicitný oddeľovač (), :, ,). Tým sa zabráni tomu, aby sa platný 3D súbor s celočíselným x mylne bral ako „poradové číslo“.

Prvý riadok je štart. Ak posledný bod = prvý bod, dáta sa berú ako uzavretý okruh.

Desatinný oddeľovač musí byť bodka (.), nie čiarka.

Export bodov

Exportuje body trasy do .txt. Export sa snaží zachovať oddeľovač súradníc (medzera/čiarka/bodkočiarka) aj štýl číslovania, keď je to možné.

  • Ak je zapnuté AIR 3D (alebo má niektorý bod nenulové Z), exportuje x y z.
  • Inak exportuje x y.

TXT formát pre multi-vehicle (mTSP)

Keď existuje multi-vehicle trasa, TSP Solver exportuje štruktúrovaný .txt súbor (pre stroje/nástroje) so sekciami. Formát začína hlavičkou a potom obsahuje POINTS a ROUTES.

  • # TSP_SOLVER_TXT 1
  • # mode: air alebo # mode: road
  • # depot: 1, # vehicles: k, # objective: MINSUM|MINMAX|MINMAX_SIZE
  • Sekcia POINTS: id x y [z] (AIR) alebo id lat lon "adresa" (ROAD)
  • Sekcia ROUTES: V <vehicle_id> cost=<cost> stops: id id id ...

ID v štruktúrovanom exporte sú 1..n (podľa poradia bodov v súbore). Trasy referencujú tieto ID.

Náhodné body

Vygeneruje náhodné body (na test výkonu) a následne vypočíta trasu.

Visual config & Method config

Visual config

  • Canvas colors: Background, Node, Link
  • Sizes: Node size, Link width
  • Skip Drawing (large datasets): disables rendering of points and route on the canvas
  • Page colors (UI theme): Page BG, Sidebar, Panels, Accent, Accent Dark, Text, Borders, Inputs BG, etc.
  • Reset Page Colors: restores default TSP Solver theme colors
Large datasets: for very high point counts (tens of thousands to millions), enable Skip Drawing to keep the app responsive. The solver still runs — only drawing is skipped.

Method config

Use Method Config to tune algorithm parameters. For Robopol Refined, start from the recommended values in the “Settings (recommended)” section.

Hybrid algorithms: LKH + Robopol Escape Polish and LKH + Robopol Refined use the Robopol Refined parameter family. Because LKH already provides a strong seed route, you can often lower values such as Number of Runs, Beam Width, and ILS Iterations and still get good results.

Robopol Refined parameters (reference)

The items below match the Method Config inputs used by Robopol Refined. Descriptions are based on the actual implementation (see app_2025.py).

  • ILS Iterations (ils_iterations): number of main ILS loop iterations. Higher = more time, usually better quality (diminishing returns).
  • No Improvement Limit (ils_no_improvement_limit): stop after this many ILS iterations without improving the global best. Also influences internal “stagnation” thresholds.
  • Number of Runs (refined_runs): independent restarts; the best run is returned. More runs = higher chance of improvement, higher CPU usage (runs are parallelized).
  • Enable Edge-Guided Search (refined_edge_guided_enabled): controls the main speed/precision trade-off in Refined. Enabled prioritizes promising tour/candidate/hot/reduction edges and suppresses many broad fallback perturbations, so it is much faster but can be less precise. Disabled behaves closer to the older heavy mode, searches a larger space, and can produce a better route when quality matters more than runtime.
  • Beam Width (beam_width): how many candidate solutions are kept in the beam at once. Higher = more exploration and CPU cost.
  • Perturbation Candidates (num_candidates): how many perturbed candidates are generated per ILS iteration before selecting the best ones for the beam.
  • Targeting Probability (targeting_probability): probability (0–1) of using a targeted perturbation strategy vs. a more random one.
  • Candidate Edges/Node (num_candidate_edges): candidate-set width for local search (how many “promising neighbors” each node considers). Higher can improve quality but increases preprocessing and local search cost.
  • Max Segment Pct (max_segment_pct): maximum segment length for segment-move perturbations as a fraction of \(n\) (e.g. 0.2 = up to ~20% of nodes).
  • Tolerance Base (acceptance_tolerance_base): controls acceptance of non-improving moves (exploration). Higher = more “willing to accept worse” (can help escape local minima but can also slow convergence).
  • ILS 2-opt Iterations (ils_2opt_iterations): iteration budget for the 2-opt phase inside ILS local search steps.
  • ILS Move Iterations (ils_move_iterations): iteration budget for the segment-move local search inside ILS (used for “polish” moves).
  • ILS Max Segment Size (ils_max_segment_size): maximum moved segment length (in nodes) for segment-move local search.
  • ILS Max Nearest Neighbors (ils_max_nearest_neighbors): how many nearest neighbors are considered during local search operations (speed/quality trade-off).
  • ILS Deep Search (ils_deep_search): deeper search setting for segment-move operations (more thorough = slower).
  • Max Local Search Attempts (max_local_search_attempts): cap on repeated local search attempts per ILS step.
  • Local Search Threshold (local_search_no_improvement_threshold): stop local search early after this many consecutive attempts without improvement.

LKH Multi-vehicle (mTSP) settings

TSP Solver supports multi-vehicle routing (mTSP) via LKH-3.0.10 from the Method Config panel. It is intended mainly for AIR 2D and ROAD workflows. Use AIR 3D (x,y,z) carefully and test smaller jobs before large runs.

  • Problem type: choose TSP (1 route) or Multi-vehicle (mTSP).
  • Vehicles (vehicles): number of vehicles/salesmen (routes) to split the tour into.
  • Objective (mtsp_objective):
    • MINSUM: minimize total sum of all routes (best overall distance/time).
    • MINMAX: minimize the longest single route (fairness by distance/time).
    • MINMAX_SIZE: balance workload by minimizing the maximum number of stops per vehicle (not a direct distance objective).
  • Depot index (1..n) (depot_index): start/end node for all routes (1 = first point).
    ROAD note: in Road mode this index refers to the order of successfully geocoded addresses (1 = first). Failed address lines are skipped.
  • Min points / vehicle (mtsp_min_size): minimum number of stops per vehicle (excludes depot). Use to prevent 1-vs-99 splits.
  • Max points / vehicle (mtsp_max_size): maximum number of stops per vehicle (excludes depot). Use to cap workload.
  • Road optimize by (road_objective): choose Distance (km) or Time (sec) for ROAD mode.

LKH-3.0.10 advanced settings

These controls are under LKH-3.0.10 METHOD → ADVANCED SETTINGS in Method Config. They tune the LKH engine used by plain LKH and by LKH-based workflows where applicable.

  • MOVE_TYPE (moveType, default 5): maximum Lin-Kernighan move depth. Higher values search more neighborhoods and can increase runtime.
  • PATCHING_C (patchingC, default 0): cycle patching setting after LK moves. Higher values can make the search more thorough but slower.
  • PATCHING_A (patchingA, default 0): patching breadth/alternate patching setting. Keep at 0 unless you are testing LKH quality tuning.
  • RUNS (runs, default 1): independent LKH runs; the best result is used. More runs usually means more time.
  • MAX_TRIALS (maxTrials, default 1): trial budget inside each run. Increase for a more thorough LKH search.
  • CANDIDATE_SET_TYPE (candidateSetType, default DELAUNAY): candidate-edge generator. UI options are DELAUNAY, ALPHA, DELAUNAY PURE, NEAREST-NEIGHBOR, QUADRANT, and POPMUSIC.
  • MAX_CANDIDATES (maxCandidates, default 5): maximum candidate edges per node. Higher values can improve search coverage but increase memory/runtime.
  • INITIAL_PERIOD (initialPeriod, default 100): LKH preprocessing/ascent period used while building candidate information.
  • POPMUSIC_SOLUTIONS (popmusicSolutions, default 50): number of POPMUSIC candidate solutions when POPMUSIC candidate sets are used.
Tip: keep the LKH defaults for normal work. When tuning, change one or two LKH settings at a time and compare distance, runtime, and repeatability.
Edition: Multi-vehicle (mTSP) is available in the Professional edition only.
Note (import/export): multi-vehicle route import/export is not fully implemented yet. You can compute and visualize mTSP routes and read per-vehicle routes in Route Details.

Visual config & Method config

Visual config

  • Farby plátna: Background, Node, Link
  • Veľkosti: Node size, Link width
  • Skip Drawing (veľké datasety): vypne renderovanie bodov a trasy na plátne
  • Farby stránky (UI téma): Page BG, Sidebar, Panels, Accent, Accent Dark, Text, Borders, Inputs BG, atď.
  • Reset Page Colors: obnoví defaultné TSP Solver farby
Veľké datasety: pri extrémnych počtoch bodov (desiatky tisíc až milióny) zapni Skip Drawing, aby bolo UI plynulé. Výpočet beží ďalej — len sa preskočí kreslenie.

Method config

V Method Config nastavuješ parametre algoritmov. Pre Robopol Refined začni odporúčanými hodnotami v sekcii „Nastavenia (odporúčania)“.

Hybridné algoritmy: LKH + Robopol Escape Polish a LKH + Robopol Refined používajú rodinu parametrov Robopol Refined. Keďže LKH už dodá silnú štartovaciu trasu, často môžeš znížiť hodnoty ako Number of Runs, Beam Width a ILS Iterations a stále dostať dobré výsledky.

Robopol Refined – význam parametrov

Nižšie sú vysvetlené parametre, ktoré používa Robopol Refined (podľa implementácie v app_2025.py).

  • ILS Iterations (ils_iterations): počet hlavných ILS iterácií. Viac = pomalšie, typicky lepšia kvalita (klesajúci prínos).
  • No Improvement Limit (ils_no_improvement_limit): ukončí beh po X iteráciách bez zlepšenia globálneho best. Ovplyvňuje aj interné prahy stagnácie.
  • Number of Runs (refined_runs): viac nezávislých behov; vráti sa najlepší. Viac = vyššia šanca na zlepšenie, vyššie CPU (behy bežia paralelne).
  • Enable Edge-Guided Search (refined_edge_guided_enabled): hlavný kompromis medzi rýchlosťou a presnosťou v Refined. Zapnuté uprednostňuje sľubné tour/kandidátne/hot/redukčné hrany a potláča veľa širokých fallback perturbácií, takže je oveľa rýchlejšie, ale môže byť menej presné. Vypnuté sa správa bližšie k staršiemu heavy režimu, prehľadáva väčší priestor a môže dať lepšiu trasu, keď je kvalita dôležitejšia než čas výpočtu.
  • Beam Width (beam_width): koľko kandidátov sa drží v „beame“. Viac = viac prieskumu, viac CPU.
  • Perturbation Candidates (num_candidates): koľko perturbovaných kandidátov sa generuje v jednej ILS iterácii.
  • Targeting Probability (targeting_probability): pravdepodobnosť (0–1) cielenej perturbácie vs. náhodnej.
  • Candidate Edges/Node (num_candidate_edges): šírka kandidátnej množiny pre lokálne vyhľadávanie (koľko susedov sa zvažuje). Viac môže zlepšiť kvalitu, ale spomalí prepočet.
  • Max Segment Pct (max_segment_pct): max dĺžka presúvaného segmentu ako podiel z \(n\).
  • Tolerance Base (acceptance_tolerance_base): akceptácia mierne horších krokov (exploration). Vyššie = ľahšie únik z lokálnych miním, ale môže spomaliť konvergenciu.
  • ILS 2-opt Iterations (ils_2opt_iterations): limit iterácií pre 2-opt v rámci ILS lokálnej optimalizácie.
  • ILS Move Iterations (ils_move_iterations): limit iterácií pre segment-move kroky v rámci ILS.
  • ILS Max Segment Size (ils_max_segment_size): max dĺžka segmentu (v bodoch) pre segment-move.
  • ILS Max Nearest Neighbors (ils_max_nearest_neighbors): počet najbližších susedov uvažovaných v lokálnych krokoch (rýchlosť/kvalita).
  • ILS Deep Search (ils_deep_search): hĺbka vyhľadávania pre segment-move (viac = dôkladnejšie, pomalšie).
  • Max Local Search Attempts (max_local_search_attempts): limit opakovaných pokusov lokálneho hľadania v jednom kroku.
  • Local Search Threshold (local_search_no_improvement_threshold): predčasné ukončenie lokálneho hľadania po X neúspešných pokusoch.

LKH Multi-vehicle (mTSP) nastavenia

TSP Solver podporuje multi-vehicle routing (mTSP) cez LKH-3.0.10 v Method Config. Je to určené hlavne pre AIR 2D a ROAD workflow. Pri AIR 3D (x,y,z) najprv otestuj menšie úlohy pred veľkými výpočtami.

  • Problem type: zvoľ TSP (1 route) alebo Multi-vehicle (mTSP).
  • Vehicles (vehicles): počet áut/salesmen (koľko trás sa má vytvoriť).
  • Objective (mtsp_objective):
    • MINSUM: minimalizuje súčet všetkých trás (najlepšie celkovo).
    • MINMAX: minimalizuje najdlhšiu trasu (férovosť podľa dĺžky/času).
    • MINMAX_SIZE: vyrovnáva workload podľa počtu zastávok (nie je to priamo cieľ na dĺžku).
  • Depot index (1..n) (depot_index): štart/cieľ pre všetky trasy (1 = prvý bod).
    ROAD poznámka: v Road režime je to poradie úspešne geokódovaných adries (1 = prvá). Neúspešné riadky sa preskočia.
  • Min points / vehicle (mtsp_min_size): minimum bodov na auto (bez depa).
  • Max points / vehicle (mtsp_max_size): maximum bodov na auto (bez depa).
  • Road optimize by (road_objective): v ROAD režime zvoľ Distance (km) alebo Time (sec).

LKH-3.0.10 advanced nastavenia

Tieto ovládacie prvky sú v LKH-3.0.10 METHOD → ADVANCED SETTINGS v okne Method Config. Ladia LKH engine používaný pri čistom LKH a podľa režimu aj pri LKH workflow.

  • MOVE_TYPE (moveType, default 5): maximálna hĺbka Lin-Kernighan krokov. Vyššie hodnoty skúšajú viac susedstiev a môžu predĺžiť výpočet.
  • PATCHING_C (patchingC, default 0): cycle patching po LK krokoch. Vyššie hodnoty môžu spustiť dôkladnejšie, ale pomalšie hľadanie.
  • PATCHING_A (patchingA, default 0): šírka/alternatíva patchingu. Nechaj 0, pokiaľ cielene netestuješ LKH kvalitu.
  • RUNS (runs, default 1): nezávislé LKH behy; použije sa najlepší výsledok. Viac behov zvyčajne znamená dlhší čas.
  • MAX_TRIALS (maxTrials, default 1): rozpočet pokusov v rámci jedného behu. Zvýš ho pri dôkladnejšom LKH hľadaní.
  • CANDIDATE_SET_TYPE (candidateSetType, default DELAUNAY): generátor kandidátnych hrán. UI možnosti sú DELAUNAY, ALPHA, DELAUNAY PURE, NEAREST-NEIGHBOR, QUADRANT a POPMUSIC.
  • MAX_CANDIDATES (maxCandidates, default 5): maximum kandidátnych hrán na uzol. Vyššie hodnoty môžu rozšíriť hľadanie, ale zvýšia pamäť a čas.
  • INITIAL_PERIOD (initialPeriod, default 100): LKH preprocessing/ascent perióda pri tvorbe kandidátnych informácií.
  • POPMUSIC_SOLUTIONS (popmusicSolutions, default 50): počet POPMUSIC kandidátnych riešení pri použití POPMUSIC candidate setu.
Tip: pre bežnú prácu nechaj LKH defaulty. Pri ladení meň naraz jednu alebo dve LKH hodnoty a porovnávaj dĺžku trasy, čas výpočtu a opakovateľnosť.
Poznámka (import/export): import/export multi-vehicle trás ešte nie je kompletne hotový. mTSP trasy vieš vypočítať a vizualizovať, a per-vehicle výpis nájdeš v Route Details.

Actions: Create / Delete / Calculate

Add points

Click on the canvas to add points. Point #1 is used as the start/end.

Delete points

Enable delete mode and click a point to remove it.

Remove lines

Clears the currently drawn route connections.

Clear all

Removes all points, routes and imported background images.

Calculate

Computes the route for the selected method. Requires at least 2 points.

Akcie: Create / Delete / Calculate

Add points

Kliknutím na plátno pridáš body. Bod #1 je štart/cieľ.

Delete points

Zapni delete režim a klikni na bod, ktorý chceš odstrániť.

Remove lines

Vymaže aktuálne vykreslené spojenia trasy.

Clear all

Odstráni všetky body, trasy aj importované obrázky na pozadí.

Calculate

Vypočíta trasu podľa zvolenej metódy. Potrebuje aspoň 2 body.

TSP Art

Create single‑line artworks by converting an image into points and solving TSP on them.

  1. Dataset → TSP Art Gen
  2. Select an image and number of points (conversion can take ~30 seconds)
  3. Adjust colors in System → Visual Config
  4. Select method (Robopol recommended)
  5. Click Calculate
TSP Art example.
TSP Art example output.

TSP Art

Vytvára jednoťažkové kresby: prevedie obrázok na body a následne vyrieši TSP nad týmito bodmi.

  1. Dataset → TSP Art Gen
  2. Vyber obrázok a počet bodov (konverzia môže trvať ~30 sekúnd)
  3. Nastav farby v System → Visual Config
  4. Vyber metódu (odporúčané: Robopol)
  5. Klikni Calculate
Príklad TSP Art.
Príklad TSP Art výstupu.

Examples

Example 1 – points on an imported image

  1. Import an image template.
  2. Add a start point (#1), then add remaining points.
  3. Adjust colors (Visual Config).
  4. Select method (Algorithm menu) and Calculate.
  5. Export the route (image/points/SVG) and Save As project.

Example 2 – import points from TXT

  1. Prepare a .txt file with coordinates.
  2. Dataset → Import Points.
  3. Select method and Calculate.
  4. Export points and Save As project.

Screenshots (click to open)

Data formats

Road distance & maps

TSP Art

UI examples

Príklady

Príklad 1 – body na importovanom obrázku

  1. Importuj obrázok ako šablónu.
  2. Pridaj štart bod (#1) a ostatné body.
  3. Nastav farby (Visual Config).
  4. Vyber metódu (Algorithm) a Calculate.
  5. Exportuj trasu (obrázok/body/SVG) a ulož projekt (Save As).

Príklad 2 – import bodov z TXT

  1. Priprav .txt súbor so súradnicami.
  2. Dataset → Import Points.
  3. Vyber metódu a Calculate.
  4. Exportuj body a ulož projekt (Save As).

Ukážky (klikni pre otvorenie)

Formáty dát

Cestné vzdialenosti & mapy

TSP Art

UI ukážky

Road distance (maps)

Road mode calculates routes on real road networks (geocoding + routing).

You can also enable Multi-vehicle (mTSP) for Road mode via Method Config → MULTI-VEHICLE / ROAD (LKH) (vehicles, objective, depot, min/max stops). AIR 2D is supported too; AIR 3D should be verified on smaller jobs before larger runs.

Depot index in Road mode: the depot is the common start/end for all vehicles. depot_index is the 1-based order of successfully geocoded addresses in your list (1 = first). Address lines that fail geocoding are skipped (they do not count into the index).
  1. Select Road Distance.
  2. Enter addresses (one per line).
  3. Click Geocode Addresses.
  4. Click Calculate to compute the route.
  5. Use Show on Map to open an interactive preview.
  6. Use GOOGLE MAPS export to open the route in Google Maps (navigation / send to phone).
Important: Requires internet connection and can be slower due to external routing requests.

Cestné vzdialenosti (mapy)

Road režim počíta trasu po reálnej cestnej sieti (geokódovanie + routovanie).

Aj v Road režime vieš zapnúť Multi-vehicle (mTSP) cez Method Config → MULTI-VEHICLE / ROAD (LKH) (vehicles, objective, depot, min/max stops). AIR 2D je podporované tiež; AIR 3D si najprv over na menších úlohách.

Depot index v Road režime: depot je spoločný štart/cieľ pre všetky vozidlá. depot_index je 1-based poradie úspešne geokódovaných adries v zozname (1 = prvá). Riadky, ktoré sa negeokódujú, sa preskočia (nezapočítajú sa do indexu).
  1. Zvoľ Road Distance.
  2. Zadaj adresy (1 adresa = 1 riadok).
  3. Klikni Geocode Addresses.
  4. Klikni Calculate – vypočíta trasu.
  5. Použi Show on Map na interaktívny náhľad trasy.
  6. Použi GOOGLE MAPS export – otvorí trasu v Google Maps (navigácia / odoslať do mobilu).
Dôležité: Vyžaduje internet a môže byť pomalší kvôli externým požiadavkám na routovanie.

License / editions

Use “Enter license” to activate purchased features. Editions typically differ by point limits, import/export permissions, and road‑route capabilities.

  • Demo: limited points/features (intended for evaluation).
  • Basic: suitable for smaller projects and travel use cases.
  • Professional: full feature set with expanded limits; practical scale depends on hardware, memory, and selected mode.

Licencia / edície

Funkcia “Enter license” aktivuje zakúpené funkcie. Edície sa typicky líšia limitmi bodov, možnosťami import/export a cestnými trasami.

  • Demo: obmedzené body/funkcie (na vyskúšanie).
  • Basic: vhodné pre menšie projekty a cestovanie.
  • Professional: plné funkcie s rozšírenými limitmi; praktický rozsah závisí od hardvéru, pamäte a zvoleného režimu.

System requirements

  • Windows 10/11
  • Minimum 2 GB RAM
  • ~1 GB free disk space
  • Screen resolution at least 1024×768

Systémové požiadavky

  • Windows 10/11
  • Minimálne 2 GB RAM
  • ~1 GB voľného miesta na disku
  • Rozlíšenie aspoň 1024×768

Notes & tips

  • Use complete addresses for better geocoding accuracy (street, number, postal code, city, country).
  • For very large datasets, prefer Robopol Fast (Turbo/Superboost).
  • Export SVG for vector editing and clean scaling (Inkscape/Illustrator).
  • Decimals must use dot (.), not comma.

Poznámky a tipy

  • Používaj kompletné adresy pre lepšie geokódovanie (ulica, číslo, PSČ, mesto, krajina).
  • Pre veľmi veľké datasety preferuj Robopol Fast (Turbo/Superboost).
  • Export SVG je ideálny na ďalšie spracovanie (Inkscape/Illustrator).
  • Desatinný oddeľovač je bodka (.), nie čiarka.