static getEdgeCount(adjacencyMatrix) {
    let edgeCount = 0;
    let length = adjacencyMatrix.length;
    var i = length - 1;

    while (i--) {
      var j = length;

      while (j--) {
        if (adjacencyMatrix[i][j] === 1) {
          edgeCount++;
        }
      }
    }

    return edgeCount;
  }
Returns the number of edges in a graph defined by an adjacency matrix.

@param {Array[]} adjacencyMatrix An adjacency matrix.
@returns {Number} The number of edges in the graph defined by the adjacency matrix.