Skip to main content

LP-IP-craft: linear and mixed-integer optimization in Rust

lp-ip-craft

Linear programming (LP) and mixed-integer linear programming (MILP) in Python, solved by a native Rust engine: a bounded-variable dual revised simplex on a sparse LU factorization, presolve, cuts and branch-and-bound. Every returned point is evaluated independently of the solver (objective, row activities, bound and integrality violations), and lp_residuals checks LP duals.

Install

python -m pip install lp-ip-craft

Wheels (abi3, CPython 3.10 or newer) cover Linux x86_64, Windows x64 and macOS x86_64/arm64 and need no compiler. On other platforms pip builds the source distribution, which needs Rust 1.85 or newer. The package depends on nothing else at run time.

Example

from lp_ip_craft import Model, solve

# maximize 5x + 4y  subject to  6x + 4y <= 24,  x + 2y <= 6,  0 <= x, y <= 10, integer
model = Model(
    objective=[5.0, 4.0], sense="maximize",
    lower=[0.0, 0.0], upper=[10.0, 10.0],
    row_lower=[float("-inf"), float("-inf")], row_upper=[24.0, 6.0],
    indptr=[0, 2, 4], indices=[0, 1, 0, 1], values=[6.0, 4.0, 1.0, 2.0],  # A in CSR form
    kinds=["integer", "integer"],
)
result = solve(model, backend="native")
print(result.status, result.candidate, result.evaluation.objective, result.best_bound)
# optimal [4.0, 0.0] 20.0 20.0

Pass backend="native": the default backend="dummy" only evaluates a start point. Options sets the tolerances and the numerical width (threads, 1 to 8); NativeOptions holds the engine's controls, including time, node and iteration limits, and rejects unknown names. solve_batch solves independent models with up to 16 workers. evaluate and lp_residuals check points and duals from any solver.

Limits

  • A MIP needs finite bounds on all variables, continuous ones included, as given or derived by root inference (which runs with presolve on).
  • Linear objectives only: no QP or MIQP.
  • optimal and the gap are numerical findings under the stated tolerances. For hard industrial MIPs, compare against a mature solver such as HiGHS.

More

MIT license.

Metadata

Release files for lp-ip-craft 0.32.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lp-ip-craft 0.32.0
File Size Uploaded Provenance Actions
lp_ip_craft-0.32.0.tar.gz 292.5 kB Without provenance Details for lp_ip_craft-0.32.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for lp-ip-craft 0.32.0
File Actions
lp_ip_craft-0.32.0-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details for lp_ip_craft-0.32.0-cp310-abi3-win_amd64.whl
lp_ip_craft-0.32.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.10 abi3 Linux glibc 2.17+ x86-64 Details for lp_ip_craft-0.32.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
lp_ip_craft-0.32.0-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details for lp_ip_craft-0.32.0-cp310-abi3-macosx_11_0_arm64.whl
lp_ip_craft-0.32.0-cp310-abi3-macosx_10_12_x86_64.whl CPython 3.10 abi3 macOS 10.12+ x86-64 Details for lp_ip_craft-0.32.0-cp310-abi3-macosx_10_12_x86_64.whl

Total release size: 3.9 MB

Release files / lp_ip_craft-0.32.0.tar.gz

Download URL lp_ip_craft-0.32.0.tar.gz
Size 292.5 kB
Tags Source
SHA-256 checksum
How to use checksums
907f8e9d89caeedfe458ac9d58a2e0487f6d5f88a9af6de491fcb063a72e7d4f
BLAKE2b-256 checksum
How to use checksums
d9b4605112715fa5a2e4b3eba50cfcf0109eab4a410727a99b234f97201b1bfd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / lp_ip_craft-0.32.0-cp310-abi3-win_amd64.whl

Download URL lp_ip_craft-0.32.0-cp310-abi3-win_amd64.whl
Size 838.9 kB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
7ed8380b576ffa2870ed72d465e3628b3cf3e33110a359ef33d30f77961e3204
BLAKE2b-256 checksum
How to use checksums
fd1ef900c221367d4e2db7e33609fdf54b0ba0b77854d05a123edf154bf975a9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / lp_ip_craft-0.32.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL lp_ip_craft-0.32.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 988.3 kB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
76b756b34c1abb3b583d79843325e248f8e8491773af2c58c594de29f6aeeee0
BLAKE2b-256 checksum
How to use checksums
71e4ee7b5d244041bfae60ad771f565e56afbbfe2e48e95c6776db0c647b01bb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / lp_ip_craft-0.32.0-cp310-abi3-macosx_11_0_arm64.whl

Download URL lp_ip_craft-0.32.0-cp310-abi3-macosx_11_0_arm64.whl
Size 867.2 kB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
cdeec0cd5dd0e95600be96467fe0366cc3cf42a581ac46340293e2704a7ff8df
BLAKE2b-256 checksum
How to use checksums
fb14ad9b7cca0098a4e2c3b5371a8028b3fe130e3d6b83b16190267a68baf9e8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / lp_ip_craft-0.32.0-cp310-abi3-macosx_10_12_x86_64.whl

Download URL lp_ip_craft-0.32.0-cp310-abi3-macosx_10_12_x86_64.whl
Size 909.8 kB
Tags CPython 3.10 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
48d21faa65571b321b5266a6fb4f68d9583f1dca8a64a36c9fcd380543ad1abc
BLAKE2b-256 checksum
How to use checksums
483ed60727fdd8a6d37b66b1a636837577e574152c5b853108bd59ba90e8d20c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for lp-ip-craft 0.32.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page