public void removeVertex( Vertex<T> v ) {
    int pos = getVerticesIndexFor( v );
    if ( pos == -1 ) {
      throw new IllegalArgumentException( "vertex not found" );
    }

    this.numberOfVertices--;
    this.vertices[pos] = null;

    // now we need to go through the adjacency matrix and
    // remove all edges incident on v. We do this by walking g
    // alon the row and column for v in the adjacency matrix
    for ( int i = 0; i < vertices.length; i++ ) {
      if ( this.adjMatrix[pos][i] == 1 ) { // row check
        this.adjMatrix[pos][i] = 0;
        this.numberOfEdges--;
      }
      if ( this.adjMatrix[i][pos] == 1 ) { // column check
        this.adjMatrix[i][pos] = 0;
        this.numberOfEdges--;
      }
    }
  }