Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
grid.H File Reference

2D grid graph generation with 8-connectivity. More...

Go to the source code of this file.

Classes

struct  Aleph::Default_Operation_On_Node< GT >
 Default no-op operation for node initialization. More...
 
struct  Aleph::Default_Operation_On_Arc< GT >
 Default no-op operation for arc initialization. More...
 
class  Aleph::Build_Grid< GT, Operation_On_Node, Operation_On_Arc >
 Functor to build a 2D grid graph with 8-connectivity. More...
 

Namespaces

namespace  Aleph
 Main namespace for Aleph-w library functions.
 

Detailed Description

2D grid graph generation with 8-connectivity.

This file provides the Build_Grid functor for generating rectangular grid graphs where each node is connected to its 8 neighbors (including diagonals).

Grid Structure

(0,0)---(0,1)---(0,2)
|\ |\ |
| \ | \ |
(1,0)---(1,1)---(1,2)
|\ |\ |
| \ | \ |
(2,0)---(2,1)---(2,2)

Each interior node has 8 connections (orthogonal + diagonal).

Usage Example

List_Graph<int, double> g;
Build_Grid<decltype(g)> builder;
builder(g, 10, 10); // Create 10x10 grid
// g now has 100 nodes, ~320 arcs
See also
random_graph.H Random graph generation
tpl_graph.H Graph types
Author
Leandro Rabindranath León
Alejandro Mujica

Definition in file grid.H.