getSubgraphDistanceMatrix(vertexIds) {
    let length = vertexIds.length;
    let adja = this.getSubgraphAdjacencyMatrix(vertexIds);
    let dist = Array(length);

    for (var i = 0; i < length; i++) {
      dist[i] = Array(length);
      dist[i].fill(Infinity);
    }

    for (var i = 0; i < length; i++) {
      for (var j = 0; j < length; j++) {
        if (adja[i][j] === 1) {
          dist[i][j] = 1;
        }
      }
    }

    for (var k = 0; k < length; k++) {
      for (var i = 0; i < length; i++) {
        for (var j = 0; j < length; j++) {
          if (dist[i][j] > dist[i][k] + dist[k][j]) {
            dist[i][j] = dist[i][k] + dist[k][j];
          }
        }
      }
    }

    return dist;
  }
Get the distance matrix of a subgraph.

@param {Number[]} vertexIds An array containing the vertex ids contained within the subgraph.
@returns {Array[]} The distance matrix of the subgraph.