Search
PathFinder.findShortestRoute Method
See Also
 





Calculates a route that passes through all nodes of the diagram, using only existing links. This implementation of the Traveling Salesperson Problem uses the nearest-neighbor heuristic.

Namespace: MindFusion.Diagramming
Assembly: PathFinder.js

 Syntax

JavaScript  Copy Code

function findShortestRoute ()

 Return Value

A Path object with its nodes, links and items fields populated, representing the approximate shortest route found by the heuristic.

 Remarks

This method expects to be called on a connected graph and builds a path consisting of existing diagram links. The weight of the links is taken from their weight property.

 See Also