CenterNode

Top  Previous  Next

This method finds the center node of a network, the one which minimizes this expression:

 

∑ Weight(node) * distance(node, CenterNode)

 

Parameter nodeweights need to have as many elements as NodeCount +1 and contain 0's or positive weights.

 

The method is aimed at having not too many elements > 0 or it gets slow.

 

Syntax: CenterNode(var nodeweights: TCostArray): integer;

 

 

Example with 10 nodes with weights and the green centernode:

centernode