#include <lemon/grid_graph.h>
Public Member Functions | |
Node | operator() (int i, int j) const |
The node on the given position. | |
int | row (Node n) const |
Gives back the row index of the node. | |
int | col (Node n) const |
Gives back the coloumn index of the node. | |
int | width () const |
Gives back the width of the graph. | |
int | height () const |
Gives back the height of the graph. | |
int | nodeNum () const |
Number of nodes. | |
int | edgeNum () const |
Number of edges. | |
int | maxNodeId () const |
Maximum node ID. | |
int | maxEdgeId () const |
Maximum edge ID. | |
Node | source (Edge e) const |
Gives back the source node of an edge. | |
Node | target (Edge e) const |
Gives back the target node of an edge. | |
Edge | findEdge (Node u, Node v, Edge prev=INVALID) const |
Finds an edge between two nodes. | |
Static Public Member Functions | |
static int | id (Node v) |
Node ID. | |
static int | id (Edge e) |
Edge ID. | |
Protected Member Functions | |
void | construct (int width, int height) |
Creates a grid graph with the given size. | |
Edge | _down (Node n) const |
Gives back the edge goes down from the node. | |
Edge | _up (Node n) const |
Gives back the edge comes from up into the node. | |
Edge | _right (Node n) const |
Gives back the edge goes right from the node. | |
Edge | _left (Node n) const |
Gives back the edge comes from left into the node. |
|
Creates a grid graph with the given size. |
|
Gives back the edge goes down from the node. If there is not outgoing edge then it gives back INVALID. |
|
Gives back the edge comes from up into the node. If there is not incoming edge then it gives back INVALID. |
|
Gives back the edge goes right from the node. If there is not outgoing edge then it gives back INVALID. |
|
Gives back the edge comes left up into the node. If there is not incoming edge then it gives back INVALID. |
|
Gives back the node on the given position. |
|
Gives back the row index of the node. |
|
Gives back the coloumn index of the node. |
|
Gives back the width of the graph. |
|
Gives back the height of the graph. |
|
Maximum node ID.
|
|
Maximum edge ID.
|
|
Gives back the source node of an edge. |
|
Gives back the target node of an edge. |
|
The ID of a valid Node is a nonnegative integer not greater than maxNodeId(). The range of the ID's is not surely continuous and the greatest node ID can be actually less then maxNodeId(). The ID of the INVALID node is -1.
|
|
The ID of a valid Edge is a nonnegative integer not greater than maxEdgeId(). The range of the ID's is not surely continuous and the greatest edge ID can be actually less then maxEdgeId(). The ID of the INVALID edge is -1.
|
|
Finds an edge from node
If
|