{"id":25858877,"url":"https://github.com/petters/monolith","last_synced_at":"2025-07-10T00:07:01.892Z","repository":{"id":40973514,"uuid":"146800615","full_name":"PetterS/monolith","owner":"PetterS","description":"A C++ monorepo for discrete and continuous optimization. Batteries included!","archived":false,"fork":false,"pushed_at":"2024-04-18T14:01:44.000Z","size":65478,"stargazers_count":102,"open_issues_count":7,"forks_count":13,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-04T11:51:09.555Z","etag":null,"topics":["column-generation","modelling-framework","operations-research","optimization","scheduling-algorithms"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PetterS.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-08-30T20:03:14.000Z","updated_at":"2025-03-31T06:23:17.000Z","dependencies_parsed_at":"2025-03-01T20:49:49.734Z","dependency_job_id":null,"html_url":"https://github.com/PetterS/monolith","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/PetterS/monolith","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PetterS%2Fmonolith","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PetterS%2Fmonolith/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PetterS%2Fmonolith/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PetterS%2Fmonolith/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PetterS","download_url":"https://codeload.github.com/PetterS/monolith/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PetterS%2Fmonolith/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264505769,"owners_count":23618968,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["column-generation","modelling-framework","operations-research","optimization","scheduling-algorithms"],"created_at":"2025-03-01T20:36:58.244Z","updated_at":"2025-07-10T00:07:01.874Z","avatar_url":"https://github.com/PetterS.png","language":"Jupyter Notebook","readme":"# Monolith\nMonolith is a monorepo with several optimization projects. Some of the code was originally written for research or as hobby projects in other repositories (e.g. [spii](https://github.com/PetterS/spii) and [easy-IP](https://github.com/PetterS/easy-IP)).\n\nOne of the highlights is a state-of-the-art scheduler using column generation, which significantly outperforms all other optimizers at [schedulingbenchmarks.org](http://www.schedulingbenchmarks.org/). **Try it in the browser (wasm) [here](https://www.strandmark.net/wasm/shift_scheduling_colgen_page.html)!**\n\n\n## Why a monorepo?\n - C++ does not have an ABI. Every compiler, or worse, every flag configuration of every compiler generates potentially incompatible code. I want to use many compilers (MCVC, GCC, Clang) and many settings (debug, release, asan, fuzzers etc.). I also use Emscripten to compile programs to WASM (example [here](https://www.strandmark.net/wasm/glpk.html)).\n- Refactoring code becomes much easier if all code with all dependencies is available in one IDE at the same time.\n \n## Contact\nPetter Strandmark, petter.strandmark@gmail.com\n\n## Modules\n\n### Column generation\nImplements the algorithm described in [_First-order Linear Programming in a Column Generation-Based Heuristic Approach to the Nurse Rostering Problem_](https://www.strandmark.net/papers/first-order-scheduling.pdf) (2020) [doi link](https://doi.org/10.1016/j.cor.2020.104945).\n\nThe `minimum::linear::colgen` module contains code for solving scheduling problems. It significantly outperforms all other optimizers at [schedulingbenchmarks.org](http://www.schedulingbenchmarks.org/).\n\nSome of the reasons it is fast:\n- It uses a first-order LP solver based on papers by Chambolle and Pock.\n- The [Ryan-Foster rule](https://strandmark.wordpress.com/2018/01/24/visualizing-the-ryan-foster-rule/) is used to iteratively work towards an integer solution. There is no time to branch and bound for big problems.\n- The pricing problem uses highly optimized dynamic programming in a DAG (in `minimum::algorithms`).\n\nSee the [README in the module itself](minimum/linear/colgen/README.md) for more info.\n\n### Minimum/AI\nThe `minimum::ai` module contains code originally from my [Monte-Carlo tree search](https://github.com/PetterS/monte-carlo-tree-search) repository. It is very fast – some years ago it evaluated almost 2 million *complete* games per second when playing 4 in a row.\n\n### Minimum/Linear\nThe `minimum::linear` module contains code originally from my [easy-IP](https://github.com/PetterS/easy-IP) repository. It is a modelling interface (DSL) for integer programming and supports converting IPs to SAT. It also uses two free solvers: Cbc and Glpk.\n\n`minimum::linear` also contains an implementation of a first-order LP solver based on papers by Chambolle and Pock. Using a first-order LP solver is very important when solving really big scheduling problems.\n\n### Minimum/Nonlinear\nThe `minimum::nonlinear` module contains code originally from my [spii](https://github.com/PetterS/spii) repository. When a function is defined, it will be automatically differentiated with an autodiff library. This makes the resulting code very fast and numerically stable. The library contains minimization routines like L-BFGS and Newton’s method.\n\nFor example, a function of one vector variable is simply defined as:\n```\nauto lambda = [](auto* x) {\n    auto d0 = x[1] - x[0] * x[0];\n    auto d1 = 1 - x[0];\n    return 100 * d0 * d0 + d1 * d1;\n};\n```\nHaving `auto` here instead of e.g. `double` is crucial. Efficient code for first and second-order derivatives is generated with\n\n```\nauto term = make_differentiable\u003c2\u003e(lambda);\n```\n\n### Minimum/Constrained\nUsing both `minimum::linear` and `minimum::nonlinear`, this module implements constrained optimization via successive linear programming.\n\n### Minimum/Curvature\nThe module `minimum::curvature` contains code originally written at [curve_extraction](https://github.com/PetterS/curve_extraction). It computes shortest paths in regular graphs taking curvature into account.\n\n## Building\nEverything needed to build the library is included. With CMake and a modern C++ compiler, you can do\n\n    $ cmake /path/to/source\n    $ make\n\n## Licence\nThe license can be found in the `LICENSE` file. Contact me if you need another license.\n\nThe software in the `third-party` folder is not written exclusively by me and their respective license files apply.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpetters%2Fmonolith","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpetters%2Fmonolith","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpetters%2Fmonolith/lists"}