IBM ILOG Scheduler User's Manual > Integrated Applications > Handling an Overconstrained Problem: Adding Due Dates to the Bridge Problem > Solving the Problem > Removing Targeted Due Dates

Once we know the minimal due dates, we can re-add the capacity constraints and remove the due date constraints incrementally. We want to remove the fewest number of due date constraints possible and start by removing what we believe are the strongest targeted due dates to satisfy.

To do that, we remove constraints incrementally:

  1. We remove the targeted due dates which are less than or equal to their minimal due dates and search for a solution.
  2. If there is no solution, we remove the targeted due dates which are less than or equal to their minimal due dates plus one day.
  3. If there is still no solution, we remove the targeted due dates which are less than or equal to their minimal due dates plus two days.
  4. We repeat this procedure until a solution is found.

The procedure is defined in the following code.

    /* THIRD TRY: SOME DUE DATES ARE INCREMENTALLY REMOVED  */
 
    resParam.ignoreCapacityConstraints(IloFalse);
 
    solver.out() << endl << "----------------------------------------" << endl;
    solver.out() << "Third try: some due dates are incrementally removed " 
                 << endl;
    IloInt j;
    for (j=0 ; j < 99 ; j++) {
 
      solver.out() << endl << "Pass number " << j+1 << endl;
      for(IloIterator<IloActivity> iter(env); iter.ok(); ++iter) {
        IloActivity act = *iter;
        IloInt ub = (IloInt)act.getEndMax();
        IloInt lb = (IloInt)act.getEndMin();	
        if (ub - lb <= j) {
          solver.out() << "\tRemove [" << act.getName() << " ends before "
                       << ub << "]" << endl;
	  act.setEndMax(IloIntMax);
        }
      }
 
      if (solver.solve(goal)) {
        solver.out() << "\tcurrent value of makespan: " 
                     << solver.getMin(makespan) << endl;
        solver.out() << "\tSolution: " << endl;
        PrintSolution(solver);
        break;
      }
      else 
        solver.out() << "\tNo solution! " << endl;
    }
 

The execution of the program shows that in the first pass, 4 due date constraints have been removed (the targeted due dates of the activities S2, B2, B4, and L), but no solution was found. In the second pass, the due dates of activities AB2, M1, and V1 have been removed but there is still no solution. Finally, in the sixth pass, a solution is found. Due dates which are violated are displayed with the function PrintSolution.

void
PrintSolution(const IloSolver& solver)
{
  IlcScheduler scheduler(solver);
  IloEnv env = solver.getEnv();
  for(IloIterator<IloActivity> ite(env); ite.ok(); ++ite) {
    IloActivity act = *ite;
    solver.out() << scheduler.getActivity(act);
    IloInt dueDate = *((IloInt *)act.getObject());
    if (scheduler.getActivity(act).getEndMin() > dueDate) {
      solver.out() << "  <- violated due date: " << dueDate;
    }
    solver.out() << endl;
  }
}
 

A due date of an activity is violated if its earliest possible end time is greater than its associated due date. Note that the Concert Technology member function getObject is used to get the due date constraint associated with an activity.