addVertex(vertex) {
    vertex.id = this.vertices.length;
    this.vertices.push(vertex);
    return vertex.id;
  }
Add a vertex to the graph.

@param {Vertex} vertex A new vertex.
@returns {Number} The vertex id of the new vertex.