def remove_vertex(vertex)
      # The vertex must exist
      raise "not a vertex" unless vertex.is_a?(Vertex)
      if !vertex
        raise "Vertex does not exist"
      # The vertex must not be connected to anything
      elsif !vertex.connections.empty?
        raise "Vertex has edges.  Break them first."
      # If it exists and isn't connected, delete it
      else
        @vertices.delete(vertex)
      end
    end
def remove_vertex(vertex)
      # The vertex must exist
      raise "not a vertex" unless vertex.is_a?(Vertex)
      if !vertex
        raise "Vertex does not exist"
      # The vertex must not be connected to anything
      elsif !vertex.connections.empty?
        raise "Vertex has edges.  Break them first."
      # If it exists and isn't connected, delete it
      else
        @vertices.delete(vertex)
      end
    end
Remove a vertex