Over 1.096.000 registered users (EN+CZ).
AutoCAD tips, Inventor tips, Revit tips.
Try the new precise Engineering calculator.
New AutoCAD 2026 commands and variables.
CAD tip # 10383:
Question
A
There are various algorithms to find the shortest path between two points on a given interconnected network (pipes, communication, roads, etc.).
Download, load it into AutoCAD with APPLOAD and type the SPATH command. Select the lines and polylines defining the network and pick two node-points on this network (precisely, use osnap). SPath will compute and generate a red polyline of the shortest path copying segments and nodes on the given network. Adjacent segment nodes must match. The number of selected network segments directly influences computing time of the optimal path.
In AutoCAD Map, you can effeciently solve this task using topologies (including throughput parameters, asymmetry, penalty functions). In plain AutoCAD, you can find the shortest connection between 2 network nodes using the freeware LISP utility CADstudio SPath.

Example of using SPath on a road network map of the Czech Republic - from the DWG block SilniceTematicky:
see also YouTube
To generate the shortest path connecting multiple points, use the ShortPath utility (travelling salesman problem, TSP).
(original algorithm: H.Schröder)
ACAD


30.6.2015
14750×
applies to: AutoCAD ·