public void prim(){
		this.vertexMap = new HashMap<Integer, Vertex>();
		priorityQueue = new PriorityQueue<Vertex>(this.graph.vertexList.size(),orderComparator);
		
		for (Vertex vertex : this.graph.vertexList) {
			vertex.key = 100;
			vertex.parent = null;
			this.vertexMap.put(vertex.name, vertex);
//			this.priorityQueue.offer(vertex);
		}
		this.graph.vertexList.get(0).key = 0;
		priorityQueue.addAll(this.graph.vertexList);
		
		System.out.println("------------------------------------------------------------------");
		System.out.println("\nThe minimum cost spanning tree is \n");
		while (priorityQueue.size()>0) {
			Vertex u = priorityQueue.poll();
			this.vertexOrder.add(u);
			//print the minimum spanning tree and check the condition
			if (u.parent != null) {
				//-------------------------test----------------------
				Vertex seconde = priorityQueue.peek();
				//-------------------------test----------------------
				
				
				
				int conditionCheck;
				//to process the last vertex
				if (seconde == null) {
					PriorityQueue<Integer> lastPriorityQueue = new PriorityQueue<Integer>();
					for (Vertex v : this.adjVertex(u)){
//						PriorityQueue<Integer> lastPriorityQueue = new PriorityQueue<Integer>();
						lastPriorityQueue.offer(this.graph.adjMatrix[v.name][u.name]);
					}
					if (lastPriorityQueue.size() == 1) {
						conditionCheck = lastPriorityQueue.poll();
					}else {
						lastPriorityQueue.poll();
						conditionCheck = lastPriorityQueue.poll();
					}
					
					System.out.print(u.parent.name + " -- >"+u.name + " Weight:"+u.key+" and small than "+ conditionCheck+" will not change the MSCT"+ "\n");
				}else {
					System.out.print(u.parent.name + " -- >"+u.name + " Weight:"+u.key+" and small than "+ seconde.key+" will not change the MSCT"+ "\n");
				}

				
				
			}
			//update the priority queue dynamically
			for (Vertex v : this.adjVertex(u)) {
				if (priorityQueue.contains(v) && this.graph.adjMatrix[u.name][v.name] < v.key) {
					v.parent = u;
					v.key = this.graph.adjMatrix[u.name][v.name];
//					System.out.println(v.key);
					//update the priority queue dynamically
					Vertex vertex = priorityQueue.poll();
					priorityQueue.add(vertex);
					
					//-------------------------------------test-----------------------------
//					for (int i = 0; i < this.priorityQueue.size(); i++) {
//						if (v.key != 100 && v.key != 0) {
//							
//						}
//					}
					
				}
			}
			
			
			
		}
		
	}