Search
PathFinder.findShortestPath Method
See Also
 






Finds the shortest path between two DiagramNode elements, optionally considering the Weight of nodes and / or links.

Namespace: MindFusion.Diagramming
File: PathFinder.js

 Syntax

JavaScript  Copy Code

function findShortestPath (from, to, [useNodeWeights, [useLinkWeights]])

 Parameters

from

The first DiagramNode in the Path.

to

The last DiagramNode in the Path.

useNodeWeights
Optional.

If true, the Path with minimal total weight is found, summing the Weight of nodes in the Path.

useLinkWeights
Optional.

If true, the Path with minimal total weight is found, summing the Weight of links in the Path.

 Return Value

A Path instance that represents the shortest Path found or null if there is no Path connecting from and to.

 See Also