Show/Hide Toolbars

RiverSoftAVG Products Help

Navigation: Code Documentation > RSCommon > GGraph > Classes > TGCustomGraph > Methods

TGCustomGraph.ClosestNode(TGGraphNode,Boolean) Method

Scroll Prev Top Next More

Returns the node that is closest to the ANode parameter and has its Visited property equal to the Visited parameter.

This method assumes that every node Weight in the graph equals the length to get from ANode to that node. The    InitializeNodes method can be used to set the weights of all nodes to MaxInt. The    EnumerateShortestPaths and    ShortestPath methods call this method as they build up the paths between Anode and every other node; they also set the    Weight of each node to the shortest path length.

noteNote

The ClosestNode method only works with weighted graphs (a graph of TWeightedNodes and TWeightedEdges).

Namespace: GGraph

Parameters

ANode

Type: TGGraphNode

Visited

Type: Boolean

Return Value

Type: TWeightedNode

RiverSoftAVG Products Help © 1996-2016 Thomas G. Grubb