The TWeightedEdge class is a descendant of the GGraph.TGGraphEdge class, it represents an edge in a weighted graph.
The TWeightedEdge class connects nodes ( GGraph.TGGraphNode objects and descendants) in a graph and contains a weight (or cost such as for a travelling salesman problem). The TWeightedEdge class is an undirected edge by its nature. The GGraph.TGCustomGraph class defines whether the edge is directed or undirected. In undirected graphs, the same edge appears in both the FromNode and ToNode edge lists. The FromNode is responsible for managing the edge's memory (freeing it).
Namespace: GGraph
|
Name
|
Description
|
|
FromNode
|
Specifies the node from which this edge is starting from. The ToNode property specifies the node to which the edge is going.
Note
|
In an undirected graph, the FromNode and ToNode nodes are equivalent.
|
The FromNode and ToNode properties are set in the constructor.
|
|
ToNode
|
Specifies the node to which the edge is going. The FromNode property specifies the node from which this edge is starting from.
Note
|
In an undirected graph, the FromNode and ToNode nodes are equivalent.
|
The FromNode and ToNode properties are set in the constructor.
|
|
Weight
|
Represents the weight or cost for traversing the edge. This property can be used to set up travelling salesman or similar problems.
|
Top
|