Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

graphology-metrics

graphology105.7kMIT2.4.0TypeScript support: included

Miscellaneous graph metrics for graphology.

betweenness, centrality, density, diameter, eccentricity, extent, graph, graphology, metrics, modularity

readme

Graphology metrics

Miscellaneous metrics to be used with graphology.

Installation

npm install graphology-metrics

Usage

Graph metrics

Node metrics

Edge metrics

Centrality

Layout quality metrics

Graph metrics

Density

Computes the density of the given graph. Note that multi variants can exceed 0, as it is also the case when considering self loops.

import {density} from 'graphology-metrics/graph/density';

// Passing a graph instance
const d = density(graph);

// Passing the graph's order & size
const d = density(order, size);

// Or to force the kind of density being computed
import {
  mixedDensity,
  directedDensity,
  undirectedDensity,
  multiMixedDensity,
  multiDirectedDensity,
  multiUndirectedDensity
} from 'graphology-metric/graph/density';

const d = undirectedDensity(mixedGraph);

// If you need to chose the kind of density dynamically
import {abstractDensity} from 'graphology-metric/graph/density';

abstractDensity('directed', true, 10, 24);

Arguments- Chi square

Either:

  • graph Graph: target graph.

Or:

  • order number: number of nodes in the graph.
  • size number: number of edges in the graph.

Abstract version arguments

Either:

  • type string: type of density to compute (directed, undirected or mixed).
  • multi boolean: whether to compute density for the multi of simple case.
  • graph Graph: target graph.

Or:

  • type string: type of density to compute (directed, undirected or mixed).
  • multi boolean: whether to compute density for the multi of simple case.
  • order number: number of nodes in the graph.
  • size number: number of edges in the graph.

Diameter

Computes the diameter, i.e the maximum eccentricity of any node of the given graph.

import diameter from 'graphology-metrics/graph/diameter';

const graph = new Graph();
graph.addNode('1');
graph.addNode('2');
graph.addNode('3');
graph.addUndirectedEdge(1, 2);
graph.addUndirectedEdge(2, 3);

diameter(graph);
>>> 2

Arguments

  • graph Graph: target graph.

Extent

Computes the extent - min, max - of a node or edge's attribute.

import {nodeExtent, edgeExtent} from 'graphology-metrics/graph';
// Alternatively, to load only the relevant code:
import {nodeExtent, edgeExtent} from 'graphology-metrics/graph/extent';

// Retrieving a single node attribute's extent
nodeExtent(graph, 'size');
>>> [1, 34]

// Retrieving multiple node attributes' extents
nodeExtent(graph, ['x', 'y']);
>>> {x: [-4, 3], y: [-34, 56]}

// The same for edges
edgeExtent(graph, 'weight');
>>> [0, 5.7]

Arguments

  • graph Graph: target graph.
  • attributes string|array: single attribute names or array of attribute names.

Modularity

Computes the modularity, given the graph and a node partition. It works on both directed & undirected networks and will return the relevant modularity.

import modularity from 'graphology-metrics/graph/modularity';

// Simplest way
const Q = modularity(graph);

// Custom node partition
const Q = modularity(graph, {
  getNodeCommunity(node, attr) {
    return attr.customPartition;
  }
});

Arguments

  • graph Graph: target graph.
  • options ?object: options:
    • getNodeCommunity ?string|function [community]: name of the node community attribute or getter function.
    • getEdgeWeight ?string|function [weight]: name of the edges' weight attribute or getter function.
    • resolution ?number: resolution parameter (γ).

Simple size

Computes the simple size of a given graph, i.e. its number of edges if we consider the graph simple, even if it has multiple edges between pairs of nodes.

import {simpleSize} from 'graphology-metrics';
// Alternatively, to load only the relevant code:
import simpleSize from 'graphology-metrics/graph/simple-size';

const graph = new MultiGraph();
graph.mergeEdge(1, 2);
graph.mergeEdge(1, 2);
graph.mergeEdge(4, 3);
graph.mergeUndirectedEdge(5, 6);

simpleSize(graph);
>>> 3

Weighted size

Computes the weighted size, i.e. the sum of the graph's edges' weight, of the given graph.

import weightedSize from 'graphology-metrics/graph/weighted-size';

const graph = new Graph();
graph.mergeEdge(1, 2, {weight: 3});
graph.mergeEdge(1, 2, {weight: 1});

