private void buildSCC() {
   digraph.desactivateNode(n2);
   digraph.activateNode(n2);
   for (int i = n; i < n2; i++) {
     if (flow[i] < ub[i]) {
       digraph.addArc(i, n2);
     }
     if (flow[i] > lb[i]) {
       digraph.addArc(n2, i);
     }
   }
   SCCfinder.findAllSCC();
   nodeSCC = SCCfinder.getNodesSCC();
   digraph.desactivateNode(n2);
 }
 private void buildDigraph() throws ContradictionException {
   digraph.desactivateNode(n2);
   for (int i = 0; i < n2; i++) {
     flow[i] = 0;
     digraph.getSuccessorsOf(i).clear();
     digraph.getPredecessorsOf(i).clear();
   }
   int j, k, ub;
   IntVar v;
   for (int i = 0; i < n; i++) {
     v = vars[i];
     ub = v.getUB();
     if (v.instantiated()) {
       j = map.get(v.getValue());
       if (flow[j] < this.ub[j]) {
         digraph.addArc(j, i);
         flow[i]++;
         flow[j]++;
       } else {
         contradiction(v, "");
       }
     } else {
       for (k = v.getLB(); k <= ub; k = v.nextValue(k)) {
         j = map.get(k);
         digraph.addArc(i, j);
       }
     }
   }
 }