[Coin-discuss] problem of solving a model with SOS2 in CBC
zhongxia at eng.buffalo.edu
zhongxia at eng.buffalo.edu
Mon Sep 11 09:28:55 EDT 2006
Please discard my previous post. The problem was solved correctly by
sos2.cpp.
Thanks,
Christy
Quoting zhongxia at eng.buffalo.edu:
> Thanks for the reply. I tried this on the same mps model (sos2.mps)
> and
> got solution with obj value -10. This is still not correct. The
> correct
> solution should be (x1=x2=1, obj = -5).
>
> Christy
>
> Quoting John J Forrest <jjforre at us.ibm.com>:
>
> > The CoinMpsIO reader does not know how to pass SOS info to
> solvers.
> >
> > The attached driver gives correct answer.
> >
> > John Forrest
> >
> >
> > (See attached file: sos2.cpp)
> >
> >
> >
>
> >
> > Hongxia Zhao
>
> >
> > <zhongxia at eng.buf
>
> >
> > falo.edu>
>
> > To
> > Sent by:
> coin-discuss at list.coin-or.org
> >
> > coin-discuss-boun
>
> > cc
> > ces at list.coin-or.
>
> >
> > org
> > Subject
> > [Coin-discuss] problem of
> > solving a
> > model with SOS2 in CBC
>
> >
> > 09/08/06 02:55 PM
>
> >
> >
>
> >
> >
>
> >
> > Please respond to
>
> >
> > Discussions about
>
> >
> > open source
>
> >
> > software for
>
> >
> > Operations
>
> >
> > Research
>
> >
> > <coin-discuss at lis
>
> >
> > t.coin-or.org>
>
> >
> >
>
> >
> >
>
> >
> >
> >
> >
> >
> > Hello,
> >
> > I am trying to solve the following simple problem with SOS2
> > constraint
> > using CBC,
> >
> > ------------------------------
> > min -10x1 + 5x2 -10x3
> >
> > s.t. x1 + x2 + x3 = 2
> >
> > x1 <= 1
> >
> > x3 <= 1
> >
> > x1, x2, x3 >= 0
> >
> > { x1, x2, x3 } is SOS2
> > ---------------------------------
> >
> > I don't want to use binary variables to model the problem. So the
> MPS
> > file
> > (sos.mps) of this problem is
> >
> > *=============================================================
> > NAME
> > ROWS
> > N obj
> > E c1
> > L c2
> > L c3
> > COLUMNS
> > x1 obj -10 c1 1
> > x1 c2 1
> > x2 obj 5 c1 1
> > x3 obj -10 c1 1
> > x3 c3 1
> > RHS
> > rhs c1 2 c2 1
> > rhs c3 1
> > SOS
> > S2
> > x1
> > x2
> > x3
> > ENDATA
> > *============================================================
> >
> > I tried to solve this problem on windows by using
> > CbcExamplesSample2.exe
> >
> > > CbcExamplesSample2.exe sos.mps
> >
> > The solution I got has objective value -20 which is not correct.
> If
> > the
> > SOS2 constraint was considered correctly, the solution should be
> >
> > x1 = x2 = 1, obj = -5.
> >
> > My question is:
> >
> > Can Cbc solve this kind of problem with SOS2 constraint and
> without
> > using
> > binary variable correctly? If so, how?
> >
> > Thanks,
> > Christy
> >
> >
> >
> > _______________________________________________
> > Coin-discuss mailing list
> > Coin-discuss at list.coin-or.org
> > http://list.coin-or.org/mailman/listinfo/coin-discuss
> >
> _______________________________________________
> Coin-discuss mailing list
> Coin-discuss at list.coin-or.org
> http://list.coin-or.org/mailman/listinfo/coin-discuss
>
More information about the Coin-discuss
mailing list