set_break_at_value

Specifies if the branch-and-bound algorithm stops when the object value is better than a given value.

void set_break_at_value(lprec *lp, REAL break_at_value);

Return Value

set_break_at_value has no return value.

Parameters

lp

Pointer to previously created lp model. See return value of make_lp, copy_lp, read_lp, read_LP, read_mps, read_freemps, read_MPS, read_freeMPS, read_XLI

break_at_value

The value to break on.

Remarks

The set_break_at_value function allows the branch-and-bound algorithm to stops when the object value is better than a given value. Stopping at a given object value can be useful if you are only interested for a solution that has an object value which is at least a given value, but not necessarily (and most probably) the most optimal solution.
The default value is (-) infinity.

Example

#include <stdio.h>
#include <stdlib.h>
#include "lp_lib.h"

int main(void)
{
  lprec *lp;

  /* Create a new LP model */
  lp = make_lp(0, 0);
  if(lp == NULL) {
    fprintf(stderr, "Unable to create new LP model\n");
    return(1);
  }

  set_break_at_value(lp, 1000); /* Will stop if object value is better than 1000 */

  delete_lp(lp);
  return(0);
}

lp_solve API reference

See Also make_lp, copy_lp, read_lp, read_LP, read_mps, read_freemps, read_MPS, read_freeMPS, read_XLI, get_break_at_value, set_break_at_first, is_break_at_first, set_obj_bound, get_obj_bound, set_mip_gap, get_mip_gap