public List<Vertex> next() {
		sort();
		Edge tem = unVisited.get(0);
		Vertex v1 = tem.getV1();
		Vertex v2 = tem.getV2();
		List<Vertex> vrts = new ArrayList<Vertex>();
		
		if(!visitedVrt.contains(v1)) 
			vrts.add(v1);
		if(!visitedVrt.contains(v2))
			vrts.add(v2);
		treeEdge.add(tem);
		unVisited.remove(tem);
		//union(v1,v2);
		visitedVrt.addAll(vrts);
		
		for(Edge e:unVisited) {
			if(visitedVrt.contains(e.getV1()) && visitedVrt.contains(e.getV2())) {
				nonTreeEdge.add(e);
			}
		}
		unVisited.removeAll(nonTreeEdge);
		
		return vrts;
		
		/*while(true) {
			Edge tem = unVisited.get(0);
			Vertex v1 = tem.getV1();
			Vertex v2 = tem.getV2();
			List<Vertex> vrts = new ArrayList<Vertex>();
			
			if(visitedVrt.contains(v1) && visitedVrt.contains(v2)) {
				nonTreeEdge.add(tem);
				unVisited.remove(tem);
			}
			else {
				if(!visitedVrt.contains(v1)) 
					vrts.add(v1);
				if(!visitedVrt.contains(v2))
					vrts.add(v2);
				treeEdge.add(tem);
				unVisited.remove(tem);
				union(v1,v2);
				visitedVrt.addAll(v1.getGroup());
				if(visitedVrt.size() == vrtNum) {
					nonTreeEdge.addAll(unVisited);
				}
				return vrts;
			}
		}*/
	}