As all concept describing classes it provides only interface without any sensible implementation. So any algorithm for undirected graph should compile with this class, but it will not run properly, of course.
The LEMON undirected graphs also fulfill the concept of directed graphs (Graph Concept"). Each undirected edges can be seen as two opposite directed edge and consequently the undirected graph can be seen as the direceted graph of these directed edges. The UGraph has the UEdge inner class for the undirected edges and the Edge type for the directed edges. The Edge type is convertible to UEdge or inherited from it so from a directed edge we can get the represented undirected edge.
In the sense of the LEMON each undirected edge has a default direction (it should be in every computer implementation, because the order of undirected edge's nodes defines an orientation). With the default orientation we can define that the directed edge is forward or backward directed. With the direction()
and direct()
function we can get the direction of the directed edge and we can direct an undirected edge.
The UEdgeIt is an iterator for the undirected edges. We can use the UEdgeMap to map values for the undirected edges. The InEdgeIt and OutEdgeIt iterates on the same undirected edges but with opposite direction. The IncEdgeIt iterates also on the same undirected edges as the OutEdgeIt and InEdgeIt but it is not convertible to Edge just to UEdge. #include <lemon/concepts/ugraph.h>
Classes | |
class | Edge |
The directed edge type. More... | |
class | EdgeIt |
This iterator goes through each directed edge. More... | |
class | EdgeMap |
Read write map of the directed edges to type T . More... | |
class | IncEdgeIt |
This iterator goes trough the incident undirected edges of a node. More... | |
class | InEdgeIt |
This iterator goes trough the incoming directed edges of a node. More... | |
class | Node |
The base type of node iterators, or in other words, the trivial node iterator. More... | |
class | NodeIt |
This iterator goes through each node. More... | |
class | NodeMap |
Read write map of the nodes to type T . More... | |
class | OutEdgeIt |
This iterator goes trough the outgoing directed edges of a node. More... | |
class | UEdge |
class | UEdgeIt |
This iterator goes through each undirected edge. More... | |
class | UEdgeMap |
Read write map of the undirected edges to type T . More... | |
Public Types | |
typedef True | UndirectedTag |
The undirected graph should be tagged by the UndirectedTag. | |
Public Member Functions | |
Edge | direct (const UEdge &, const Node &) const |
Direct the given undirected edge. | |
Edge | direct (const UEdge &, bool) const |
Direct the given undirected edge. | |
bool | direction (Edge) const |
Returns true if the edge has default orientation. | |
Edge | oppositeEdge (Edge) const |
Node | oppositeNode (Node, UEdge) const |
Opposite node on an edge. | |
Node | source (UEdge) const |
First node of the undirected edge. | |
Node | target (UEdge) const |
Second node of the undirected edge. | |
Node | source (Edge) const |
Source node of the directed edge. | |
Node | target (Edge) const |
Target node of the directed edge. | |
Node | baseNode (OutEdgeIt e) const |
Base node of the iterator. | |
Node | runningNode (OutEdgeIt e) const |
Running node of the iterator. | |
Node | baseNode (InEdgeIt e) const |
Base node of the iterator. | |
Node | runningNode (InEdgeIt e) const |
Running node of the iterator. | |
Node | baseNode (IncEdgeIt) const |
Base node of the iterator. | |
Node | runningNode (IncEdgeIt) const |
Running node of the iterator. |
typedef True UndirectedTag |
The undirected graph should be tagged by the UndirectedTag. This tag helps the enable_if technics to make compile time specializations for undirected graphs.
Direct the given undirected edge. The returned edge source will be the given node.
Direct the given undirected edge. The returned edge represents the given undirected edge and the direction comes from the given bool. The source of the undirected edge and the directed edge is the same when the given bool is true.
bool direction | ( | Edge | ) | const [inline] |
Returns whether the given directed edge is same orientation as the corresponding undirected edge's default orientation.
Returns the base node (the source in this case) of the iterator
Returns the running node (the target in this case) of the iterator
Returns the base node (the target in this case) of the iterator
Returns the running node (the source in this case) of the iterator