Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mikolalysenko/grid-graph
Generates grid shaped graphs
https://github.com/mikolalysenko/grid-graph
Last synced: 7 days ago
JSON representation
Generates grid shaped graphs
- Host: GitHub
- URL: https://github.com/mikolalysenko/grid-graph
- Owner: mikolalysenko
- License: mit
- Created: 2013-04-04T22:14:00.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2013-05-14T00:12:05.000Z (over 11 years ago)
- Last Synced: 2024-12-16T22:35:01.840Z (10 days ago)
- Language: JavaScript
- Size: 105 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# grid-graph
Generates n-dimensional grid graphs.## Install
npm install grid-graph
## Example```javascript
var gridGen = require("grid-graph")
//A 5x5 grid
console.log(gridGen([5, 5]))//A 3x3x3 cube
console.log(gridGen([3, 3, 3]))//Periodic grids are allowed too. Example, 4x6 torus:
console.log(gridGen([3,4], true))//You can also make the grid periodic along only some axes. Example cylinder:
console.log(gridGen([5,5], [true, false]))
```### `require("grid-graph")(shape[, periodic])`
Generates a grid graph* `shape` is an array of the dimensions of each axis
* `periodic` 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