{"id":26157195,"url":"https://github.com/fdabrandao/vpsolver","last_synced_at":"2025-04-13T08:40:36.833Z","repository":{"id":12178935,"uuid":"14779007","full_name":"fdabrandao/vpsolver","owner":"fdabrandao","description":"Arc-flow Vector Packing Solver (VPSolver)","archived":false,"fork":false,"pushed_at":"2023-05-03T16:04:10.000Z","size":10736,"stargazers_count":103,"open_issues_count":8,"forks_count":26,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-27T00:13:32.540Z","etag":null,"topics":["arc-flow-formulation","bin-packing","c-plus-plus","cutting-stock","graph-compression","optimization","python","vector-packing"],"latest_commit_sha":null,"homepage":"http://vpsolver.fdabrandao.pt","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fdabrandao.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2013-11-28T14:27:08.000Z","updated_at":"2025-02-04T16:50:28.000Z","dependencies_parsed_at":"2024-06-21T16:34:00.131Z","dependency_job_id":"71a14033-85a5-4a51-b4c2-3f70bfa1bbfa","html_url":"https://github.com/fdabrandao/vpsolver","commit_stats":{"total_commits":539,"total_committers":2,"mean_commits":269.5,"dds":"0.011131725417439675","last_synced_commit":"f39075bda5a5433e1ff5cd2343600bdfd3c2501f"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fdabrandao%2Fvpsolver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fdabrandao%2Fvpsolver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fdabrandao%2Fvpsolver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fdabrandao%2Fvpsolver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fdabrandao","download_url":"https://codeload.github.com/fdabrandao/vpsolver/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248685935,"owners_count":21145386,"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":["arc-flow-formulation","bin-packing","c-plus-plus","cutting-stock","graph-compression","optimization","python","vector-packing"],"created_at":"2025-03-11T09:57:11.270Z","updated_at":"2025-04-13T08:40:36.812Z","avatar_url":"https://github.com/fdabrandao.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Arc-flow Vector Packing Solver (VPSolver)\n\nCopyright (C) 2013-2022, Filipe Brandão \u003cfdabrandao@gmail.com\u003e\n\n---\n[VPSolver](https://github.com/fdabrandao/vpsolver) is a multiple-choice vector packing solver based on an arc-flow formulation with graph compression (see, e.g., [\\[1\\]](#references)). VPSolver generates very strong models (equivalent to Gilmore and Gomory's) that can be solved using general-purpose mixed-integer programming\nsolvers such as Gurobi and GLPK (see, e.g., [\\[2\\]](#references) and [\\[3\\]](#references)). VPSolver does not explicitly require any MIP solver in particular, though a good  MIP solver may be necessary for solving large models.\n\n![](https://img.shields.io/badge/License-BSD_3--Clause-blue.svg)\n[![Build Status](https://dev.azure.com/fdabrandao0236/vpsolver/_apis/build/status/fdabrandao.vpsolver?branchName=master)](https://dev.azure.com/fdabrandao0236/vpsolver/_build/latest?definitionId=1\u0026branchName=master)\n\nFor modelling other problems easily, VPSolver includes a [Python API](https://github.com/fdabrandao/vpsolver/wiki/Python-API), a modelling toolbox ([PyMPL](https://github.com/fdabrandao/pympl/)), and a [Web App](#vpsolver-web-app). VPSolver has been successfully compiled and run on Linux, macOS, and Windows. VPSolver can also be used in [Docker containers](#docker).\n\nFor more details, please refer to the [project wiki](https://github.com/fdabrandao/vpsolver/wiki) or to the [manual](https://github.com/fdabrandao/vpsolver/tree/master/docs/vpsolver_manual.pdf).\n\n#### Repositories\n* Project Homepage: \u003chttp://vpsolver.fdabrandao.pt\u003e\n* GiHub repository: \u003chttps://github.com/fdabrandao/vpsolver\u003e\n* BitBucket repository: \u003chttps://bitbucket.org/fdabrandao/vpsolver\u003e\n* Docker repository: \u003chttps://hub.docker.com/r/fdabrandao/vpsolver\u003e\n* PyPI repository: \u003chttps://pypi.python.org/pypi/pyvpsolver\u003e\n\n## Requirements\n#### Mandatory\n\n- To use vpsolver scripts for various solvers:\n  * MIP solver: Gurobi, CPLEX, GLPK, COIN-OR, SCIP, lp_solve, ...\n  * UNIX-like operating system or a UNIX-like environment such as [Cygwin](https://www.cygwin.com/) on Windows\n  * `g++`, `clang`, or `Visual Studio`; `cmake \u003e= 3.3`; `bash \u003e= 3.0`\n\n- To build the vpsolver executable linked to Gurobi:\n  * `gurobi`\n  * `cmake \u003e= 3.3`\n\n#### Optional\nFor the [Python API](https://github.com/fdabrandao/vpsolver/wiki/Python-API) and Web App:\n\n* `python-2.7` or `python-3.x`\n* `python-pip`\n* `python-dev`\n* `glpk-utils`\n \n#### Platforms\nIt has been successfully compiled and run on the following platforms:\n\n* **Linux**\n* **macOS**\n* **Windows** (note that vpsolver scripts require bash)\n\n## Setup\nWithout the python interface: \n\n```bash\n$ mkdir build\n$ cd build/\n$ cmake ..\n$ cmake --build . --config Release\n```\nNote: In order to compile the components that require Gurobi, you need to have set the environment variable `GUROBI_HOME` or specify the location of the Gurobi installation in the third step:\n- Linux: `cmake .. -DGUROBI_DIR=/opt/gurobi952/linux64/`\n- macOS: `cmake .. -DGUROBI_DIR=/Library/gurobi952/macos_universal2/`\n- Windows: `cmake .. -DGUROBI_DIR=C:\\\\gurobi952\\\\win64`\n\nWith the python interface: \n\n```\n$ pip install -r requirements.txt\n$ pip install . --upgrade\n$ cd examples; py.test -v --cov pyvpsolver\n```\nOr simply install from the [repository](https://pypi.python.org/pypi/pyvpsolver):\n\n```\n$ pip install pyvpsolver\n```\n\n## Python interface\n\nThe python interface is fully compatible with both python 2 and 3. \n\nJupyter Notebooks for a quick introduction:\n\n* [Simple VBP example](https://github.com/fdabrandao/vpsolver/blob/master/examples/notebooks/example_vbp.ipynb)\n* [Simple MVP example](https://github.com/fdabrandao/vpsolver/blob/master/examples/notebooks/example_mvp.ipynb)\n\n## Docker\n\n### Docker Setup\n\nDocker is an open platform for building, shipping and running applications. Docker allows VPSolver to run on a large variety of platforms with very little effort.\n\nInstall Docker [[Docker installation instructions](https://docs.docker.com/installation/)].\n\nOption 1: simply `pull` VPSolver from Docker repository (without building):\n\n```bash\n$ docker pull fdabrandao/vpsolver\n```\n\nOption 2: `clone` VPSolver and `build` locally:\n\n```bash \n$ git clone https://github.com/fdabrandao/vpsolver.git vpsolver\n$ docker build -t fdabrandao/vpsolver vpsolver\n```\n\n### Usage\nDirectly using the command line interface:\n\n```bash\n$ docker run --rm -it fdabrandao/vpsolver bash\nroot@55d14f6b6f32:~# source venv2.7/bin/activate # load a virtualenv\n(venv2.7)root@55d14f6b6f32:~# python examples/vpsolver/example_vbp.py\n...\n```\n\nor through the VPSolver Web App (example URL: `http://172.17.0.60:5555/`):\n\n```bash\n$ docker run --rm -it -p 5555 fdabrandao/vpsolver \neth0      Link encap:Ethernet  HWaddr 02:42:ac:11:00:3c  \n          inet addr:172.17.0.60  Bcast:0.0.0.0  Mask:255.255.0.0\n          inet6 addr: fe80::42:acff:fe11:3c/64 Scope:Link\n          UP BROADCAST  MTU:1500  Metric:1\n          RX packets:2 errors:0 dropped:0 overruns:0 frame:0\n          TX packets:2 errors:0 dropped:0 overruns:0 carrier:0\n          collisions:0 txqueuelen:0 \n          RX bytes:168 (168.0 B)  TX bytes:180 (180.0 B)\n\nURL: http://172.17.0.60:5555/\n * Running on http://0.0.0.0:5555/\n...\n```\n\nFor more details, please refer to the [project wiki](https://github.com/fdabrandao/vpsolver/wiki/docker).\n\n## VPSolver binaries\n\n* `$ bin/vpsolver intance.vbp/.mvp`: solves a multiple-choice vector packing instance using the method described in [\\[1\\]](#references). Note: requires Gurobi 5.0.0 or superior;\n* `$ bin/vbp2afg instance.vbp/.mvp graph.afg`: builds an arc-flow graph `graph.afg` for `instance.vbp/.mvp`;\n* `$ bin/afg2mps graph.afg model.mps`: creates a MPS model `model.mps` for `graph.afg`;\n* `$ bin/afg2lp graph.afg model.lp`: creates a LP model `model.lp` for `graph.afg`;\n* `$ bin/vbpsol graph.afg vars.sol`: extracts a vector packing solution from an arc-flow solution `vars.sol` associated with the graph `graph.afg`.\n\nUsage:\n\n```\n# 1. Build the arc-flow graph graph.afg for example.vbp:  \n$ bin/vbp2afg example.vbp graph.afg  \n# 2. Convert the arc-flow graph into a .mps file model.mps:  \n$ bin/afg2mps graph.afg model.mps  \n# 3. Solve the MIP model and store the solution in vars.sol:\n$ scritps/vpsolver_gurobi.sh --mps model.mps --wsol vars.sol\n# 4. Extract the vector packing solution:  \n$ bin/vbpsol graph.afg vars.sol  \n```\n\nFor more details, please refer to the [manual](https://github.com/fdabrandao/vpsolver/tree/master/docs/vpsolver_manual.pdf).\n\n## VPSolver Scripts\nVPSolver includes several scripts for solving arc-flow models using different\nsolvers:\n\n* `scripts/vpsolver_gurobi.sh`: Gurobi\n* `scripts/vpsolver_cplex.sh`: IBM CPLEX\n* `scripts/vpsolver_coinor.sh`: COIN-OR CBC\n* `scripts/vpsolver_glpk.sh`: GLPK\n* `scripts/vpsolver_scip.sh`: SCIP\n* `scripts/vpsolver_lpsolve.sh`: lp_solve\n\nUsage:\n\n```bash\n$ vpsolver_X.sh --vbp/--mvp instance.vbp/.mvp\n$ vpsolver_X.sh --afg graph.afg\n$ vpsolver_X.sh --mps/--lp model.mps/.lp\n$ vpsolver_X.sh --mps/--lp model.mps/.lp --afg graph.afg\n```\n\nFor more details, please refer to the [manual](https://github.com/fdabrandao/vpsolver/tree/master/docs/vpsolver_manual.pdf).\n\n## Folders\n\n* [docs](https://github.com/fdabrandao/vpsolver/tree/develop/docs): documentation\n* [scripts](https://github.com/fdabrandao/vpsolver/tree/develop/scripts): vpsolver scripts\n* [src](https://github.com/fdabrandao/vpsolver/tree/develop/src): vpsolver source code in C++\n* [pyvpsolver](https://github.com/fdabrandao/vpsolver/tree/develop/pyvpsolver): pyvpsolver source code in Python\n* [examples](https://github.com/fdabrandao/vpsolver/tree/develop/examples): vpsolver and pyvpsolver examples\n* [examples/notebooks](https://github.com/fdabrandao/vpsolver/tree/develop/examples/notebooks/): jupyter notebooks\n* [docs/reports](https://github.com/fdabrandao/vpsolver/tree/develop/examples/docs/reports/): technical reports on the underlying algorithms and models\n\n## References\n\nThe current solution method is described in:\n\n* [1] Brandão, F. (2016). _VPSolver 3: Multiple-choice Vector Packing Solver._ [arXiv:1602.04876](http://arxiv.org/abs/1602.04876).\n\nVPSolver was proposed in:\n\n* [2] Brandão, F. and Pedroso, J. P. (2016). _Bin packing and related problems: General arc-flow formulation with graph compression._\nComputers \u0026 Operations Research, 69:56 – 67.  \ndoi: [http://dx.doi.org/10.1016/j.cor.2015.11.009](http://dx.doi.org/10.1016/j.cor.2015.11.009).\n\n* [3] Brandão, F. and Pedroso, J. P. (2013). _Bin Packing and Related Problems:\nGeneral Arc-flow Formulation with Graph Compression._ Technical Report\nDCC-2013-08, Faculdade de Ciências da Universidade do Porto, Universidade do\nPorto, Portugal. [arXiv:1310.6887](http://arxiv.org/abs/1310.6887).\n\nSee also:\n\n* [4] Brandão, F. and Pedroso, J. P. (2013). _Multiple-choice Vector Bin Packing:\nArc-flow Formulation with Graph Compression._ Technical Report DCC-2013-13,\nFaculdade de Ciências da Universidade do Porto, Universidade do Porto, Portugal. [arXiv:1312.3836](http://arxiv.org/abs/1312.3836)\n\n* [5] Brandão, F. and Pedroso, J. P. (2013). _Cutting Stock with Binary Patterns:\nArc-flow Formulation with Graph Compression._ Technical Report DCC-2013-09,\nFaculdade de Ciências da Universidade do Porto, Universidade do Porto, Portugal. [arXiv:1502.02899](http://arxiv.org/abs/1502.02899).\n\n* [6] Brandão, F. (2012). _Bin Packing and Related Problems: Pattern-Based Approaches._ \nMaster’s thesis, Faculdade de Ciências da Universidade do Porto, Portugal.\n\n* [7] Computational results on several benchmark test data sets:  \nhttps://research.fdabrandao.pt/research/vpsolver/results/\n\n\n***\nCopyright © 2013-2022 [Filipe Brandão](https://fdabrandao.pt) \u003c [fdabrandao@gmail.com](mailto:fdabrandao@gmail.com) \u003e. All rights reserved.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffdabrandao%2Fvpsolver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffdabrandao%2Fvpsolver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffdabrandao%2Fvpsolver/lists"}