help-glpk
[Top][All Lists]
Advanced

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

Re: [Help-glpk] Applying a threshold to the solution using GMPL?


From: Michael Hennebry
Subject: Re: [Help-glpk] Applying a threshold to the solution using GMPL?
Date: Sun, 10 Nov 2013 11:54:57 -0600 (CST)
User-agent: Alpine 1.00 (DEB 882 2007-12-20)

On Sat, 9 Nov 2013, Reginald Beardsley wrote:

I've been  hoping it can be done with binary variables in GMPL as I'm still 
trying to refine the problem statement.  I'd like to be confident it's a good 
choice before coding it. I'd also like to improve my grasp of expressing 
problems in GMPL.  I started out using CPLEX format and switching to GMPL has 
been a huge improvement when trying to explore various problem formulations.

I'd recommend against.
You end up with constraints like
x <= U(x)*b
where U(x) is an upper bound on x.

With a two step solution if i set the weights to 0 or 1 I can probably get what 
I want by light editing of the data file using awk to add the weighting array.  
Not perhaps as elegant as solving in a single step, but it would allow using a 
pure LP solution and avoid the performance hit that a MIP formulation implies.  
Until I read your suggestion I'd been thinking along the lines of writing a 
whole new data file which was pretty painful to contemplate.

In the second stage, binaries might be more useful.
You already have a feasible solution and you
can substitute smaller numbers for the U(x)'s.

If you do not mind writing code:

more=false
do {
    for each x[j]:
        if x[j] != 0:
            if changing x[j] to 0 would not increase L1 too much:
                change x[j] to 0
                more=true
} while(more)

This would not necessarily be optimal.
The only x's changing are those changed to zero.
You could run the LP again with the new constraints and repeat the process.
Of course, using the API,
each change x[j] to 0 could be followed by a reoptimization.

--
Michael   address@hidden
"On Monday, I'm gonna have to tell my kindergarten class,
whom I teach not to run with scissors,
that my fiance ran me through with a broadsword."  --  Lily



reply via email to

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