or-fusion / pao

A Python Package for Adversarial Optimization
Other
17 stars 15 forks source link

PAO not working with MibS #98

Open tkralphs opened 11 months ago

tkralphs commented 11 months ago

I tried to run the simple example from the documentation with PAO version 1.0.2 and Pyomo 6.6.2 using MibS 1.2 as the solver using Python 3.9.10 on Ubuntu in WSL.

import pyomo.environ as pe
from pao.pyomo import *

M = pe.ConcreteModel()

M.x = pe.Var(bounds=(0,None), domain=pe.NonNegativeIntegers)

M.y = pe.Var(bounds=(0,None))

M.o = pe.Objective(expr=M.x - 4*M.y)

M.L = SubModel(fixed=M.x)

M.L.o = pe.Objective(expr=M.y)

M.L.c1 = pe.Constraint(expr=   -M.x -   M.y <= -3)
M.L.c2 = pe.Constraint(expr= -2*M.x +   M.y <=  0)
M.L.c3 = pe.Constraint(expr=  2*M.x +   M.y <= 12)
M.L.c4 = pe.Constraint(expr=  3*M.x - 2*M.y <=  4)

with Solver('pao.pyomo.MIBS') as solver:
    results = solver.solve(M)
    print(results)

print(M.x.value)
print(M.y.value)

There was no error, but also just a solution of (0,0). I debugged and everything initially seemed correct. I could actually solve the instance that was created with MibS on the command line from the MPS and AUX files that were output. But when I traced the execution within PAO, it finally ended up on this line and I couldn't really tell what happened.

FYI, the output format of the solution has changed a little in MibS 1.2 so I was originally thinking that might be the issue, but it seems that no output was obtained for some reason. I didn't try it on any other platforms. I didn't allocate a huge amount of time to this, just wanted to see if I could make it work :).

Edit: As an aside, I had to install pyutilib manually. It didn't get installed with pip install pao.

tkralphs commented 10 months ago

@whart222 Looks like you haven't been working in this repo in a while. If you can push me in the right direction, I can try to work up a PR.

whart222 commented 10 months ago

@tkralphs Yes, I don't have active funding to support PAO developments. But I've been OOO a bunch the past month, which is the real reason I didn't catch your issue.

I'll take a look at this before the end of next week to help diagnose the issue and give pointers for maintaining the MibS interface.