// Simplest way
weightedSize(graph);
>>> 4

// With custom weight attribute
weightedSize(graph, 'myWeightAttribute');
>>> 4

// With custom getter
weightedSize(graph, (_, attr) => attr.importance);

Arguments

  • graph Graph: target graph.
  • getEdgeWeight ?string|function [weight]: name of the weight attribute or getter function.

Node metrics

Weighted degree

Computes the weighted degree of nodes. The weighted degree of a node is the sum of its edges' weights.

import {
  weightedDegree,
  weightedInDegree,
  weightedOutDegree,
  weightedInboundDegree,
  weightedOutboundDegree,
  weightedUndirectedDegree,
  weightedDirectedDegree
} from 'graphology-metrics/node/weighted-degree';

// To compute weighted degree of a node
weightedDegree(graph, 'A');

// To use a custom weight
weightedDegree(graph, 'A', function (_, attr) {
  return attr.importance;
});

Arguments

  • graph Graph: target graph.
  • node any: desired node.
  • getEdgeWeight ?string|function: name of the edge weight attribute or getter function.

Eccentricity

Computes the eccentricity which is the maximum of the shortest paths between the given node and any other node.

import eccentricity from 'graphology-metrics/node/eccentricity';

graph.addNode('1');
graph.addNode('2');
graph.addNode('3');
graph.addNode('4');
graph.addUndirectedEdge(1, 2);
graph.addUndirectedEdge(2, 3);
graph.addUndirectedEdge(3, 1);
graph.addUndirectedEdge(3, 4);

eccentricity(graph, 3) >> 1;

Arguments

  • graph Graph: target graph.
  • node any: desired node.

Edge metrics

Disparity

Function computing a score for each edge which is necessary to apply a "disparity filter" as described in the following paper:

Serrano, M. Ángeles, Marián Boguná, and Alessandro Vespignani. "Extracting the multiscale backbone of complex weighted networks." Proceedings of the national academy of sciences 106.16 (2009): 6483-6488.

Note that this metric requires a weighted graph or will return a useless result.

Beware, the results must be interpreted thusly: a lower score means a more relevant edge, as is intuited in the paper's formulae. This means you can prune edges that have a score greater than a given threshold, as a statistical test. Some other implementations might differ in that they offer the opposite intuition (i.e. greater score = more relevant edge).

import disparity from 'graphology-metrics/edge/disparity';

// To compute strength for every edge:
const disparities = disparity(graph);

// To directly map the result onto edge attributes (`disparity`):
disparity.assign(graph);

// Using custom weights
disparity.assign(graph, {getEdgeWeight: (_, attr) => attr.importance});

Arguments

  • graph Graph: target graph.
  • options ?object: options:
    • edgeDisparityAttribute ?string [disparity]: Name of the disparity attribute to assign.
    • getEdgeWeight ?string|function [weight]: Name of the edge weight attribute or getter function.

Simmelian strength

Function returning the simmelian strength, i.e. the number of triangles an edge is part of, of all the edges in the given graph.

import simmelianStrength from 'graphology-metrics/edge/simmelian-strength';

// To compute strength for every edge:
const strengths = simmelianStrength(graph);

// To directly map the result onto edge attributes (`simmelianStrength`):
simmelianStrength.assign(graph);

Chi square

Function computing a chi square significance test for each edge.

The test results are a number or undefined. undefined means the test could not be fully computed due to observed weight being less than expected. Those cases should be filtered out.

To ease filtering the edges based on the results one can use the provided thresholds: this object gives the minimum value of chi square for each level of significance expressed as p values.

import chiSquare from 'graphology-metrics/edge/chi-square';

// To compute strength for every edge using weight attribute:
const chiSquareResults = chiSquare(graph);
// To compute strength for every edge using weight custom attribute:
const chiSquareResults = chiSquare(graph, 'cooccurrences');
// To compute strength for every edge defining weight as an edge function:
const chiSquareResults = chiSquare(graph, (_, attr) => attr.cooccurrences);

// To directly map the result onto edge attribute `chiSquare`:
chiSquare.assign(graph);

// Filtering out unsignificant edges
graph
  .filterEdges((_, atts) => atts.chiSquare < chiSquare.thresholds['0.01'])
  .forEach(e => {
    graph.dropEdge(e);
  });

