#include <lemon/grid_graph.h>
Inheritance diagram for GridGraph:
(i,j) value where i
is in the
[0,width) range and j is in the [0, height) range. Two nodes are connected in the graph if the indices differ only on one position and only one is the difference.The graph can be indiced in the following way:
GridGraph graph(w, h); GridGraph::NodeMap<int> val(graph); for (int i = 0; i < graph.width(); ++i) { for (int j = 0; j < graph.height(); ++j) { val[graph(i, j)] = i + j; } }
The graph type is fully conform to the Undirected Graph concept.
Public Member Functions | |
GridGraph (int n, int m) | |
Constructor. | |
Edge | down (Node n) const |
Gives back the edge goes down from the node. | |
Edge | up (Node n) const |
Gives back the edge goes up from 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 goes left from the node. | |
Classes | |
class | ColMap |
Map to get the column of the nodes. More... | |
class | IndexMap |
Map to get the indices of the nodes as xy<int>. More... | |
class | RowMap |
Map to get the row of the nodes. More... |
|
Gives back the edge goes down from the node. If there is not outgoing edge then it gives back INVALID. |
|
Gives back the edge goes up from the node. If there is not outgoing 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 goes left from the node. If there is not outgoing edge then it gives back INVALID. |