let dll = require( "aureooms-js-dll" ) ;
let List = dll.DoublyLinkedList ;
let MultiGraph = adjacencylist.MultiGraph( List ) ;
// use `adjacencylist.MultiDiGraph( List , Map )` for directed multigraphs ;// (`Map` is the new es6 class, or any other polyfill implementation)let { 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 ) ;
js-adjacency-list
Adjacency list code bricks for JavaScript. Follows the specification in js-graph-spec. Parent is js-gn.
for ( let v of V( G ) ) ... ;
Can be managed through jspm, duo, component, bower, ender, jam, spm, and npm.
Install
jspm
duo
No install step needed for duo!
component
bower
ender
jam
spm
npm
Require
jspm
let adjacencylist = require( "github:aureooms/js-adjacency-list" ) ; // or import adjacencylist from 'aureooms-js-adjacency-list' ;
duo
let adjacencylist = require( "aureooms/js-adjacency-list" ) ;
component, ender, spm, npm
let adjacencylist = require( "aureooms-js-adjacency-list" ) ;
bower
The script tag exposes the global variable
adjacencylist
.<script src="bower_components/aureooms-js-adjacency-list/js/dist/adjacency-list.min.js"></script>
Alternatively, you can use any tool mentioned here.
jam
require( [ "aureooms-js-adjacency-list" ] , function ( adjacencylist ) { ... } ) ;
Use
let dll = require( "aureooms-js-dll" ) ; let List = dll.DoublyLinkedList ; let MultiGraph = adjacencylist.MultiGraph( List ) ; // use `adjacencylist.MultiDiGraph( List , Map )` for directed multigraphs ; // (`Map` is the new es6 class, or any other polyfill implementation) let { 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 ) ;