{"id":16693471,"url":"https://github.com/stephane-caron/lpsolvers","last_synced_at":"2025-03-17T00:33:28.085Z","repository":{"id":65640838,"uuid":"139556246","full_name":"stephane-caron/lpsolvers","owner":"stephane-caron","description":"Linear programming solvers in Python with a unified API","archived":false,"fork":false,"pushed_at":"2024-09-16T20:27:07.000Z","size":6418,"stargazers_count":23,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-10-13T16:31:11.290Z","etag":null,"topics":["linear-programming","numerical-optimization","python","solver"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stephane-caron.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":"2018-07-03T08:58:53.000Z","updated_at":"2024-09-16T20:25:19.000Z","dependencies_parsed_at":"2024-01-07T16:32:38.377Z","dependency_job_id":"828cb428-f6e5-4d24-b569-8751d78abc46","html_url":"https://github.com/stephane-caron/lpsolvers","commit_stats":{"total_commits":78,"total_committers":2,"mean_commits":39.0,"dds":"0.23076923076923073","last_synced_commit":"05ff147c1ca2f71f520f41d3cdd61fdfc3b89fc3"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephane-caron%2Flpsolvers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephane-caron%2Flpsolvers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephane-caron%2Flpsolvers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephane-caron%2Flpsolvers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stephane-caron","download_url":"https://codeload.github.com/stephane-caron/lpsolvers/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221669506,"owners_count":16860895,"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":["linear-programming","numerical-optimization","python","solver"],"created_at":"2024-10-12T16:30:44.942Z","updated_at":"2024-10-27T11:36:47.592Z","avatar_url":"https://github.com/stephane-caron.png","language":"Python","funding_links":[],"categories":["[Libraries](#awesome-robotics-libraries)"],"sub_categories":["[Optimization](#awesome-robotics-libraries)"],"readme":"# LP Solvers for Python\n\n[![CI](https://img.shields.io/github/actions/workflow/status/stephane-caron/lpsolvers/test.yml?branch=main)](https://github.com/stephane-caron/lpsolvers/actions)\n[![Documentation](https://img.shields.io/github/actions/workflow/status/stephane-caron/lpsolvers/docs.yml?branch=main\u0026label=docs)](https://stephane-caron.github.io/lpsolvers/)\n[![Coverage](https://coveralls.io/repos/github/stephane-caron/lpsolvers/badge.svg?branch=main)](https://coveralls.io/github/stephane-caron/lpsolvers?branch=main)\n[![Conda version](https://img.shields.io/conda/vn/conda-forge/lpsolvers.svg)](https://anaconda.org/conda-forge/lpsolvers)\n[![PyPI version](https://img.shields.io/pypi/v/lpsolvers)](https://pypi.org/project/lpsolvers/)\n\nWrapper around Linear Programming (LP) solvers in Python, with a unified interface.\n\n## Installation\n\n### From conda-forge\n\n```console\nconda install -c conda-forge lpsolvers\n```\n\n### From PyPI\n\nTo install the library and all available LP solvers at the same time:\n\n```console\npip install lpsolvers[open_source_solvers]\n```\n\nTo install the library only, assuming LP solvers are installed separately: ``pip install lpsolvers``.\n\n## Usage\n\nThe function [`solve_lp`](https://stephane-caron.github.io/lpsolvers//linear-programming.html#lpsolvers.solve_lp) is called with the ``solver`` keyword argument to select the backend solver. The linear program it solves is, in standard form:\n\n$$\n\\begin{split}\n\\begin{array}{ll}\n    \\mbox{minimize} \u0026\n        c^T x \\\\\n    \\mbox{subject to}\n        \u0026 G x \\leq h \\\\\n        \u0026 A x = b\n\\end{array}\n\\end{split}\n$$\n\nVector inequalities are taken coordinate by coordinate.\n\n## Example\n\nTo solve a linear program, build the matrices that define it and call the ``solve_lp`` function:\n\n```python\nfrom numpy import array\nfrom lpsolvers import solve_lp\n\nc = array([1., 2., 3.])\nG = array([[1., 2., -1.], [2., 0., 1.], [1., 2., 1.], [-1., -1., -1.]])\nh = array([4., 1., 3., 2.])\n\nx = solve_lp(c, G, h, solver=\"cvxopt\")  # select solver here\nprint(f\"LP solution: {x=}\")\n```\n\nThis example outputs the solution ``[2.2, -0.8, -3.4]``.\n\n## Solvers\n\nThe list of supported solvers currently includes:\n\n- [cdd](https://github.com/mcmtroffaes/pycddlib)\n- [CVXOPT](http://cvxopt.org/)\n- [CVXPY](https://www.cvxpy.org/) (interface)\n- [PDLP](https://developers.google.com/optimization/lp/pdlp_math)\n- [ProxQP](https://github.com/Simple-Robotics/proxsuite#proxqp)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstephane-caron%2Flpsolvers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstephane-caron%2Flpsolvers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstephane-caron%2Flpsolvers/lists"}