[OS] Binary variables ignore bounds?

Tony Kelman kelman at berkeley.edu
Sat Jan 31 04:03:15 EST 2015


Another interesting tidbit on this one: due to how the parser is 
implemented,
the behavior depends on the ordering of the type and ub attributes in the
corresponding var element. With this slightly modified file:

<?xml version="1.0" encoding="utf-8"?>
<osil xmlns="os.optimizationservices.org" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="os.optimizationservices.org 
http://www.optimizationservices.org/schemas/2.0/OSiL.xsd">
  <instanceHeader>
    <description>generated by CoinOptServices.jl on 2015/01/31 at 
00:50:09</description>
  </instanceHeader>
  <instanceData>
    <variables numberOfVariables="1">
      <var type="B" lb="0.0" ub="2.0"/>
    </variables>
    <objectives numberOfObjectives="1">
      <obj maxOrMin="max" numberOfObjCoef="1">
        <coef idx="0">1.0</coef>
      </obj>
    </objectives>
    <constraints numberOfConstraints="0"/>
  </instanceData>
</osil>

The ub=2.0 ends up overwriting the 1.0 from the binary type, and Cbc returns
an actually-infeasible solution <var idx="0">2</var>. So the "case 'u':"
section a few lines below should also be checking that the ub value read
from the attribute is actually less than the existing value for ub before
overwriting it.

-Tony


-----Original Message----- 
From: Tony Kelman
Sent: Saturday, January 31, 2015 12:03 AM
To: OS at list.coin-or.org
Subject: Re: Binary variables ignore bounds?

I should have mentioned that solving the same problem through Cbc's C API
works as expected. I think I found where the problem is, which wasn't easy
as I don't really understand yacc:
https://projects.coin-or.org/OS/browser/trunk/OS/src/OSParsers/OSParseosil.y.3?rev=4936#L778

Should setting the upper bound to 1.0 on that line be conditional on the
existing upper bound for var[varcount] being > 1.0 ?

-Tony

-----Original Message----- 
From: Tony Kelman
Sent: Friday, January 30, 2015 8:11 PM
To: OS at list.coin-or.org
Subject: Binary variables ignore bounds?

So, my Julia interface to OS is now working, see
https://github.com/tkelman/CoinOptServices.jl - I can send a more detailed
announcement with installation and usage instructions soon. The unit test
suite of JuMP (a Julia package for optimization modeling) is revealing what
looks like buggy behavior. Here's a very simple osil file:

<?xml version="1.0" encoding="utf-8"?>
<osil xmlns="os.optimizationservices.org"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="os.optimizationservices.org
http://www.optimizationservices.org/schemas/2.0/OSiL.xsd">
  <instanceHeader>
    <description>generated by CoinOptServices.jl on 2015/01/30 at
19:01:45</description>
  </instanceHeader>
  <instanceData>
    <variables numberOfVariables="1">
      <var lb="0.0" ub="0.0" type="B"/>
    </variables>
    <objectives numberOfObjectives="1">
      <obj maxOrMin="max" numberOfObjCoef="1">
        <coef idx="0">1.0</coef>
      </obj>
    </objectives>
    <constraints numberOfConstraints="0"/>
  </instanceData>
</osil>


When I send this problem to OSSolverService, using any of Cbc, Bonmin, or
Couenne, I get an incorrect solution of <var idx="0">1</var>, instead of
0 as expected. I have not yet tracked down where in the source this might
be happening. Somewhere that processes variable types might be overwriting
lower and upper bounds to 0 and 1 for all binary variables, instead of first
checking whether any existing bounds given in the osil file are stricter.

-Tony



More information about the OS mailing list