- Graph toString() is not longer included in error messages. In most cases its excessive verbosity made it difficult to debug errors in the Chrome debugger.
- No longer expose data.Set and data.PriorityQueue from graphlib. The former is
now available in the
cp-setnpm module. The later can be made available in a similar way if necessary.
- assert.deepEqual(g.copy(), g) now returns true.
- ~5x speedup for filterNodes.
- Doc fixes.
- Some performance improvement to delNode and filterNodes.
- Added preorder and postorder tree traversal functions.
- Fixed bug where graph value was not copied correctly with graph.copy().
- Fix toString, copy, filterNodes for compound graphs.
componentsnow works for directed graphs.
- Rely less on instanceof checks which may fail with different versions of the library loaded.
- Added a JSON encoder / decoder
- Fixed bug where removing a node would not remove it from its parent's children set.
- Fixed bug where addNode would use
{}as the default value if a initial value was not assigned. - Fixed bug where auto-assiged id was not used correcty in compound graphs.
addNodenow behaves likeaddEdgein that it assigns a unique id to the node if the given id wasundefinedornull.
The release introduces these backwards incompatible changes:
- Removed
equalsfromGraphandDigraph. This was used for test only. Useassert.deepEqualinstead.
This release also introduces compound graphs. See the API docs for CGraph and
CDigraph for details.
- No externally visible changes.
(di)graph.addEdge(...)now returns the id of the edge added.- Fix bug where auto-assigned edge ids could collide with existing edge ids.
This release introduces backwards incompatible changes.
subgraph has been removed. Instead of:
graph.subgraph([1, 2, 3]);Use:
var filter = require("graphlib").filter;
graph.filterNodes(filter.nodesFromList([1, 2, 3]));The following are backwards compatible changes:
- Introduced
graph.filterNodesfor creating a new graph by applying a filter to nodes ingraph. - Add a new module
filterthat includes some simple filters.
- More doc improvements.
- Initial pass at nicer documentation.
- @solleks fixed a bug in which
alg.floydWarshallcould return the wrong shortest path with multiple edges between the same nodes (#10).
- Added Prim's Algorithm (
alg.prim). - Added method to change a directed graph to an undirected graph
(
Digraph.asUndirected). - Added method to change an undirected graph to a directed graph
(
Graph.asDirected).
- Added algorithm for finding connected components in an undirected Graph
(
alg.components). - Added Floyd-Warshall algorithm (
alg.floydWarshall).
- Added an undirected multi-graph implementation (
Graph). - Added a Set datatype (
data.Set).
- Added Dijkstra's Algorithm (
alg.dijkstra) for finding all single source shortest paths. - Added
alg.dijkstraAllfor finding all shortest paths.
This release introduces backwards incompatible changes.
Graphwas renamed toDigraphin v0.0.4. This release removesGraph. Please useDigraphin its place.Digraph.edgesno longer takes any arguments. It always returns all edges in the graph.- The equivalent of
Digraph.edges(u)is nowDigraph.incidentEdges(u). - The equivalent of
Digraph.edges(u, v)is nowDigraph.outEdges(u, v)orDigraph.inEdges(v, u).
- The equivalent of
The following are backwards compatible changes:
- Added a new optional parameter to
Digraph.outEdgesto filter the results by the source node. See API documentation for details. - Added a new optional parameter to
Digraph.inEdgesto filter the results by the target node. See API documentation for details. - Added a new method,
Digraph.incidentEdges, that returns all edges incident on a nodeuwithDigraph.incidentEdges(u)or all edges between two nodes - regardless of direction - withDigraph.incidentEdges(u, v).
- Add an min priority queue (data.PriorityQeuue).
- Add an implementation of Tarjan's algorithm (alg.tarjan).
- Add a function to find and return all cycles in a graph (alg.findCycles).
- Added a value to the graph itself, similar to the values for nodes and edges.
Use
Digraph.graph()to get the value andDigraph.graph(x)to set the graph's value tox. - Added support for changing the value of node's and edge's by supply
additional value argument. For example, to set the value
xon nodeu, callDigraph.node(u, x).
- Renamed Graph to Digraph. Graph is now an alias to Digraph, but will be removed in a subsequent release.
- Added
sourcesandsinksto Graph. - Added topsort algorithm.
- Added isAcyclic algorithm.
- Initial release.