set_bb_rule

Specifies the branch-and-bound rule.

void set_bb_rule(lprec *lp, short bb_rule);

Return Value

set_bb_rule has no return value.

Parameters

lp

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

bb_rule

The branch-and-bound rule. Can by any of the following values:

FIRST_SELECT (0) Lowest indexed non-integer column
RAND_SELECT (1) Random non-integer column
WORST_SELECT (2) Largest deviation from an integer value
BEST_SELECT (3) Algorithm chooses the most appropriate non-integer column
MEDIAN_SELECT (4) Median value deviation from an integer value
GREEDY_SELECT (5) Choose non-integer column which results in largest object value change

Remarks

The set_bb_rule function specifies the branch-and-bound rule for choosing which non-integer variable is to be selected. This rule can influence solving times considerably. Depending on the model one rule can be best and for another model another rule.
The default is FIRST_SELECT (0).

Example

#include <stdio.h>
#include <stdlib.h>
#include "lpkit.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_bb_rule(lp, FIRST_SELECT);

  delete_lp(lp);
  return(0);
}

lp_solve API reference

See Also make_lp, copy_lp, read_lp, read_lp_file, read_LP, read_mps, read_MPS, get_bb_rule