Represents an edge in a graph; used by the Graph class.
More...
#include <edge.h>
Represents an edge in a graph; used by the Graph class.
- Author
- Sean Massung
- Date
- Spring 2012
◆ Edge() [1/4]
Parameter constructor for unweighted graphs.
- Parameters
-
u | - one vertex the edge is connected to |
v | - the other vertex it is connected to |
◆ Edge() [2/4]
Parameter constructor for unweighted graphs.
- Parameters
-
u | - one vertex the edge is connected to |
v | - the other vertex it is connected to |
lbl | - the edge label |
◆ Edge() [3/4]
Parameter constructor for weighted graphs.
- Parameters
-
u | - one vertex the edge is connected to |
v | - the other vertex it is connected to |
w | - the weight of the edge |
lbl | - the edge label |
◆ Edge() [4/4]
◆ getLabel()
string Edge::getLabel |
( |
| ) |
const |
|
inline |
◆ getWeight()
int Edge::getWeight |
( |
| ) |
const |
|
inline |
◆ operator<()
bool Edge::operator< |
( |
const Edge & |
other | ) |
const |
|
inline |
Compares two Edges.
operator< is defined so Edges can be sorted with std::sort.
- Parameters
-
other | - the edge to compare with |
- Returns
- whether the current edge is less than the parameter
◆ operator==()
bool Edge::operator== |
( |
Edge & |
other | ) |
const |
|
inline |
Compares two edges' source and dest.
- Parameters
-
other | - the edge to compare with |
◆ dest
The destination of the edge.
◆ label
◆ source
◆ weight
The edge weight (if in a weighed graph)
The documentation for this class was generated from the following file: