PSLP is a fast, dependency-free presolver for linear programs (LPs) of the form
PSLP simplifies LPs before they are passed to a solver by detecting redundant constraints and fixing variables etc. It is written in C99 and is lightweight with no external dependencies. Happy presolving!
PSLP is built using CMake. If you wish to use PSLP in your own CMake-based project, a simple approach is to do as follows.
First, create a folder third_party in your project root and add PSLP as a submodule by running the following command
in your terminal:
git submodule add https://github.com/dance858/PSLP.git third_party/PSLP
Next, add PSLP as a subdirectory by adding the following line to your CMakeLists.txt:
add_subdirectory(third_party/PSLP EXCLUDE_FROM_ALL)
Finally, link your project to PSLP by adding the following line to your CMakeLists.txt (replace YOUR_PROJECT with your actual target name):
target_link_libraries(YOUR_PROJECT PRIVATE PSLP)
After this, you should be able to import the public API using #include "PSLP_API.h".
The public C API is defined in the header file PSLP_API.h. The other files
in that folder contain some trivial public data structures. The API consists of three main operations:
-
Initialization — performed using
new_presolver(), which creates and initializes internal data structures used by the presolver. -
Presolve — performed using
run_presolver(), which executes the presolve routines to reduce the LP. The reduced LP is available in the structreduced_probof the presolver struct. -
Postsolve — performed using
postsolve(), which recovers a primal-dual solution to the original LP from a primal-dual solution to the reduced problem.
Detailed descriptions of each function and all associated data structures are
documented in the PSLP folder. A video tutorial is available here.
Note that since the video was recorded, PSLP_inf has been removed. Infinite variable bounds or constraint limits
should now be represented using the IEEE-754 encoding. (For example, in C, use INFINITY defined in math.h).
A paper is under preparation. If you wish to cite this software, you may use the following bibtex.
@software{Cederberg2025,
author = {Cederberg, Daniel and Boyd, Stephen},
title = {PSLP — A Lightweight C Presolver for Linear Programs},
year = {2025},
url = {https://github.com/dance858/PSLP},
}