get_solutionlimit

Returns the solution number that must be returned.

int get_solutionlimit(lprec *lp);

Return Value

get_solutionlimit returns the solution number that must be returned. This value gives the number of the solution that must be returned.

Parameters

lp

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

Remarks

This is only valid if there are integer, semi-continious or SOS variables in the model so that the branch-and-bound algoritm is used. If there are more solutions with the same objective value, then this number specifies which solution must be returned. This can be used to retrieve all possible solutions. Start with 1 till get_solutioncount

Example

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

int main(void)
{
  lprec *lp;
  int solutionlimit;

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

  solve(lp);

  solutionlimit = get_solutionlimit(lp);

  delete_lp(lp);
  return(0);
}

lp_solve API reference

See Also make_lp, read_lp, read_LP, read_mps, read_freemps, read_MPS, read_freeMPS, read_XLI, set_solutionlimit, get_solutioncount