public void computePrim(int v) {
		while (flag < vertexList.length - 1) {
			flag++;
			int min = 5000;
			int index = 0;

			int[] simple2 = new int[vertexList.length];
			// storing the neighbors in the matrix
			for (int i = 0; i < vertexList.length; i++)
				simple2[i] = simple[v][i];
			// adding the costs to the edgeList matrix
			for (int j = 0; j < vertexList.length; j++) {
				if ((edgeList[j].cost > simple2[j]) && (edgeList[j].v1 != rand)) {
					edgeList[j].v2 = v;
					edgeList[j].cost = simple2[j];

				}
			}
			// finding the minimum cost amongst the neighbors
			for (int v2 = 0; v2 < vertexList.length; v2++) {
				if (edgeList[v2].v1 != rand) {
					if (edgeList[v2].cost < min) {
						min = edgeList[v2].cost;
						index = v2;
					}
				}
			}
			// adding the edges to the arraylists
			a.add(index);
			// marking the visited nodes
			edgeList[index].v1 = rand;
			b.add(edgeList[index].v2);
			c.add(min);
			// recusively calling the function
			computePrim(index);
		}
	}