docs: function abstractBetweennessCentrality(assign, graph, options) {
    if (!isGraph(graph))
      throw new Error('graphology-centrality/beetweenness-centrality: the given graph is not a valid graphology instance.');
  
    var centralities = {};
  
    // Solving options
    options = defaults({}, options, DEFAULTS);
  
    var weightAttribute = options.attributes.weight,
        centralityAttribute = options.attributes.centrality,
        normalized = options.normalized,
        weighted = options.weighted;
  
    var shortestPath = weighted ?
      dijkstraShotestPath.brandes :
      unweightedShortestPath.brandes;
  
    var nodes = graph.nodes(),
        node,
        result,
        S,
        P,
        sigma,
        delta,
        coefficient,
        i,
        j,
        l,
        m,
        v,
        w;
  
    // Initializing centralities
    for (i = 0, l = nodes.length; i < l; i++)
      centralities[nodes[i]] = 0;
  
    // Iterating over each node
    for (i = 0, l = nodes.length; i < l; i++) {
      node = nodes[i];
  
      result = shortestPath(graph, node, weightAttribute);
  
      S = result[0];
      P = result[1];
      sigma = result[2];
  
      delta = {};
  
      // Accumulating
      for (j = 0, m = S.length; j < m; j++)
        delta[S[j]] = 0;
  
      while (S.length) {
        w = S.pop();
        coefficient = (1 + delta[w]) / sigma[w];
  
        for (j = 0, m = P[w].length; j < m; j++) {
          v = P[w][j];
          delta[v] += sigma[v] * coefficient;
        }
  
        if (w !== node)
          centralities[w] += delta[w];
      }
    }
  
    // Rescaling
    var n = graph.order,
        scale = null;
  
    if (normalized)
      scale = n <= 2 ? null : (1 / ((n - 1) * (n - 2)));
    else
      scale = graph.type === 'undirected' ? 0.5 : null;
  
    if (scale !== null) {
      for (node in centralities)
        centralities[node] *= scale;
    }
  
    if (assign) {
      for (node in centralities)
        graph.setNodeAttribute(node, centralityAttribute, centralities[node]);
    }
  
    return centralities;
  }