Following the short discussion here about linear programming, i.e. solving convex optimization problems of the form
and realizing that I could actually use such a solver for one of my research problems, I’ve decided to bite the bullet and started LightConvex
, a lightweight package written in Modern Fortran for convex programming. While I have already modernized QuadProg
for dense strictly convex quadratic programming, I’d like LightConvex
to be more general (i.e. not just QP, not just dense problems, and not just strictly convex problems).
There are fantastic packages available in other languages. The ones I’m most familiar with are those from the cvx
family, e.g. cvxpy
in Python or Convex.jl
in Julia. Both of these provide a complete domain specific language for disciplined convex programming enabling the user to define the problem in a language very close to the actual mathematical one. It is then pre-process behind the scene to put it in a standard conic form which can then be passed to various high-quality convex optimizers (e.g. Clarabel.jl
or SCS
to name only the open-source ones). As much as I’d like to see an equivalent in Fortran, my goal (for now) with LightConvex
is not to replicate these features. Instead, I would like to focus on the most common problems (i.e. linear and quadratic programs) and provide a descent selection of high-quality (and ideally high-performance) specialized solvers written in pure modern Fortran. In that regard, LightConvex
would be closer to HiGHS
which is now used behind the scene in scipy
to actually solve linear programs.
I’ve actually just started working on this new package and so it currently provides only the strict minimum (i.e. the standard simplex method for dense linear programs). I figured it was however better to announce it sooner than later to probe the community regarding how useful such a package would be, get some suggestions and feedback as early as possible to make it as easy to use as possible, as well as see if other convex enthusiasts with the know-how would be interested in helping the development of this package. As I’ve said, I’ve just started working on this project and what’s in the repo is hardly the embryo of a prototype with only the standard simplex method for dense LP being implemented. Here however is a tentative list of features I’d like to see included before officially releasing a first version of this prototype:
- Support for dense LP
- Standard primal simplex algorithm
- Standard dual simplex algorithm
- Revised dual simplex algorithm
- Support for sparse LP
- Primal simplex algorithm
- Revised dual simplex algorithm
- Primal Affine Scaling
- High-level interfaces
-
problem = LP(c, A, b)
for dense and sparse LP. -
solution = solve(problem, alg=some_alg(options...))
for dense and sparse LP.
-
- Preprocessing
- Conversion of any LP into standard equality form
- Idiot Crash Algorithm
- Utilities
- (Compressed) MPS file reader
- Examples
- Max Flow / Min Cut
- Documentation
- In-code documentation
- Online documentation using
FORD
- Continuous integration and documentation
- Unit tests based on the netlib LP test suite
- CI based on setup-fortran-conda with
fpm
build system and automatic documentation withFORD
- Add code coverage using
codecov
For the sake of simplicity, I plan to focus first on linear programs (because this is what I currently need) and to support only double precision arithmetic for now (this can easily be extended later on using fypp
). The current choice of algorithms is semi-arbitrary and mostly comprises those I am somewhat familiar with. Anyone more knowledgeable with LP is more than welcome to give their two cents (or even better, contribute )!