private MyGraph greedyCoverRandom(MyGraph network, double factor) {
		ArrayList<MyEdge> candidateEdges = new ArrayList<MyEdge>(
				network.getEdges());
		for (MyEdge edge : candidateEdges) {
			double w = edge.getWeight() + factor;
			edge.setWeight(w);

		}
		ArrayList<MyEdge> chosenEdges = new ArrayList<MyEdge>();
		MyGraph cover = new MyGraph(network.getNodes(), chosenEdges);
		for (MyNode n : cover.getNodes()) {
			n.setAdj(new ArrayList<MyNode>());
		}
		HashMap<MyNode, MyNode> twins = new HashMap<MyNode, MyNode>();
		for (MyNode n : network.getNodes()) {
			twins.put(n, n);
		}
		IdComparator comparatorId = new IdComparator();
		weightComparator comparatorW = new weightComparator();
		Collections.sort(candidateEdges, comparatorId);// ID sorting
		Collections.shuffle(candidateEdges);
		Collections.sort(candidateEdges, comparatorW);// weight sorting
		Collections.reverse(candidateEdges);
		while (!candidateEdges.isEmpty()) {
			MyEdge candidate = candidateEdges.get(0);
			MyNode source = candidate.getSource();
			MyNode target = candidate.getTarget();
			if (twins.get(source) == target) {
				candidateEdges.remove(candidate);
			} else {
				cover.addEdge(candidate);
				MyNode ps = twins.get(source);
				MyNode pt = twins.get(target);
				twins.put(ps, pt);
				twins.put(pt, ps);
				if (cover.nodeFromId(target.getId()).getDegree() > 1) {
					ArrayList<MyEdge> a = network.inoutEdges(target);
					candidateEdges.removeAll(a);
				} else {
					candidateEdges.remove(candidate);
				}
				if (cover.nodeFromId(source.getId()).getDegree() > 1) {
					ArrayList<MyEdge> b = network.inoutEdges(source);
					candidateEdges.removeAll(b);
				} else {
					candidateEdges.remove(candidate);
				}
			}

		}
		return cover;

	}