TravelingSalesman¶
-
MLModule
¶ genre Marker
author Ola Friman
package FMEwork/ReleaseMeVis
dll MLXMarkerUtils
definition MLXMarkerUtils.def see also XMarkerShortestPath
keywords xmarker
,xmarkerlist
,traveling
,salesman
,optimal
,shortest
,path
,route
Purpose¶
The module TravelingSalesman
tries to find the shortest path that visits all spatial positions of the XMarkers in the input XMarkerList.
In the output XMarkerList, the XMarkers are ordered according to the shortest path found. That is, the TravelingSalesman
module can be used to order a set of points in a meaningful way, e.g., to reconstruct a curve from an unordered set of points.
NOTE: The algorithm takes a long time when more than 30 points are connected. Therefore, there is currently a limit of 30 input XMarkers.
Details¶
An exhaustive search is employed to find the shortest path. The search is pruned connecting only neighboring points. The number of neighbors to consider is given as a parameter by the user. With fewer neighbors to consider, the search is faster. However, a shorter path may be found if more neighbors are considered. Moreover, in some situations it is not possible to find a path at all when too few neighbors are considered.
Input Fields¶
Output Fields¶
Parameter Fields¶
Visible Fields¶
Auto update¶
-
name:
autoUpdateToggle
, type:
Bool
, default:
TRUE
¶ If checked, the module computes anew on any parameter or input change.
Number of Neighbors¶
-
name:
nbrNeighbors
, type:
Integer
, default:
2
¶ Sets the number of neighbors to consider when searching for the optimal path.
A lower value (2-3) makes the search significantly faster. With a larger number, a better path can in some situations be found. Moreover, with a low number of neighbors values there are situations where there is no path that visits all points. In this case, the output is empty.