Arguments

  • graph Graph: target graph.
  • getEdgeWeight ?string|function weight: Name of the edge weight attribute or getter function.

G square

Function computing a g square significance test for each edge.

The test results are a number or undefined. undefined means the test could not be fully computed due to observed weight being less than expected. Those cases should be filtered out.

To ease filtering the edges based on the results one can use the provided thresholds: this object gives the minimum value of g square for each level of significance expressed as p values.

import gSquare from 'graphology-metrics/edge/g-square';

// To compute strength for every edge using weight attribute:
const gSquareResults = gSquare(graph);
// To compute strength for every edge using weight custom attribute:
const gSquareResults = gSquare(graph, 'cooccurrences');
// To compute strength for every edge defining weight as an edge function:
const gSquareResults = gSquare(graph, (_, attr) => attr.cooccurrences);

// To directly map the result onto edge attribute `gSquare`:
gSquare.assign(graph);

// Filter out unsignificant edges
graph
  .filterEdges((_, atts) => atts.gSquare < gSquare.thresholds['0.01'])
  .forEach(e => {
    graph.dropEdge(e);
  });

Arguments

  • graph Graph: target graph.
  • getEdgeWeight ?string|function weight: Name of the edge weight attribute or getter function.

Centrality

Betweenness centrality

Computes the betweenness centrality for every node.

import betweennessCentrality from 'graphology-metrics/centrality/betweenness';

// To compute centrality for every node:
const centralities = betweennessCentrality(graph);

// To directly map the result onto nodes' attributes (`betweennessCentrality`):
betweennessCentrality.assign(graph);

// To directly map the result onto a custom attribute:
betweennessCentrality.assign(graph, {nodeCentralityAttribute: 'myCentrality'});

// To ignore weights
const centralities = betweennessCentrality(graph, {getEdgeWeight: null});

// To use a getter function for weights
const centralities = betweennessCentrality(graph, {
  getEdgeWeight: (_, attr) => attr.importance
});

Arguments

  • graph Graph: target graph.
  • options ?object: options:
    • nodeCentralityAttribute ?string [betweennessCentrality]: Name of the centrality attribute to assign.
    • getEdgeWeight ?string|function [weight]: Name of the edge weight attribute or getter function.
    • normalized ?boolean [true]: should the result be normalized?

Edge betweenness centrality

Computes the betweenness centrality for every edge.

import edgeBetweennessCentrality from 'graphology-metrics/centrality/edge-betweenness';

// To compute centrality for every edge:
const centralities = edgeBetweennessCentrality(graph);

// To directly map the result onto edges' attributes (`edgeBetweennessCentrality`):
edgeBetweennessCentrality.assign(graph);

// To directly map the result onto a custom attribute:
edgeBetweennessCentrality.assign(graph, {
  edgeCentralityAttribute: 'myCentrality'
});

// To ignore weights
const centralities = edgeBetweennessCentrality(graph, {getEdgeWeight: null});

// To use a getter function for weights
const centralities = edgeBetweennessCentrality(graph, {
  getEdgeWeight: (_, attr) => attr.importance
});

Arguments

  • graph Graph: target graph.
  • options ?object: options:
    • edgeCentralityAttribute ?string [betweennessCentrality]: Name of the centrality attribute to assign.
    • getEdgeWeight ?string|function [weight]: Name of the edge weight attribute or getter function.
    • normalized ?boolean [true]: should the result be normalized?

Closeness centrality

Computes the closeness centrality of a graph's nodes.

import closenessCentrality from 'graphology-metrics/centrality/closeness';

// To compute the eigenvector centrality and return the score per node:
const scores = closenessCentrality(graph);

// To directly map the result to nodes' attributes:
closenessCentrality.assign(graph);

// Note that you can also pass options to customize the algorithm:
const p = closenessCentrality(graph, {wassermanFaust: true});

Arguments

  • graph Graph: target graph.
  • options ?object: options:
    • nodeCentralityAttribute ?string [closenessCentrality]: name of the node attribute that will be assigned the closeness centrality.
    • wassermanFaust ?boolean [false]: whether to use Wasserman & Faust's normalization scheme.

Degree centrality

Computes the degree centrality for every node.

import {
  degreeCentrality,
  inDegreeCentrality,
  outDegreeCentrality
} from 'graphology-metrics/centrality/degree';

// To compute degree centrality for every node:
const centralities = degreeCentrality(graph);

