private void initA() {
		A = new HashSet<Edge>();
		vertex = new HashSet<Integer>();
		// copy edges:
		ArrayList<Edge> ce = new ArrayList<Edge>(edges);
		int cost = ce.get(0).getweight();
		Edge anedge = ce.get(0);
		// 1. find a least cost edge and insert to A as first Edge
		for (Edge E : ce) {
			if (E.getweight() < cost) {
				cost = E.getweight();
				anedge = E;
			}
		}
		if (isEdgesafe(anedge)) {
			A.add(anedge);
			vertex.add(anedge.getvA());
			vertex.add(anedge.getvB());
			ce.remove(anedge);
		}
		boolean stop = false;
		while (!stop) {
			Edge least = null;
			int lc = 9999;
			Iterator<Integer> ite = vertex.iterator();
			while (ite.hasNext()) {
				int v = ite.next();
				Edge lv = findleastcost(v);
				if (lv != null && lv.getweight() < lc) {
					lc = lv.getweight();
					least = lv;
				}
			}
			if (least != null) {
				A.add(least);
				vertex.add(least.getvA());
				vertex.add(least.getvB());
			}
			if (A.size() == forest.size() - 1) {
				stop = true;
			}
		}
	}