#include <lemon/path.h>
Graph | The graph type in which the path is. |
NodeIt
and EdgeIt
with the same usage. These types converts to the Node
and Edge
of the original graph.
Public Types | |
typedef Graph::Edge | Edge |
Edge type of the underlying graph. | |
typedef Graph::Node | Node |
Node type of the underlying graph. | |
Public Member Functions | |
Path (const Graph &_graph) | |
Constructor. | |
Path (const Path &other, const NodeIt &a, const NodeIt &b) | |
Subpath constructor. | |
Path (const Path &other, const EdgeIt &a, const EdgeIt &b) | |
Subpath constructor. | |
int | length () const |
Length of the path. | |
bool | empty () const |
Returns whether the path is empty. | |
void | clear () |
Resets the path to an empty path. | |
Node | source () const |
Starting point of the path. | |
Node | target () const |
End point of the path. | |
NodeIt | nthNode (int n) const |
Gives back a node iterator to point to the node of a given index. | |
EdgeIt | nthEdge (int n) const |
Gives back an edge iterator to point to the edge of a given index. | |
NodeIt | source (const EdgeIt &e) const |
Returns node iterator pointing to the source node of the given edge iterator. | |
NodeIt | target (const EdgeIt &e) const |
Returns node iterator pointing to the target node of the given edge iterator. | |
Classes | |
class | Builder |
Class to build paths. More... | |
class | EdgeIt |
Iterator class to iterate on the edges of the paths. More... | |
class | NodeIt |
Iterator class to iterate on the nodes of the paths. More... |
Path | ( | const Graph & | _graph | ) | [inline] |
Constructor
_G | The graph in which the path is. |
Subpath defined by two nodes.
Subpath defined by two edges. Contains edges in [a,b)
int length | ( | ) | const [inline] |
The number of the edges in the path. It can be zero if the path has only one node or it is empty.
bool empty | ( | ) | const [inline] |
Returns true when the path does not contain neither edge nor node.
void clear | ( | ) | [inline] |
Resets the path to an empty path.
Node source | ( | ) | const [inline] |
Starting point of the path. Returns INVALID if the path is empty.
Node target | ( | ) | const [inline] |
End point of the path. Returns INVALID if the path is empty.
NodeIt nthNode | ( | int | n | ) | const [inline] |
Gives back a node iterator to point to the node of a given index.
length()
EdgeIt nthEdge | ( | int | n | ) | const [inline] |
Gives back an edge iterator to point to the node of a given index.
length()
Returns node iterator pointing to the source node of the given edge iterator.
Returns node iterator pointing to the target node of the given edge iterator.