grid-graph
Generates n-dimensional grid graphs.
Install
npm install grid-graph
Example
var gridGen = //A 5x5 gridconsole //A 3x3x3 cubeconsole //Periodic grids are allowed too. Example, 4x6 torus:console //You can also make the grid periodic along only some axes. Example cylinder:console
require("grid-graph")(shape[, periodic])
Generates a grid graph
shape
is an array of the dimensions of each axisperiodic
is an optional argument which is either an array of truthy values which determine whether or not to make some axis periodic.
Returns An array of edges for the newly generated grid.
Credits
(c) 2013 Mikola Lysenko. MIT License