// To directly map the result onto nodes' attributes (`degreeCentrality`):
degreeCentrality.assign(graph);

// To directly map the result onto a custom attribute:
degreeCentrality.assign(graph, {nodeCentralityAttribute: 'myCentrality'});

Arguments

  • graph Graph: target graph.
  • options ?object: options:
    • nodeCentralityAttribute ?string [degreeCentrality]: name of the centrality attribute to assign.

Eigenvector centrality

Computes the eigenvector centrality of a graph's nodes.

import eigenvectorCentrality from 'graphology-metrics/centrality/eigenvector';

// To compute the eigenvector centrality and return the score per node:
const scores = eigenvectorCentrality(graph);

// To directly map the result to nodes' attributes:
eigenvectorCentrality.assign(graph);

// Note that you can also pass options to customize the algorithm:
const p = eigenvectorCentrality(graph, {tolerance: 1e-3});

// To ignore your graph's weights
eigenvectorCentrality.assign(graph, {getEdgeWeight: null});

Arguments

  • graph Graph: target graph.
  • options ?object: options:
    • nodeCentralityAttribute ?string [eigenvectorCentrality]: name of the node attribute that will be assigned the eigenvector centrality.
    • getEdgeWeight ?string|function [weight]: name of the edges' weight attribute or getter function.
    • maxIterations ?number [100]: maximum number of iterations to perform.
    • tolerance ?number [1.e-6]: convergence error tolerance.

HITS

Computes the hub/authority metrics for each node using the HITS algorithm.

import hits from 'graphology-metrics/centrality/hits';

// To compute and return the result as 'hubs' & 'authorities':
const {hubs, authorities} = hits(graph);

// To directly map the result to nodes' attributes:
hits.assign(graph);

// Note that you can also pass options to customize the algorithm:
const {hubs, authorities} = hits(graph, {normalize: false});

Arguments

  • graph Graph: target graph.
  • options ?object: options:
    • getEdgeWeight ?string|function [weight]: name of the edges' weight attribute or getter function.
    • nodeHubAttribute ?string [hub]: name of the node attribute holding hub information.
    • nodeAuthorityAttribute ?string [authority]: name of the node attribute holding authority information.
    • maxIterations ?number [100]: maximum number of iterations to perform.
    • normalize ?boolean [true]: should the result be normalized by the sum of values.
    • tolerance ?number [1.e-8]: convergence error tolerance.

Pagerank

Computes the pagerank metrics for each node.

import pagerank from 'graphology-metrics/centrality/pagerank';

// To compute pagerank and return the score per node:
const scores = pagerank(graph);

// To directly map the result to nodes' attributes:
pagerank.assign(graph);

// Note that you can also pass options to customize the algorithm:
const p = pagerank(graph, {alpha: 0.9});

// To ignore your graph's weights
pagerank.assign(graph, {getEdgeWeight: null});

Arguments

  • graph Graph: target graph.
  • options ?object: options:
    • nodePagerankAttribute ?string [pagerank]: name of the node attribute that will be assigned the pagerank score.
    • getEdgeWeight ?string|function [weight]: name of the edges' weight attribute or getter function.
    • alpha ?number [0.85]: damping parameter of the algorithm.
    • maxIterations ?number [100]: maximum number of iterations to perform.
    • tolerance ?number [1.e-6]: convergence error tolerance.

Layout quality metrics

Connected Closeness

TODO...

Edge Uniformity

Computes the edge uniformity layout quality metric from the given graph having x and y positions attached to its nodes. Edge uniformity is the normalized standard deviation of edge length of the graph. Lower values should be synonym of better layout according to this particular metric.

Runs in O(E).

import edgeUniformity from 'graphology-metrics/layout-quality/edge-uniformity';

edgeUniformity(graph);
>>> ~1.132

Neighborhood preservation

Computes the "neighborhood preservation" layout quality metric from the given graph having x and y positions attached to its nodes. Neighborhood preservation is the average proportion of node neighborhood being the same both in the graph's topology and its 2d layout space. The metric is therefore comprised between 0 and 1, 1 being the best, meaning that every node keeps its neighborhood perfectly intact within the layout space.

Runs in approximately O(N * log(N)).

import neighborhoodPreservation from 'graphology-metrics/layout-quality/neighborhood-preservation';

neighborhoodPreservation(graph);
// >>> 0.456

Stress

