Skip to content

Fixed the choice of PULP solver issue - #119

Merged
ishikaghosh2201 merged 4 commits into
masterfrom
118-ilp-solver-choice
Sep 22, 2026
Merged

ishikaghosh2201 merged 4 commits into
masterfrom
118-ilp-solver-choice

Conversation

@lizliz

@lizliz lizliz commented Sep 22, 2026

Copy link
Copy Markdown
Collaborator

Description

This change makes the PuLP solver selection explicit and environment-aware instead of relying on a bundled CBC binary from the local virtual environment.

The root cause was that the project could silently launch an incompatible CBC executable in the .venv, which caused Bad CPU type in executable failures on macOS when running the interleaving optimization. The fix prefers the active environment’s installed CBC binary, honors explicit solver path overrides, and uses the supported PuLP COIN_CMD(..., path=...) API for custom CBC locations.

This keeps solver selection controllable across environments and avoids other users hitting the same branch-specific architecture mismatch.

Motivation and Context

The interleaving optimization path calls into PuLP to solve the ILP. In this environment, the bundled CBC in the virtualenv was not compatible with the machine architecture, so optimization crashed before the actual algorithm could run.

This change is required to make the solver choice deterministic and safe across local developer environments, conda environments, and CI setups.

How has this been tested?

By running make tests

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

  • I have incremented the version number in the pyproject.toml file if a new version needs to be pushed to pypi. Note that if the number isn't incremented, the package will not be pushed to pypi, which is useful if this PR is only for updating documentation.
  • My code follows the code style of this project and I have run make format to clean up the code with black.
  • My change requires a change to the documentation. I have updated the documentation as necessary and compiled locally to ensure it is clean.
  • I have added tests to cover my changes, and all new and existing tests passed (run make tests).

@lizliz
lizliz requested review from ishikaghosh2201 and a lite review from Copilot September 22, 2026 14:39
@lizliz lizliz linked an issue Sep 22, 2026 that may be closed by this pull request

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Solver discovery does not match PuLP’s canonical names, and focused selector tests are missing.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Medium severity · 1 Low severity

Open (2)
What changed in this PR

This PR makes PuLP solver selection environment-aware and updates the package version.

Changes:

  • Adds configurable solver and CBC path selection.
  • Applies the selected solver to both ILP paths.
  • Bumps the version to 0.1.17.
File Summary
pyproject.toml Updates the package version.
cereeberus/​cereeberus/​distance/​ilp.py Adds solver selection and integrates it into ILP solving.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread cereeberus/cereeberus/distance/ilp.py
Comment thread cereeberus/cereeberus/distance/ilp.py
lizliz and others added 2 commits September 22, 2026 10:45
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@ishikaghosh2201
ishikaghosh2201 merged commit 978a5a4 into master Sep 22, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ILP Solver choice

3 participants