GraphEdge¶
Inherits: Object
A data structure used to represent an edge in a Graph.
Description¶
An edge connects two GraphVertex vertices together. The edge’s direction is determined by whether it was added via Graph.add_edge or Graph.add_directed_edge. If the edge is directed, then a and b must be interpreted as endpoints of an arrow pointing from a vertex to another.
You can call Object.free to remove this edge from the Graph it belongs to.
Properties¶
GraphVertex | a |
GraphVertex | b |
Variant | value |
Property Descriptions¶
Getter | get_a() |
The first endpoint, or the starting vertex of the edge.
Getter | get_b() |
The second endpoint, or the final vertex of the edge.
- Variant value
Setter | set_value(value) |
Getter | get_value() |
Edge’s data (could be a weight, a label, a list of attributes etc).
Method Descriptions¶
- Graph get_graph ( ) const
Returns the master Graph that instantiated and manages this edge.
- bool is_directed ( ) const
Returns true
if the edge has a notion of direction, otherwise returns false
(associative edge).
- bool is_loop ( ) const
Returns true
if the edge is a self-loop, meaning that a is equal to b.