Registry / data / passagemath-glpk

passagemath-glpk

JSON →
library10.8.4pypypiunverified

passagemath-glpk provides a linear and mixed integer linear optimization backend using GLPK (GNU Linear Programming Kit) for the passagemath library. It enables the construction and solution of linear programming (LP) and mixed-integer linear programming (MILP) problems. Version 10.8.4 supports Python >=3.11,<3.15. The package is part of the passagemath ecosystem, which reimplements functionality previously provided by SageMath.

pip install passagemath-glpk
INSTALL
IMPORT
SIG · PASSAGEMATH-GLPK
P
passagemath-glpk
datapythonv10.8.4
Install
5.8s avg
Import
Disk
101MB
Pass rate
8/ 10
Env Coverage8 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v10.6.48 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
✓ —
✓ 7.9s
py 3.11
✓ —
✓ 4s
py 3.12
✓ —
✓ 3.4s
py 3.13
✕ build_error
✕ build_error
py 3.9
✓ —
✓ 7.9s
101MB installed
● package 101MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

GLPKBackend
from sage.all__sagemath_glpk import GLPKBackend
from sage.all__sagemath_glpk import GLPKBackend

Quickstart example: solve a simple MILP using GLPK backend.

from passagemath.numerical.mip import MixedIntegerLinearProgram # Create MILP instance with GLPK backend p = MixedIntegerLinearProgram(solver='GLPK') # Define variables x = p['x'] y = p['y'] # Add constraints p.add_constraint(x + 2*y <= 4) p.add_constraint(2*x + y <= 6) # Set objective p.set_objective(3*x + 4*y) # Solve p.solve() # Get solution print(f"x = {p.get_values(x)}") print(f"y = {p.get_values(y)}")
Debug
Known issues
breakingGLPKBackend import path changed from sage.numerical.backends.glpk_backend to passagemath.glpk.backend.
fix
Change import to 'from passagemath.glpk.backend import GLPKBackend'.
affects: Migrating from SageMath (any version) to passagemath-glpk >=10.8
breakingMixedIntegerLinearProgram now requires 'solver' parameter; default may not be GLPK. In SageMath, default was GLPK.
fix
Explicitly pass solver='GLPK' when creating MixedIntegerLinearProgram.
affects: passagemath-glpk >=10.0
gotchaGLPK backend may not be thread-safe; avoid concurrent solve calls.
fix
Serialize solve calls or use multiprocessing with separate processes.
affects: All versions
Upgrade
Version history
10.8.4latest on PyPI · released Apr 20, 2026
Audit
Dependencies
passagemathrequiredCore library providing MILP framework and LP/MILP problem class.
Agent activity
12 hits · last 30 days
node
12
Resources