Computes the "stress" layout quality metric from the given graph having x and y positions attached to its nodes. Stress is the sum of normalized delta between node topology distances and their layout space distances. Lower values should be synonym of better layout according to this particular metric.

Note that this metric does not work very well when the graph has multiple connected components.

Note also that this metric traverses any given graph as an undirected one.

Runs in O(N^2).

import stress from 'graphology-metrics/layout-quality/stress';

stress(graph);
// >>> ~24510.2914

changelog

Changelog

0.26.0

  • Removing obliterator dependency.
  • Stopping to shim Array.from.
  • ESM support.

0.25.4

  • Reverting to 0.25.1 package semantics to avoid partial ESM-first support issues.

0.25.3

  • Fixing missing types declaration in package's exports key.

0.25.2

  • Loosening plain object tests to avoid issues with objects coming from different JavaScript contexts.

0.25.1

  • Fixing #.hasEdge methods for multigraphs.
  • Fixing #.degreeWithoutSelfLoops methods for multigraphs.

0.25.0

  • Optimizing JSON serialization.
  • Shipping source maps with package.

0.24.1

  • Improving performance and memory usage of multigraphs.

0.24.0

  • Adding #.inboundDegree, #.outboundDegree, #.inboundDegreeWithoutSelfLoops, #.outboundDegreeWithoutSelfLoops.
  • Adding missing #.dropDirectedEdge & #.dropUndirectedEdge.
  • Adding possibility to pass upgrading options to #.copy.
  • Refactoring internal edge & neighbor iteration schemes.
  • Dropping undocumented #.upgradeToMixed & #.upgradeToMulti.
  • Refactoring internal indices.
  • Fixing edge iteration wrt. self loops.
  • Dropping some irrelevant arities for edge attribute updates.
  • Improving performance of edge iteration.
  • Improving performance of neighbor iteration.
  • Improving performance of node deletion.
  • Improving performance of edge attribute edition.
  • Improving performance of internal edge key generator.
  • Improving memory usage.
  • Improving performance of default degree methods.
  • Improving serialization performance.

0.23.2

  • Fixing a #.mergeUndirectedEdgeWithKey & #.updateUndirectedEdgeWithKey bug when source & target are given in the reverse order.

0.23.1

  • Fixing #.copy not copying the graph's attributes.
  • Improving performance of #.copy.

0.23.0

  • Adding #.updateAttributes.
  • Adding #.updateNodeAttributes.
  • Adding #.updateEdgeAttributes.
  • Adding #.getSourceAttribute, #.getTargetAttribute, #.getOppositeAttribute and friends.
  • Aligning #.updateEachEdgeAttributes callback arguments to #.forEachEdge.
  • Improving #.merge* and #.update* function by returning useful information.
  • Improving #.opposite performance.

Migration guide

This release should only affect you in the following cases:

  1. You were relying on the keys returned by #.mergeEdge, #.updateEdge etc. In which case those methods now return a useful tuple containing said key as its first element as well as additional information about whether target elements already existed in the graph or not.
  2. Some hidden adjacency iteration methods were mangled and are still hidden. This could only affect you if you were using #.forEach, #.find or #.adjacency (not to be confused with their node, edge & neighbor counterparts).

0.22.2

  • Fixing #.mergeEdge & #.updateEdge error messages.
  • Improving performance of #.addEdge etc. (less deopt).
  • Improving #.inspect output wrt undirected multi edges.

0.22.1

  • Fixing prepublishOnly script and shipped package.

0.22.0

  • Rolling back to robust generated ids for edges.
  • Adding #.mapNodes, #.filterNodes, #.reduceNodes, #.findNode #.someNode, #.everyNode.
  • Adding #.mapEdges, #.filterEdges, #.reduceEdges, #.findEdge #.someEdge, #.everyEdge.
  • Adding #.mapNeighbors, #.filterNeighbors, #.reduceNeighbors, #.findNeighbor #.someNeighbor, #.everyNeighbor.
  • Adding #.degreeWithoutSelfLoops.
  • Changing #.forEach*Until methods to #.find* methods.
  • Dropping #.hasGeneratedKey.
  • Dropping the generated last argument to edge & adjacency iterations.
  • Dropping the edgeKeyGenerator instantiation option.
  • Dropping second argument of #.degree.
  • Changing #.neighbors(source, target) to #.areNeighbors.
  • Changing iterator entries to objects rather than arrays.
  • #.exportEdge will now always return a key.
  • Fixing mutability bug with #.copy.
  • Fixing adjacency iterator items missing undirected.
  • Fixing edge iterator items missing undirected.
  • Fixing bug related to instance counters and #.clear, #.clearEdges.
  • Improving #.copy performance.
  • Improving #.areNeighbors performance.
  • Improving #.forEachNode performance.
  • Upgrading obliterator and improving iterator-based methods.

