Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function test_graph() {
var g = new graphlib.Graph();
g.setEdge('a', 'b');
g.setEdge('a', 'b', 1.023);
g.edge('a', 'b');
g.edge({v: 'a', w: 'b'});
graphlib.json.read(graphlib.json.write(g));
graphlib.alg.dijkstra(g, 'a', e => g.edge(e));
graphlib.alg.dijkstraAll(g, e => g.edge(e));
graphlib.alg.dijkstraAll(g);
graphlib.alg.findCycles(g);
graphlib.alg.isAcyclic(g);
graphlib.alg.prim(g, e => g.edge(e));
graphlib.alg.tarjan(g);
graphlib.alg.topsort(g);
}
clone: function () {
const json = graphlib.json.write(this.graph);
const graph = graphlib.json.read(json);
return new PatternGraph(graph, this.timestamp, this.version);
},
getJSONGraph() {
return graphlib.json.write(this._graph);
}
clone: function () {
const json = graphlib.json.write(this.graph);
const graph = graphlib.json.read(json);
return new PatternGraph(graph, this.timestamp, this.version);
},
serialize(graph: Graph = this.graph) {
return GraphLib.json.write(graph);
}
}
serialize(graph: ?Object = this.graph) {
return GraphLib.json.write(graph);
}
}