Generates a grid shaped graph
Generates n-dimensional grid graphs.
npm install grid-graph
var gridGen = require"grid-graph"//A 5x5 gridconsole.loggridGen5 5//A 3x3x3 cubeconsole.loggridGen3 3 3//Periodic grids are allowed too. Example, 4x6 torus:console.loggridGen34 true//You can also make the grid periodic along only some axes. Example cylinder:console.loggridGen55 true false
Generates a grid graph
shapeis an array of the dimensions of each axis
periodicis 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.
(c) 2013 Mikola Lysenko. MIT License