traverseBF(startVertexId, callback) {
    let length = this.vertices.length;
    let visited = new Array(length);
    visited.fill(false);
    var queue = [startVertexId];

    while (queue.length > 0) {
      // JavaScripts shift() is O(n) ... bad JavaScript, bad!
      let u = queue.shift();
      let vertex = this.vertices[u];
      callback(vertex);

      for (var i = 0; i < vertex.neighbours.length; i++) {
        let v = vertex.neighbours[i];

        if (!visited[v]) {
          visited[v] = true;
          queue.push(v);
        }
      }
    }
  }
Traverses the graph in breadth-first order.

@param {Number} startVertexId The id of the starting vertex.
@param {Function} callback The callback function to be called on every vertex.