Migration guide

This release should only affect you in the following use-cases:

  1. You were using #.forEach*Until methods, in which case you should replace them by the relevant #.find* or #.some* method.
  2. You were using the boolean second argument to the #.degree methods. Replace those calls by #.degreeWithoutSelfLoops.
  3. You were using the (well-hidden) two-arguments polymorphism of #.neighbors. Replace those calls by #.areNeighbors.
  4. You were using iterators in which case the yielded entries are now objects rather than arrays and should be easier to destructure to access the parts you need.
  5. You were doing despicable things with automatically generated keys.

0.21.1

  • Fixing #.removeNodeAttribute error message.
  • Upgrading types to 0.20.0.

0.21.0

  • *Until methods now return whether they broke.
  • Fixing a bug with #.forEachNodeUntil.

0.20.0

  • Changing default edge key generator to simple incremental id.

0.19.3

  • Fixing issues related to rollup bundling.

0.19.2

  • Fixing #.dropNode bug.

0.19.1

  • Optimizing #.dropNode.

0.19.0

  • Adding #.forEachUntil.
  • Adding #.forEachNodeUntil.
  • Adding #.forEachEdgeUntil.
  • Adding #.forEachNeighborUntil.
  • Adding #.updateNode.
  • Adding #.updateEdge.
  • Adding attributes to attributesUpdated events.
  • Adding attributes to nodeAttributesUpdated events.
  • Adding attributes to edgeAttributesUpdated events.
  • Adding #.updateEachNodeAttributes.
  • Adding #.updateEachEdgeAttributes.
  • Passing undirected & generatedKey to #.forEachEdge callbacks.
  • Changing #.forEach & #.adjacency semantics to something actually useful.
  • Optimizing *AttributesUpdated events payload.
  • Optimizing #.edges(A, B).
  • Optimizing #.forEachEdge.
  • Optimizing #.mergeEdge.
  • Optimizing #.edges and #.nodes.
  • Optimizing #.import.
  • Fixing #.edges(A, B) with directed self loops.
  • Fixing #.mergeEdgeWithKey edge cases.
  • Fixing #.mergeAttributes event payload.
  • Fixing #.edgeEntries stack overflow with undirected edges.
  • Dropping before and after from replace events metadata.
  • Dropping value from set events metadata.
  • Dropping overkill toString method.
  • Correctly emitting nodeAttributesUpdated event when node is merged.
  • Correctly emitting edgeAttributesUpdated event when edge is merged.
  • graphology-types is now a peer dependency.

0.18.0

  • Adding #.implementation.
  • Adding #.hasExtremity.
  • Adding #.selfLoopCount, #.directedSelfLoopCount & #.undirectedSelfLoopCount.
  • Adding #.hasGeneratedKey.
  • Renaming #.directed & #.undirected to #.isDirected & #.isUndirected.
  • Renaming #.selfLoop to #.isSelfLoop.
  • Serializing options & accepting them with #.from static methods.
  • Improving performance of #.opposite.
  • Improving serialization performance.
  • Updating type declarations & adding generics.
  • Optimizing various degree methods.
  • Optimizing graph attributes methods.
  • Fixing edges & neighbors iteration regarding self loops in the directed case.

0.17.1

  • Optimizing #.forEachEdge methods.

0.17.0

  • Changing packaging system.
  • Fixing browser bundle.

0.16.1

  • Bundle fixes (@zakjan).

0.16.0

  • Proper #.nullCopy & #.emptyCopy methods.

0.15.2

  • More flexible dependency to graphology-types.

0.15.1

  • Adding missing MultiGraph export.
  • Adding missing error typings.

0.15.0

  • TypeScript support.
  • Adding possibility to merge options using #.emptyCopy.

0.14.1

  • Fixing #.mergeEdge for the self loop case.

0.14.0

  • Adding Symbol.iterator to the prototype.
  • Fixing custom inspection for node >= 10.

