[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Help-glpk] Re: MIP Solutions
From: |
Andrew Makhorin |
Subject: |
[Help-glpk] Re: MIP Solutions |
Date: |
Thu, 02 Dec 2010 01:56:23 +0300 |
On Wed, 2010-12-01 at 17:50 +0000, Thomas Pfau wrote:
> Hello,
>
> I got a Problem here while trying to implement an algorithm using a MIP.
> I need to iteratively add constraints to a problem. I.e. in each
> iteration an additional constraint is added and the problem is recomputed.
Does this mean that you add constraints with glp_add_rows and then call
glp_intopt again and again?
> I do not know if this causes my problem but glp_intopt solvers the
> problem returning a Solution where one of the constraints is violated.
> Printing out the solution also shows this (i.e. in the solution file
> under KKT.PE there is a statement, that the solution is wrong).
This may happen due to insufficient accuracy, as a rule, if your mip
instance is badly scaled or ill-conditioned, for example, because of too
"big M" used.
> However, I know that there are still feasible correct solutions to the
> problem. Would I need to reset the whole problem each time and construct
> it again
No, it is not needed.
> (this would be kind of bad since I would have to keep track of
> the additional constraints added in each iteration, which would
> otherwise just be stored in the problem), and if not, how can I detect
> if the result returned in fact is violating a constraint (since the only
> place I find where this is mentioned is in the KKT.PE statement), and
> how can I tell the algorithm to restart/keep searching for a correct
> solution.
You may try to decrease the integer tolerance. By default it is 1e-5.
>
> In addition:
> Could someone please tell me how to use the glp_init_iocp() function?
> When I tried something like this:
>
> glp_iocp* param;
> glp_init_iocp(glp_iocp);
>
> It lead to a segfault in the program (the seqfault did not occur in the
> glp_init_iocp() function but later on in my program, but I think I
> tracked the misallocation to be happening somewhere in the
> glp_init_iocp() function).
You should allocate the glp_iocp structure in your program like follows:
glp_iocp parm;
glp_init_iocp(&parm);
Please see examples in the glpk reference manual.
- [Help-glpk] Re: MIP Solutions,
Andrew Makhorin <=