Scholtes Regularization with Adaptive Paths for MPECs
Project description
MPECSS: A Smart Solver for Complex Optimization
What is MPECSS?
Imagine you have a difficult math problem where you need to find the best balance between two opposing forces (like traffic flow vs. road capacity) but there's a catch: for every decision, one of two conditions must be zero. These are called "Equilibrium Constraints," and they are notoriously hard for computers to solve.
MPECSS is a specialized tool that "smooths out" these hard catches, making it easier for standard math solvers to find the best possible solution.
Why use it?
- Real-world power: Used in traffic planning, electricity markets, and friction modeling.
- Smart Fallbacks: If the primary method gets stuck, MPECSS has a "Phase III" safety net to find a valid solution.
- Trusted Results: It checks its own work to tell you if the solution is "S-stationary" (the best) or "B-stationary" (a solid, reliable alternative).
Quick Installation
1. For Most Users (Easy Mode)
Simply install it like any other Python package:
pip install mpecss
2. For Researchers (Developer Mode)
If you want to help develop the code or see exactly how it works:
git clone https://github.com/mrsaurabhtanwar/MPECSS.git
cd MPECSS
pip install -e .
How to Solve Your First Problem
You can solve a problem in just a few lines of code:
from mpecss.helpers.loaders.macmpec_loader import load_macmpec
from mpecss.phase_2.mpecss import run_mpecss
# 1. Load a pre-defined problem
problem = load_macmpec("benchmarks/macmpec/macmpec-json/dempe.nl.json")
# 2. Pick a starting point
z0 = problem["x0_fn"](seed=42)
# 3. Solve it!
result = run_mpecss(problem, z0=z0)
print(f"Status: {result['status']}")
print(f"Result: {result['f_final']:.6f}")
Running Benchmarks (886 Problems)
MPECSS comes with a massive test suite of 886 problems to prove it works.
Setup Benchmark Data
- Download
benchmarks.zipfrom our GitHub Releases. - Extract it into your project folder. Do not rename the folder.
Run the Tests
We provide simple commands to run all tests at once:
# Run the MacMPEC suite (191 problems)
mpecss-macmpec --workers 4
# Run the MPECLib suite (92 problems)
mpecss-mpeclib --workers 4
# Run the NOSBENCH suite (603 problems)
mpecss-nosbench --workers 4
Understanding the Solver Output
| Status | What it means |
|---|---|
| S-stationary | ✅ Perfect! The solver found the best possible stationary point. |
| B-stationary | ✅ Good! A solid, mathematically verified solution. |
| Failed | ❌ The problem was too complex to solve this time. |
Simplified Project Layout
mpecss/: The core brain of the solver.phase_1/: Finding a good starting point.phase_2/: The main solving logic.phase_3/: Polishing and verifying the results.
benchmarks/: The massive collection of test problems.scripts/: Useful tools for running large-scale tests.results/: Where the solver saves its answers.
Detailed Algorithm Flow
graph TD
Start((Start)) --> Phase1[Phase I: Find Starting Point]
Phase1 -->|"Feasibility Search"| S0[S.0: Setup]
S0 --> S1[S.1: Solve Smoothed Math]
S1 --> S2{S.2: Quality Test}
S2 -->|Pass| S4[S.4: Step Forward]
S2 -->|Fail| S3[S.3: Restoration]
S3 --> S1
S4 --> Check{Converged?}
Check -->|No| S1
Check -->|Yes| Phase3[Phase III: Polish]
Phase3 --> BNLP[BNLP Polish]
BNLP --> LPEC[LPEC Refinement]
LPEC --> BStat[Final Verification]
BStat --> End((Success))
Citation & Contact
If you use this work, please cite:
@article{saurabh2026mpecss,
title={MPECSS: Scholtes regularization with adaptive paths for MPECs},
author={Saurabh and Singh, Kunwar Vijay Kumar},
journal={Optimization Methods and Software},
year={2026}
}
Need Help?
- Open an issue on GitHub
- Email:
27098@arsd.du.ac.in
License: Apache 2.0
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mpecss-1.0.3.tar.gz.
File metadata
- Download URL: mpecss-1.0.3.tar.gz
- Upload date:
- Size: 85.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fa7c001a7e342ee2de9f720cd82983f8458d71dcc41ad116ff2b2b732f4240e0
|
|
| MD5 |
efc3118cc33feaa175ebb53d8548f3f8
|
|
| BLAKE2b-256 |
fa5f6b66e3e0543162c3f39270c7a25e8c6cbd009112bfc472d6bd78be576676
|
Provenance
The following attestation bundles were made for mpecss-1.0.3.tar.gz:
Publisher:
publish.yml on mrsaurabhtanwar/MPECSS
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mpecss-1.0.3.tar.gz -
Subject digest:
fa7c001a7e342ee2de9f720cd82983f8458d71dcc41ad116ff2b2b732f4240e0 - Sigstore transparency entry: 1176867407
- Sigstore integration time:
-
Permalink:
mrsaurabhtanwar/MPECSS@21e512f72cde22bb0899dc21243c61a56bb41e90 -
Branch / Tag:
refs/tags/v1.0.3 - Owner: https://github.com/mrsaurabhtanwar
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@21e512f72cde22bb0899dc21243c61a56bb41e90 -
Trigger Event:
push
-
Statement type:
File details
Details for the file mpecss-1.0.3-py3-none-any.whl.
File metadata
- Download URL: mpecss-1.0.3-py3-none-any.whl
- Upload date:
- Size: 98.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f323e9c373cb4f94280984a8b268cdb832f91938f11a1aeb64ecc547efc8ffda
|
|
| MD5 |
cf1c64bd21de5eeed3b50cb5eb57539c
|
|
| BLAKE2b-256 |
02ca2a19cd7a64c49b68da4f24111f636418f2e2aaeca1d6726d99c56ae68c9f
|
Provenance
The following attestation bundles were made for mpecss-1.0.3-py3-none-any.whl:
Publisher:
publish.yml on mrsaurabhtanwar/MPECSS
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mpecss-1.0.3-py3-none-any.whl -
Subject digest:
f323e9c373cb4f94280984a8b268cdb832f91938f11a1aeb64ecc547efc8ffda - Sigstore transparency entry: 1176867685
- Sigstore integration time:
-
Permalink:
mrsaurabhtanwar/MPECSS@21e512f72cde22bb0899dc21243c61a56bb41e90 -
Branch / Tag:
refs/tags/v1.0.3 - Owner: https://github.com/mrsaurabhtanwar
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@21e512f72cde22bb0899dc21243c61a56bb41e90 -
Trigger Event:
push
-
Statement type: