private Integer getRandomVertex() {

        if (graph.getVertices().size() > 0)
            return graph.getVertices().iterator().next();

        return null;
    }
we can start any from any random vertex
src/algo/graph/PrimsMST.java