Adjacency matrix code bricks for JavaScript
npm install @aureooms/js-adjacency-matrixAdjacency matrix code bricks for JavaScript.
Follows the specification in
js-graph-spec.
Parent is js-gn.
``js`
for ( let v of V( G ) ) ... ;











Can be managed through jspm,
duo,
component,
bower,
ender,
jam,
spm,
and npm.
terminal
jspm install github:aureooms/js-adjacency-matrix
or
jspm install npm:@aureooms/js-adjacency-matrix
`
$3
No install step needed for duo!$3
`terminal
component install aureooms/js-adjacency-matrix
`$3
`terminal
bower install @aureooms/js-adjacency-matrix
`$3
`terminal
ender add @aureooms/js-adjacency-matrix
`$3
`terminal
jam install @aureooms/js-adjacency-matrix
`$3
`terminal
spm install @aureooms/js-adjacency-matrix --save
`$3
`terminal
npm install @aureooms/js-adjacency-matrix --save
`Require
$3
`js
let adjacencymatrix = require( "github:aureooms/js-adjacency-matrix" ) ;
// or
import adjacencymatrix from '@aureooms/js-adjacency-matrix' ;
`
$3
`js
let adjacencymatrix = require( "aureooms/js-adjacency-matrix" ) ;
`$3
`js
let adjacencymatrix = require( "@aureooms/js-adjacency-matrix" ) ;
`$3
The script tag exposes the global variable adjacencymatrix.
`html
`
Alternatively, you can use any tool mentioned here.$3
`js
require( [ "@aureooms/js-adjacency-matrix" ] , function ( adjacencymatrix ) { ... } ) ;
`Use
`js
let Graph = adjacencymatrix.Graph ;
// use adjacencymatrix.DiGraph for directed graphslet { V , E , N } = require( "@aureooms/js-graph-theory-notation" ) ;
let G = new Graph( ) ;
let u = G.vadd( ) ;
let v = G.vadd( ) ;
let e = G.eadd( u , v ) ;
for ( let w of V( G ) ) ... ;
for ( let e of E( G ) ) ... ;
for ( let w of N( G , u ) ) ... ;
G.edel( e ) ;
G.vdel( v ) ;
G.vdel( u ) ;
``