0.13.1

  • Fixing edge attributes methods with typed graphs.

0.13.0

  • Adding #.nodeEntries.
  • Adding #.edgeEntries.
  • Adding #.neighborEntries.
  • Adding #.forEach.
  • Adding #.adjacency.

0.12.0

  • Adding #.clearEdges.
  • Adding #.forEachEdge & alii.
  • Adding #.forEachNode & alii.
  • Adding #.forEachNeighbor & alii.
  • Adding #.inboundNeighbors & #.outboundNeighbors.
  • Adding #.inboundEdges & #.outboundEdges.
  • Dropping #.addNodesFrom.
  • Dropping #.dropNodes & #.dropEdges.
  • Dropping plural serialization methods.
  • Dropping defaultNodeAttributes & defaultEdgeAttributes.
  • Fixing semantics of #.inEdges & #.outEdges for arity 2.
  • Improving performance of edges-related methods.
  • Improving performance of internal indices.
  • Improving performance of #.mergeNode.
  • Fixing edge-case deopt for #.dropEdges.
  • Fixing bug related to multigraphs' neighbors.
  • Attribute copy is now done on serialization.
  • Completely reworking internal indices.

0.11.4

  • Improving performance of neighbors-related methods.
  • Improving performance of edges-related methods.

0.11.3

  • Fixing issues related to the obliterator dependencies.

0.11.2

  • Fixing an issue with #.mergeNode & string coercion.

0.11.1

  • Fixing the #.edges for undirected graphs.

0.11.0

  • Adding #.directedSize & #.undirectedSize.

0.10.2

  • Performance enhancements.

0.10.1

  • Performance enhancements.
  • Fixing a bug with #.mergeEdge & undirected edges.

0.10.0

  • Adding basic edges iterators.
  • Fixing #.inspect.

0.9.1

  • Fixing a bug concerning #.hasEdge & typed graphs.

0.9.0

  • Major write performance improvements.
  • Shifting the default edge key generation system.
  • Dropping index' laziness.

0.8.0

  • Adding the #.nodesIterator method.
  • Performance improvements.

0.7.1

  • Fixing a bug related to typed graphs' attributes.
  • Fixing a bug with the dropping methods.

0.7.0

  • Adding the #.edge & variants methods.
  • Adding the #.upgradeToMixed method.
  • Adding the #.upgradeToMulti method.
  • Refactoring indices methods.

0.6.0

  • Dropping inbound & outbound iteration methods.
  • Dropping useless counting iteration methods.
  • Dropping bunch consuming polymorphisms from iteration methods.
  • Refactoring internal indices for undirected graphs.
  • Improving performance.

0.5.4

  • Fixing degree methods for typed graphs.

0.5.3

  • Improving performance.

0.5.2

  • Node.js 0.12.x compatibility.
  • Fixing bug related to the graph's string coercion.
  • Improving performance.
  • Better error message when adding a self-loop when it's not authorized.

0.5.1

  • Better unit tests.
  • Internal refactoring.

0.5.0

  • Implementing the static #.from method & switching constructor paradigm.
  • Fixing bug related to the attributesUpdated event.
  • Adding more errors related to attributes' setters.
  • Adding typed edges attributes' getters/setters.
  • Rewrote internal indices.
  • Dropping #.getEdge & friends.
  • Dropping #.selfLoops.

0.4.2

  • Adding missing built files to the npm package.

0.4.1

  • Adding missing attributes in export.

0.4.0

  • Adding #.removeNodeAttribute & #.removeEdgeAttribute that was actually missing from earlier versions.
  • Adding graph attributes.
  • nodeUpdated & edgeUpdated changing to nodeAttributesUpdated & edgeAttributesUpdated respectively.

0.3.0

  • Adding merge flags to import methods.

0.2.0

  • Adding #.hasNodeAttribute & #.hasEdgeAttribute.
  • Adding #.removeNodeAttribute & #.removeEdgeAttribute.
  • Adding #.mergeNode.
  • Adding #.mergeEdge, #.mergeEdgeWithKey and friends.
  • Renaming #.relatedNode to #.opposite.
  • Dropping the onDuplicateNode & onDuplicateEdge options.

0.1.1

  • Fixing the argument passed to the edgeKeyGenerator function.
  • Fixing a bug where source & target of an edge were not internally coerced to strings.

0.1.0

Initial version compliant to the specs.