(function a(b,c,d){function e(g,h){if(!c){if(!b){var j=typeof require==“function”&&require;if(!h&&j)return j(g,!0);if(f)return f(g,!0);throw new Error(“Cannot find module '”g
“'”)}var k=c={exports:{}};b[0].call(k.exports,function(a){var c=b[1];return e(c?c:a)},k,k.exports,a,b,c,d)}return c.exports}var f=typeof require==“function”&&require;for(var g=0;gd
” but “e
” found.“}this.name=”SyntaxError“,this.expected=b,this.found=c,this.message=g(b,c),this.offset=d,this.line=e,this.column=f},b.SyntaxError.prototype=Error.prototype,b}()},{}],7:[function(a,b,c){function d(a){function b(){a.call(this),this.graph({})}return b.prototype=new a,b.prototype.constructor=b,b.prototype.graph=function(b){return arguments.length<1?a.prototype.graph.call(this):(this._checkValueType(b),a.prototype.graph.call(this,b))},b.prototype.node=function(b,c){return arguments.length<2?a.prototype.node.call(this,b):(this._checkValueType©,a.prototype.node.call(this,b,c))},b.prototype.addNode=function(b,c){return arguments.length<2&&(c={}),this._checkValueType©,a.prototype.addNode.call(this,b,c)},b.prototype.edge=function(b,c){return arguments.length<2?a.prototype.edge.call(this,b):(this._checkValueType©,a.prototype.edge.call(this,b,c))},b.prototype.addEdge=function(b,c,d,e){return arguments.length<4&&(e={}),this._checkValueType(e),a.prototype.addEdge.call(this,b,c,d,e)},b.prototype._checkValueType=function(a){if(a===null||typeof a!=”object“)throw new Error(”Value must be non-null and of type 'object'“)},b}b.exports=d},{}],8:[function(a,b,c){function g(a){var b=f.parse(a,”graphStmt“);return i(b)}function h(a){var b=f.parse(a);return b.map(function(a){return i(a)})}function i(a){function c(a,c,d){b.hasNode(a)||(b.addNode(a,h.get(”node“,{})),b.node(a).label===undefined&&(b.node(a).label=a),d!==null&&b.parent(a,d)),c&&j(c,b.node(a))}function f(a,c,d){var e={};j(h.get(”edge“,d),e);var f=d.id?d.id:null;b.addEdge(f,a,c,e)}function g(a){function e(a){c.push(a)}var b={},c=[],d;e(a);while(c.length!==0){d=c.pop();switch(d.type){case”node“:b=!0;break;case”edge“:d.elems.forEach(e);break;case”subgraph“:d.stmts.forEach(e)}}return Object.keys(b)}function i(a,d){var e=a.attrs;switch(a.type){case”node“:c(a.id,e,d);break;case”edge“:var k,l;a.elems.forEach(function(a){i(a,d);switch(a.type){case”node“:l=;break;case”subgraph“:l=g(a);break;default:throw new Error(”Unsupported type incident on edge: “+a.type)}k&&k.forEach(function(a){l.forEach(function(b){f(a,b,e)})}),k=l});break;case”subgraph“:h.enterSubDigraph(),a.id=b.addNode(a.id),d!==null&&b.parent(a.id,d),a.stmts&&a.stmts.forEach(function(b){i(b,a.id)}),b.children(a.id).length===0&&b.delNode(a.id),h.exitSubDigraph();break;case”attr“:h.set(a.attrType,e);break;case”inlineAttr“:a.attrs&&j(e,d===null?b.graph():b.node(d));break;default:throw new Error(”Unsupported statement type: “+a.type)}}var b=a.type===”graph“?new e:new d,h={_default:{},get:function(b,c){if(typeof this._default!=”undefined“){var d={};return j(this._default,d),j(c,d),d}return c},set:function(b,c){this._default=this.get(b,c)},enterSubDigraph:function(){function a(){}a.prototype=this._default;var b=new a;this._default=b},exitSubDigraph:function(){this._default=Object.getPrototypeOf(this._default)}};return a.stmts&&a.stmts.forEach(function(a){i(a,null)}),b}function j(a,b){Object.keys(a).forEach(function©{b=a})}var d=a(”./DotDigraph“),e=a(”./DotGraph“),f=a(”./dot-grammar“);b.exports=g,b.exports.parseMany=h},{”./DotDigraph“:3,”./DotGraph“:4,”./dot-grammar“:6}],9:,10:[function(a,b,c){function f(a){var b=a.isDirected()?”->“:”–“,c=new d;c.writeLine((a.isDirected()?”digraph“:”graph“)+” {“),c.indent();var e=a.graph();return e&&Object.keys(e).map(function(a){c.writeLine(h(a)+”=“+h(e)+”;“)}),g(a,null,c),a.edges().forEach(function(d){j(a,d,b,c)}),c.unindent(),c.writeLine(”}“),c.toString()}function g(a,b,c){var d=a.children?a.children(b):b===null?a.nodes():[];d.forEach(function(b){if(!a.children||a.children(b).length===0)i(a,b,c);else{c.writeLine(”subgraph “+h(b)+” {“),c.indent();var d=a.node(b);Object.keys(d).map(function(a){c.writeLine(h(a)+”=“+h(d)+”;“)}),g(a,b,c),c.unindent(),c.writeLine(”}“)}})}function h(a){return typeof a==”number“||a.toString().match(e)?a:'”'+a.toString().replace(/“/g,'\”')+'“'}function i(a,b,c){var d=a.node(b);c.write(h(b));if(d){var e=Object.keys(d).map(function(a){return h(a)+”=“+h(d)});e.length&&c.write(” [“+e.join(”,“)+”]“)}c.writeLine()}function j(a,b,c,d){var e=a.edge(b),f=a.incidentNodes(b),g=f,i=f;d.write(h(g)+” “c
” “+h(i));if(e){var j=Object.keys(e).map(function(a){return h(a)+”=“+h(e)});j.length&&d.write(” [“+j.join(”,“)+”]“)}d.writeLine()}var d=a(”./Writer“);b.exports=f;var e=/^[a-zA-Z200-377_0-9]*$/},{”./Writer“:5}],11:[function(a,b,c){c.Graph=a(”./lib/Graph“),c.Digraph=a(”./lib/Digraph“),c.CGraph=a(”./lib/CGraph“),c.CDigraph=a(”./lib/CDigraph“),a(”./lib/graph-converters“),c.alg={isAcyclic:a(”./lib/alg/isAcyclic“),components:a(”./lib/alg/components“),dijkstra:a(”./lib/alg/dijkstra“),dijkstraAll:a(”./lib/alg/dijkstraAll“),findCycles:a(”./lib/alg/findCycles“),floydWarshall:a(”./lib/alg/floydWarshall“),postorder:a(”./lib/alg/postorder“),preorder:a(”./lib/alg/preorder“),prim:a(”./lib/alg/prim“),tarjan:a(”./lib/alg/tarjan“),topsort:a(”./lib/alg/topsort“)},c.converter={json:a(”./lib/converter/json.js“)};var d=a(”./lib/filter“);c.filter={all:d.all,nodesFromList:d.nodesFromList},c.version=a(”./lib/version“)},{”./lib/CDigraph“:13,”./lib/CGraph“:14,”./lib/Digraph“:15,”./lib/Graph“:16,”./lib/alg/components“:17,”./lib/alg/dijkstra“:18,”./lib/alg/dijkstraAll“:19,”./lib/alg/findCycles“:20,”./lib/alg/floydWarshall“:21,”./lib/alg/isAcyclic“:22,”./lib/alg/postorder“:23,”./lib/alg/preorder“:24,”./lib/alg/prim“:25,”./lib/alg/tarjan“:26,”./lib/alg/topsort“:27,”./lib/converter/json.js“:29,”./lib/filter“:30,”./lib/graph-converters“:31,”./lib/version“:33}],12:[function(a,b,c){function e(){this._value=undefined,this._nodes={},this._edges={},this._nextId=0}function f(a,b,c){(a||(a=new d)).add©}function g(a,b,c){var d=a;d.remove©,d.size()===0&&delete a}var d=a(”cp-data“).Set;b.exports=e,e.prototype.order=function(){return Object.keys(this._nodes).length},e.prototype.size=function(){return Object.keys(this._edges).length},e.prototype.graph=function(a){if(arguments.length===0)return this._value;this._value=a},e.prototype.hasNode=function(a){return a in this._nodes},e.prototype.node=function(a,b){var c=this._strictGetNode(a);if(arguments.length===1)return c.value;c.value=b},e.prototype.nodes=function(){var a=[];return this.eachNode(function(b){a.push(b)}),a},e.prototype.eachNode=function(a){for(var b in this._nodes){var c=this._nodes;a(c.id,c.value)}},e.prototype.hasEdge=function(a){return a in this._edges},e.prototype.edge=function(a,b){var c=this._strictGetEdge(a);if(arguments.length===1)return c.value;c.value=b},e.prototype.edges=function(){var a=[];return this.eachEdge(function(b){a.push(b)}),a},e.prototype.eachEdge=function(a){for(var b in this._edges){var c=this._edges;a(c.id,c.u,c.v,c.value)}},e.prototype.incidentNodes=function(a){var b=this._strictGetEdge(a);return},e.prototype.addNode=function(a,b){if(a===undefined||a===null){do a=”_“+ ++this._nextId;while(this.hasNode(a))}else if(this.hasNode(a))throw new Error(”Graph already has node '“a
”'“);return this._nodes={id:a,value:b},a},e.prototype.delNode=function(a){this._strictGetNode(a),this.incidentEdges(a).forEach(function(a){this.delEdge(a)},this),delete this._nodes},e.prototype._addEdge=function(a,b,c,d,e,g){this._strictGetNode(b),this._strictGetNode©;if(a===undefined||a===null){do a=”_“+ ++this._nextId;while(this.hasEdge(a))}else if(this.hasEdge(a))throw new Error(”Graph already has edge '“a
”'“);return this._edges={id:a,u:b,v:c,value:d},f(e,b,a),f(g,c,a),a},e.prototype._delEdge=function(a,b,c){var d=this._strictGetEdge(a);g(b,d.u,a),g(c,d.v,a),delete this._edges},e.prototype.copy=function(){var a=new this.constructor;return a.graph(this.graph()),this.eachNode(function(b,c){a.addNode(b,c)}),this.eachEdge(function(b,c,d,e){a.addEdge(b,c,d,e)}),a._nextId=this._nextId,a},e.prototype.filterNodes=function(a){var b=new this.constructor;return b.graph(this.graph()),this.eachNode(function(c,d){a©&&b.addNode(c,d)}),this.eachEdge(function(a,c,d,e){b.hasNode©&&b.hasNode(d)&&b.addEdge(a,c,d,e)}),b},e.prototype._strictGetNode=function(a){var b=this._nodes;if(b===undefined)throw new Error(”Node '“a
”' is not in graph“);return b},e.prototype._strictGetEdge=function(a){var b=this._edges;if(b===undefined)throw new Error(”Edge '“a
”' is not in graph“);return b}},{”cp-data“:34}],13:[function(a,b,c){var d=a(”./Digraph“),e=a(”./compoundify“),f=e(d);b.exports=f,f.fromDigraph=function(a){var b=new f,c=a.graph();return c!==undefined&&b.graph©,a.eachNode(function(a,c){c===undefined?b.addNode(a):b.addNode(a,c)}),a.eachEdge(function(a,c,d,e){e===undefined?b.addEdge(null,c,d):b.addEdge(null,c,d,e)}),b},f.prototype.toString=function(){return”CDigraph “+JSON.stringify(this,null,2)}},{”./Digraph“:15,”./compoundify“:28}],14:[function(a,b,c){var d=a(”./Graph“),e=a(”./compoundify“),f=e(d);b.exports=f,f.fromGraph=function(a){var b=new f,c=a.graph();return c!==undefined&&b.graph©,a.eachNode(function(a,c){c===undefined?b.addNode(a):b.addNode(a,c)}),a.eachEdge(function(a,c,d,e){e===undefined?b.addEdge(null,c,d):b.addEdge(null,c,d,e)}),b},f.prototype.toString=function(){return”CGraph “+JSON.stringify(this,null,2)}},{”./Graph“:16,”./compoundify“:28}],15:[function(a,b,c){function g(){e.call(this),this._inEdges={},this._outEdges={}}var d=a(”./util“),e=a(”./BaseGraph“),f=a(”cp-data“).Set;b.exports=g,g.prototype=new e,g.prototype.constructor=g,g.prototype.isDirected=function(){return!0},g.prototype.successors=function(a){return this._strictGetNode(a),Object.keys(this._outEdges).map(function(a){return this._nodes.id},this)},g.prototype.predecessors=function(a){return this._strictGetNode(a),Object.keys(this._inEdges).map(function(a){return this._nodes.id},this)},g.prototype.neighbors=function(a){return f.union().keys()},g.prototype.sources=function(){var a=this;return this._filterNodes(function(b){return a.inEdges(b).length===0})},g.prototype.sinks=function(){var a=this;return this._filterNodes(function(b){return a.outEdges(b).length===0})},g.prototype.source=function(a){return this._strictGetEdge(a).u},g.prototype.target=function(a){return this._strictGetEdge(a).v},g.prototype.inEdges=function(a,b){this._strictGetNode(a);var c=f.union(d.values(this._inEdges)).keys();return arguments.length>1&&(this._strictGetNode(b),c=c.filter(function(a){return this.source(a)===b},this)),c},g.prototype.outEdges=function(a,b){this._strictGetNode(a);var c=f.union(d.values(this._outEdges)).keys();return arguments.length>1&&(this._strictGetNode(b),c=c.filter(function(a){return this.target(a)===b},this)),c},g.prototype.incidentEdges=function(a,b){return arguments.length>1?f.union().keys():f.union().keys()},g.prototype.toString=function(){return”Digraph “+JSON.stringify(this,null,2)},g.prototype.addNode=function(a,b){return a=e.prototype.addNode.call(this,a,b),this._inEdges={},this._outEdges={},a},g.prototype.delNode=function(a){e.prototype.delNode.call(this,a),delete this._inEdges,delete this._outEdges},g.prototype.addEdge=function(a,b,c,d){return e.prototype._addEdge.call(this,a,b,c,d,this._inEdges,this._outEdges)},g.prototype.delEdge=function(a){e.prototype._delEdge.call(this,a,this._inEdges,this._outEdges)},g.prototype._filterNodes=function(a){var b=[];return this.eachNode(function©{a©&&b.push©}),b}},{”./BaseGraph“:12,”./util“:32,”cp-data“:34}],16:[function(a,b,c){function g(){e.call(this),this._incidentEdges={}}var d=a(”./util“),e=a(”./BaseGraph“),f=a(”cp-data“).Set;b.exports=g,g.prototype=new e,g.prototype.constructor=g,g.prototype.isDirected=function(){return!1},g.prototype.neighbors=function(a){return this._strictGetNode(a),Object.keys(this._incidentEdges).map(function(a){return this._nodes.id},this)},g.prototype.incidentEdges=function(a,b){return this._strictGetNode(a),arguments.length>1?(this._strictGetNode(b),b in this._incidentEdges?this._incidentEdges[b].keys():[]):f.union(d.values(this._incidentEdges)).keys()},g.prototype.toString=function(){return”Graph “+JSON.stringify(this,null,2)},g.prototype.addNode=function(a,b){return a=e.prototype.addNode.call(this,a,b),this._incidentEdges={},a},g.prototype.delNode=function(a){e.prototype.delNode.call(this,a),delete this._incidentEdges},g.prototype.addEdge=function(a,b,c,d){return e.prototype._addEdge.call(this,a,b,c,d,this._incidentEdges,this._incidentEdges)},g.prototype.delEdge=function(a){e.prototype._delEdge.call(this,a,this._incidentEdges,this._incidentEdges)}},{”./BaseGraph“:12,”./util“:32,”cp-data“:34}],17:[function(a,b,c){function e(a){function e(b,d){c.has(b)||(c.add(b),d.push(b),a.neighbors(b).forEach(function(a){e(a,d)}))}var b=[],c=new d;return a.nodes().forEach(function(a){var c=[];e(a,c),c.length>0&&b.push©}),b}var d=a(”cp-data“).Set;b.exports=e},{”cp-data“:34}],18:[function(a,b,c){function e(a,b,c,e){function h(b){var d=a.incidentNodes(b),e=d!==i?d:d,h=f,k=c(b),l=j.distance+k;if(k<0)throw new Error(”dijkstra does not allow negative edge weights. Bad edge: “b
” Weight: “+k);l<h.distance&&(h.distance=l,h.predecessor=i,g.decrease(e,l))}var f={},g=new d;c=c||function(){return 1},e=e||(a.isDirected()?function(b){return a.outEdges(b)}:function(b){return a.incidentEdges(b)}),a.eachNode(function(a){var c=a===b?0:Number.POSITIVE_INFINITY;f={distance:c},g.add(a,c)});var i,j;while(g.size ()>0){i=g.removeMin(),j=f;if(j.distance===Number.POSITIVE_INFINITY)break;e(i).forEach(h)}return f}var d=a(”cp-data“).PriorityQueue;b.exports=e},{”cp-data“:34}],19:[function(a,b,c){function e(a,b,c){var e={};return a.eachNode(function(f){e=d(a,f,b,c)}),e}var d=a(”./dijkstra“);b.exports=e},{”./dijkstra“:18}],20:[function(a,b,c){function e(a){return d(a).filter(function(a){return a.length>1})}var d=a(”./tarjan“);b.exports=e},{”./tarjan“:26}],21:[function(a,b,c){function d(a,b,c){var d={},e=a.nodes();return b=b||function(){return 1},c=c||(a.isDirected()?function(b){return a.outEdges(b)}:function(b){return a.incidentEdges(b)}),e.forEach(function(f){d={},d[f]={distance:0},e.forEach(function(a){f!==a&&(d[a]={distance:Number.POSITIVE_INFINITY})}),c(f).forEach(function©{var e=a.incidentNodes©,h=e!==f?e:e,i=b©;ia
” a parent of itself“);b!==null&&this._strictGetNode(b),this._children[this._parents].remove(a),this._parents=b,this._children.add(a)},b.prototype.children=function(a){return a!==null&&this._strictGetNode(a),this._children.keys()},b.prototype.addNode=function(b,c){return b=a.prototype.addNode.call(this,b,c),this._parents=null,this._children=new d,this._children.add(b),b},b.prototype.delNode=function(b){var c=this.parent(b);return this._children.keys().forEach(function(a){this.parent(a,c)},this),this._children.remove(b),delete this._parents,delete this._children,a.prototype.delNode.call(this,b)},b.prototype.copy=function(){var b=a.prototype.copy.call(this);return this.nodes().forEach(function(a){b.parent(a,this.parent(a))},this),b},b.prototype.filterNodes=function(b){function f(a){var b=c.parent(a);return b===null||d.hasNode(b)?(e=b,b):b in e?e:f(b)}var c=this,d=a.prototype.filterNodes.call(this,b),e={};return d.eachNode(function(a){d.parent(a,f(a))}),d},b}var d=a(”cp-data“).Set;b.exports=e},{”cp-data“:34}],29:[function(a,b,c){function h(a){return Object.prototype.toString.call(a).slice(8,-1)}var d=a(”../Graph“),e=a(”../Digraph“),f=a(”../CGraph“),g=a(”../CDigraph“);c.decode=function(a,b,c){c=c||e;if(h(a)!==”Array“)throw new Error(”nodes is not an Array“);if(h(b)!==”Array“)throw new Error(”edges is not an Array“);if(typeof c==”string“)switch©{case”graph“:c=d;break;case”digraph“:c=e;break;case”cgraph“:c=f;break;case”cdigraph“:c=g;break;default:throw new Error(”Unrecognized graph type: “+c)}var i=new c;return a.forEach(function(a){i.addNode(a.id,a.value)}),i.parent&&a.forEach(function(a){a.children&&a.children.forEach(function(b){i.parent(b,a.id)})}),b.forEach(function(a){i.addEdge(a.id,a.u,a.v,a.value)}),i},c.encode=function(a){var b=[],c=;a.eachNode(function(c,d){var e={id:c,value:d};if(a.children){var f=a.children©;f.length&&(e.children=f)}b.push(e)}),a.eachEdge(function(a,b,d,e){c.push({id:a,u:b,v:d,value:e})});var h;if(a instanceof g)h=”cdigraph“;else if(a instanceof f)h=”cgraph“;else if(a instanceof e)h=”digraph“;else if(a instanceof d)h=”graph“;else throw new Error(”Couldn't determine type of graph: “+a);return{nodes:b,edges:c,type:h}}},{”../CDigraph“:13,”../CGraph“:14,”../Digraph“:15,”../Graph“:16}],30:[function(a,b,c){var d=a(”cp-data“).Set;c.all=function(){return function(){return!0}},c.nodesFromList=function(a){var b=new d(a);return function(a){return b.has(a)}}},{”cp-data“:34}],31:[function(a,b,c){var d=a(”./Graph“),e=a(”./Digraph“);d.prototype.toDigraph=d.prototype.asDirected=function(){var a=new e;return this.eachNode(function(b,c){a.addNode(b,c)}),this.eachEdge(function(b,c,d,e){a.addEdge(null,c,d,e),a.addEdge(null,d,c,e)}),a},e.prototype.toGraph=e.prototype.asUndirected=function(){var a=new d;return this.eachNode(function(b,c){a.addNode(b,c)}),this.eachEdge(function(b,c,d,e){a.addEdge(b,c,d,e)}),a}},{”./Digraph“:15,”./Graph“:16}],32:[function(a,b,c){c.values=function(a){var b=Object.keys(a),c=b.length,d=new Array©,e;for(e=0;ea
” Old: “this._arr[c].priority
” New: “+b);this._arr.priority=b,this._decrease©},d.prototype._heapify=function(a){var b=this._arr,c=2*a,d=c+1,e=a;c