Graph is a map. Keys of the map are node identifiers. They have to be unique. Values of the map are lists of node identifiers which is a neighbours list. If an identifier appears in a node's neighbours list this two nodes are connected with an edge.
Example file:
{
"0": [3],
"1": [3],
"2": [3],
"3": [0, 1, 2, 4],
"4": [3, 5, 6, 7],
"5": [4],
"6": [4],
"7": [4]
}
The graph defined above is shown below.
- Put this file (let's say
example.json
) intoinput
directory. - Build the app
gulp build
- Run
node dist/app.js -f example.json