Search
RoutingOptions.RouteHeuristics Property
See Also
 





Gets or sets a heuristic function used to evaluate the distance between two pieces of the routing grid.

Namespace: MindFusion.Diagramming.Wpf
Assembly: MindFusion.Diagramming.Wpf

 Syntax

C#  Copy Code

public RouteHeuristics RouteHeuristics { get; set; }

Visual Basic  Copy Code

Public Property RouteHeuristics As RouteHeuristics

 Property Value

A RouteHeuristics delegate used to evaluate the distance from a current routing grid piece to the target one. The default is Distance.

 Remarks

While generating a path, the routing algorithm evaluates pieces of the routing grid adjacent to the current one. It takes into account the cost for passing trough a piece and adds to that cost a heuristic value calculated by RouteHeuristics. So the smaller heuristic value a piece has, the greater the chance the found route to go through that piece.

There are three predefined heuristic functions that can be assigned to RouteHeuristics: Distance, DistSquare and MaxAbs. All of them assign to pieces heuristic values that are larger for larger distances to the target. Thus of the four pieces adjacent to the current one, the piece closest to the target has the smallest value and the route generation continues through it.

 See Also