code: private int addMandatoryArcs() throws ContradictionException {
  		int from, to, rFrom, rTo, arc;
  		int tSize = 0;
  		double val = propHK.getMinArcVal();
  		for (int i = ma.size() - 1; i >= 0; i--) {
  			arc = ma.get(i);
  			from = arc / n;
  			to = arc % n;
  			rFrom = findUF(from);
  			rTo = findUF(to);
  			if (rFrom != rTo) {
  				linkUF(rFrom, rTo);
  				Tree.addEdge(from, to);
  				updateCCTree(rFrom, rTo, val);
  				treeCost += costs[arc];
  				tSize++;
  			} else {
  				propHK.contradiction();
  			}
  		}
  		return tSize;
  	}
docs: ***********************************************************************************