next up previous
Next: UFL::generate_cuts() Up: UFL::simulate_root Previous: UFL::simulate_root

UFL::find_upperbound()

This method provides a simple heuristic for finding an upper bound. Given the current LP solution, we simply round up all fractional y variables.

  const double * sol   = si->getColSolution();
  const double * coeff = si->getObjCoefficients();
  double objective_value = si->getObjValue();
 
  for(int j = 0; j < N; j++){
    index = yindex(j);
    const double xi = sol[index];
		
    //if y_j is fractional, round it up to 1
    if (xi > tolerance && xi < 1 - tolerance)
      objective_value += coeff[index] * (1.0 - sol[index]);
  }



IP Seminar Series 2004-01-11