documentationfor yFiles for HTML 3.0.0.3

EdgeRouterCosts

This class provides the costs that are applied for violating restrictions during the path search phase of the EdgeRouter.

Inheritance Hierarchy
EdgeRouterCosts

Remarks

The path search calculates the shortest path from the source to the target, where shortest path means the path with the lowest costs. Costs result from violations of restrictions that are defined by the different PathSearchExtensions. This class defines costs for the various violations. The algorithm can be adapted to specific needs by varying these costs. In order to avoid a certain violation, the appropriate cost must be increased.

There are some predefined cost settings which set a different focus for the path search: BALANCED_OPTIMIZATION, EDGE_BENDS_OPTIMIZATION, EDGE_LENGTHS_OPTIMIZATION, EDGE_CROSSINGS_OPTIMIZATION, and LOW_QUALITY.

Default Values of Properties

adjacentEdgeCrossingCost7
bendCost3
bendsInNodeToEdgeDistanceCost10
edgeCrossingCost1
edgeLabelCrossingCost13
edgeLengthCost2
groupNodeCrossingCost60
invalidEdgeGroupingCost25
layoutGridCellReentranceCost7
minimumEdgeDistanceCost5
minimumFirstLastSegmentLengthCost12
minimumGroupNodeToEdgeDistanceCost10
minimumNodeCornerDistanceCost6
minimumNodeToEdgeDistanceCost10
monotonyViolationCost14
nodeCrossingCost3000
nodeLabelCrossingCost13
portCrossingCost13
portViolationCost10000
sketchViolationCost4.5

Type Details

yFiles module
algorithms
The costs are not independent. They will all influence the path search phase together. Therefore, changing a certain cost might not always lead to the desired effect for specific edges.
High values for the costs may seem like a great idea to avoid certain conditions, but can cause all kinds of side effects and significantly increase the runtime when it is hard or even impossible to satisfy the condition. Thus, we recommend keeping the values in the range between 0 and 10000. It is especially discouraged to use maximum values like Number.MAX_VALUE as they easily lead to overflows and routing artifacts.

Constructors

Properties

Methods

Constants