set_anti_degen

Specifies if special handling must be done to reduce degeneracy/cycling while solving.

void set_anti_degen(lprec *lp, int anti_degen);

Return Value

set_anti_degen 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

anti_degen

Can be any combination (OR) of following values:

ANTIDEGEN_NONE (0) No anti-degeneracy handling
ANTIDEGEN_FIXEDVARS (1) Check if there are equality slacks in the basis and try to drive them out in order to reduce chance of degeneracy in Phase 1
ANTIDEGEN_COLUMNCHECK (2)  
ANTIDEGEN_STALLING (4)  
ANTIDEGEN_NUMFAILURE (8)  
ANTIDEGEN_LOSTFEAS (16)  
ANTIDEGEN_INFEASIBLE (32)  
ANTIDEGEN_DYNAMIC (64)  
ANTIDEGEN_DURINGBB (128)  
ANTIDEGEN_RHSPERTURB (256) Perturbation of the working RHS at refactorization
ANTIDEGEN_BOUNDFLIP (512) Limit bound flips that can sometimes contribute to degeneracy in some models

Remarks

The set_anti_degen function specifies if special handling must be done to reduce degeneracy/cycling while solving. Setting this flag can avoid cycling, but can also increase numerical instability. The default is ANTIDEGEN_INFEASIBLE + ANTIDEGEN_STALLING + ANTIDEGEN_FIXEDVARS (37).

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_anti_degen(lp, ANTIDEGEN_FIXEDVARS | ANTIDEGEN_PERTURB);

  delete_lp(lp);
  return(0);
}

lp_solve API reference

See Also make_lp, copy_lp, copy_lp, read_lp, read_LP, read_mps, read_freemps, read_MPS, read_freeMPS, read_XLI, get_anti_degen, is_anti_degen