pulp version 4.0

5 views
Skip to first unread message

franco.p...@gmail.com

unread,
May 7, 2026, 3:41:37 AM (6 days ago) May 7
to pulp-or-discuss

Hello everyone,

I’ve been busy migrating pulp to a new rust-core. More about why and how in this blog post.

The changes are already in the master branch and work, but I haven’t yet published a stable release for fear of breaking incompatible code.
The speed benefits are real: in the only benchmark I ran, version 4.X took around 60% less time to build the model compared to the current stable one (3.3). It seemed to now be as fast as pyomo from this limited test, which I thought was disappointing: I’m curious if it could become even faster/ more efficient with time and a bit of profiling.

Non-stable releases are already available:

pip install pulp==4.0.00a6

As you can see, the installation remains the same.
But it brings breaking changes both for users and developers. And I’m taking the opportunity to bring more breaking changes to this version to do this in one go.

The main changes for users so far are:

  1. variables are created via model.add_variable instead of LpVariable.
  2. some internal methods have changed (constraints are no longer python dictionaries). There are still some deprecation methods but this may still break niche uses of pulp that rely on accessing the internals.
  3. cbc binaries will not come installed with pulp anymore: the user will need to explicitly ask for it during installation. I.e., pip install pulp[cbc] or pip install pulp[highs] or pip install pulp[scip].
  4. I’m considering other changes, such as the solve() method returning a solution status object with more information on the solver status, progress, gap, etc.

Most normal pulp code will only require some small changes for (1) and (3), honestly.


For developers, the main change is to require rust during the building, the current README already shows this.


The current documentation of PuLP already points to the 4.X both for user API and developer instructions.

Yesterday, I published a stable version pulp==3.3.1 that provides warnings for user deprecated methods (1) and (2) and already is compatible with the 4.X API. This should mean that new users/ projects should write code in the new API, preparing for the version change.

(3) is fixed by explicitly including cbc as a pulp option. I want to know if (4) may be useful for users before implementing that and breaking more things (i.e., returning an object instead of a status integer).

cheers,

Franco

Reply all
Reply to author
Forward
0 new messages