[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-glpk] Relaxed LP Results

From: Andrew Makhorin
Subject: Re: [Help-glpk] Relaxed LP Results
Date: Sat, 25 Aug 2007 05:27:00 +0400

> I'm sure I'm probably doing something wrong. Here's my code--
>         lpx_set_class(LP, LPX_MIP);
>         lpx_set_int_parm(LP, LPX_K_USECUTS, LPX_C_ALL);
>         Status = lpx_intopt(LP);
>         Status = lpx_mip_status(LP);
>         for (int i=0;i<numcols;i++) lpx_set_col_stat(LP, i+1, LPX_NS);
>         lpx_warm_up(LP);
> I'm still getting reduced costs of zero.  Any suggestions?

In case of lpx_set_col_stat the status LPX_NS means only a non-basic
column, i.e. this flag does not change the column type.

The correct code is the following:

   for (i = 0; i < numcols; i++)
   {  /* obtain column value in mip solution */
      x = lpx_mip_col_val(LP, i+1);
      /* fix the column at that value */
      lpx_set_col_bnds(LP, i+1, LPX_FX, x, x);
   /* make all rows non-active and all columns non-basic */
   /* compute lp solution components */

reply via email to

[Prev in Thread] Current Thread [Next in Thread]