Pyomo 6.4.3 with HiGHS solver

545 views
Skip to first unread message

Jack Simpson

unread,
Nov 27, 2022, 9:16:16 PM11/27/22
to Pyomo Forum
Hi everyone, does anyone know when Pyomo 6.4.3 will be officially released? I've been using the development version so I can use the HiGHS solver and was curious if this was going to be officially released soon.

Thanks,
Jack

Siirola, John D

unread,
Nov 28, 2022, 2:41:18 PM11/28/22
to pyomo...@googlegroups.com

Pyomo 6.4.3 was released this morning, and is now available on both PyPI and conda-forge.

 

[The release was originally planned for last Monday, but was delayed a week to track down an intermittent test failure we were seeing in Python 3.9]

 

In addition, the HiGHS developers have also released highspy builds for Windows to PyPI, so it should now be straightforward to use the appsi_highs solver on all platforms supported by Pyomo (linux, windows, and osx).

 

John

 

 

From: pyomo...@googlegroups.com <pyomo...@googlegroups.com> On Behalf Of Jack Simpson
Sent: Sunday, November 27, 2022 7:16 PM
To: Pyomo Forum <pyomo...@googlegroups.com>
Subject: [EXTERNAL] Pyomo 6.4.3 with HiGHS solver

 

You don't often get email from jackbruc...@gmail.com. Learn why this is important

Hi everyone, does anyone know when Pyomo 6.4.3 will be officially released? I've been using the development version so I can use the HiGHS solver and was curious if this was going to be officially released soon.

 

Thanks,

Jack

--
You received this message because you are subscribed to the Google Groups "Pyomo Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyomo-forum...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyomo-forum/03f22836-e055-4f88-8acd-c62c93be8ac6n%40googlegroups.com.

Jack Simpson

unread,
Nov 28, 2022, 5:53:30 PM11/28/22
to pyomo...@googlegroups.com
Fantastic, thanks so much John!

You received this message because you are subscribed to a topic in the Google Groups "Pyomo Forum" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pyomo-forum/tApZf3i2cso/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pyomo-forum...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyomo-forum/SA9PR09MB4829A5D838B5A566C5AB4725DA139%40SA9PR09MB4829.namprd09.prod.outlook.com.

Andrea

unread,
Dec 6, 2022, 11:54:06 AM12/6/22
to Pyomo Forum
Hi, do you know if the appsi_highs solver can be used also with models built with pyomo.kernel?  I see that some functions in pyomo/contrib/appsi/base.py make assumptions on Param and Var objects as if they're defined through the pyomo.environ module. e.g. trying to access to "mutable" attribute of parameters or "domain" attribute of variables.

Thanks,
Andrea

Jeff Hubbs

unread,
Dec 13, 2022, 8:41:12 AM12/13/22
to Pyomo Forum
I'm setting up an instance of a Python-based modeling application that is using pyomo and GLPK. I've gotten it to start on a dataset and it's been running for a week, maxxing out just one core the whole time. I've got the app running in a venv and in the course of its installation it pulled in pyomo 6.4.2. Other than somehow making it engage 6.4.3 instead, what more would be involved in getting it to use HiGHS instead of GLPK, or is this not something that can be readily switched over like that?

Jack Simpson

unread,
Dec 13, 2022, 9:00:24 AM12/13/22
to pyomo...@googlegroups.com
If you install via pip now it should pull in the latest version of 6.4.3 - that's the one where support for HiGHS was added.

Michael Bynum

unread,
Dec 13, 2022, 9:36:49 AM12/13/22
to Pyomo Forum
Unfortunately, the Appsi solver interfaces do not work with pyomo.kernel.

Michael

Jeff Hubbs

unread,
Dec 16, 2022, 8:58:17 AM12/16/22
to Pyomo Forum
For posterity, here's an example of using Pyomo/HiGHS to solve a simple problem. To get to where this would run under Gentoo Linux, I created a venv specifically for this, activated it, and used pip to install pyomo and highspy. Then:

from pyomo.environ import *
import highspy

# Create model object
model=ConcreteModel()

# Declare decision variables
model.l=Var(within=NonNegativeReals)
model.g=Var(within=NonNegativeReals)

# Declare objective function
model.maximizeProfit=Objective (expr= 200 * model.l + 300 * model.g, sense=maximize)

# Declare constraints
# Farmer Brown has only 100 hours
model.LaborConstraint = Constraint (expr=3 * model.l + 2 * model.g <=100)
# He only has $120 for medical
model.MedicalConstraint=Constraint (expr=2 * model.l + 4 * model.g <=120)
# He only has 45 acres
model.LandConstraint= Constraint (expr= model.l + model.g <=45)

# Show all available solvers
print(SolverFactory.__dict__['_cls'].keys())
print("")

# Test for availability of solver
slvr='appsi_highs'
if SolverFactory(slvr).available():
  print("Solver " + slvr + " is available.")
else:
  print("Solver " + slvr + " is not available.")
optimizer=SolverFactory(slvr)
optimizer.solve(model)
model.display()

Note: sample problem from YouTube's "Dr. Katie" at https://youtu.be/AOEG_MEwSDA

Lucas Pinheiro

unread,
Jan 9, 2024, 7:27:02 PMJan 9
to Pyomo Forum
Greetings,

I'm using Pyomo 6.6.2 and was using GLPK as a solver for a MIP I'm working on. However GLPK performance is very poor for bigger instances.
I recently discovered HiGHS, and was able to put it to work by using appsi following Jeff's instructions.
I already got some results, which is great, however I 've reached a situation where it seems that the solver "freezes", and stops using the CPU at all (checking via htop on Ubuntu, CPU usage for the python3 proccess ID drops from ~100% to near 0% in less than 15 minutes, while the proccess keeps running).

I thought that this may be happening because my problem got too big, or is it a bug? I don't know of any specific problem size limitation by using HiGHS, so if someone has any tip I would appreciate. I can give more detail if needed.

If needed, I can move this topic to a new thread.
Thanks in advance.
Reply all
Reply to author
Forward
0 new messages