[Coin-discuss] CBC applied to maximization problems
Hart, William E
wehart at sandia.gov
Tue Dec 2 12:33:21 EST 2008
> > I'm working on a CBC wrapper, and I'm not sure how to
> interpret CBC when it is applied to a maximization problem
> that is read-in from a *.lp file. It appears that CBC
> automatically negates the objective and solves the
> corresponding minimization problem.
> >
> > . Is there a way to force CBC to solve the problem as a
> maximization problem?
>
> This has little to do with Cbc. CoinLpIO is flipping the
> objective function when reading the Lp file. Cbc does not
> know that the original lp file was a maximization.
>
> The reason for flipping the objective to get a minimization
> is that orginially, only MPS files were used as input and MPS
> files are always minimization problems. To avoid problem with
> solvers that assumed that the input came from an MPS file, I
> made LpIO flip the objective function.
Ah. That makes sense.
> > . Is there a way to force CBC to indicate that it negative
> the objective?
> >
> > Without these hooks, I'm struggling with how to automate
> the process of converting the CBC result back into the answer
> for the original maximization problem...
>
> Why? Isn't flipping the sign of the optimal value good
> enough? Is there a constant term in the objective function?
Here's my scenario. I have a wrapper script that passes a LP or MPS file to CBC, and then parses the output. The results of this optimization process are then returned to the user. The confusing thing is that a user sees minimization results when passed a maximization problem. Logically, it's identical, but this will be surprising and confusing to non-technical users.
If CBC/CoinLpIO simply printed a warning that this problem was being reformulated, that would be enough for me to correctly parse the output. (Working with the library directly, this wouldn't be an issue because I could check the max/min sense of the original problem...).
--Bill
More information about the Coin-discuss
mailing list