{"id":27870663,"url":"https://github.com/nariaki3551/ppulp","last_synced_at":"2025-10-07T23:09:29.639Z","repository":{"id":154192157,"uuid":"538301070","full_name":"nariaki3551/ppulp","owner":"nariaki3551","description":"An extension PuLP, linear programming modeling tool","archived":false,"fork":false,"pushed_at":"2024-04-21T12:31:14.000Z","size":33,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-10T03:13:01.588Z","etag":null,"topics":["constraints","mip","optimization","pulp","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nariaki3551.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,"zenodo":null}},"created_at":"2022-09-19T02:13:05.000Z","updated_at":"2024-04-21T12:27:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"c638609f-abad-4d70-9977-c523b91a217e","html_url":"https://github.com/nariaki3551/ppulp","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/nariaki3551/ppulp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nariaki3551%2Fppulp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nariaki3551%2Fppulp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nariaki3551%2Fppulp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nariaki3551%2Fppulp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nariaki3551","download_url":"https://codeload.github.com/nariaki3551/ppulp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nariaki3551%2Fppulp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273077227,"owners_count":25041358,"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","status":"online","status_checked_at":"2025-09-01T02:00:09.058Z","response_time":120,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["constraints","mip","optimization","pulp","python","solver"],"created_at":"2025-05-04T23:24:00.843Z","updated_at":"2025-10-07T23:09:24.576Z","avatar_url":"https://github.com/nariaki3551.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ppulp\n\nP(retty)PuLP is an extension of PuLP, linear programming problem modeling tool using [flopt](https://github.com/nariaki3551/flopt).\nYou can use the basic features of pulp and the following useful extensions to make modeling simpler.\n\n[document](https://ppulp.readthedocs.io/en/latest/)\n\n[![Documentation Status](https://readthedocs.org/projects/ppulp/badge/?version=latest)](https://ppulp.readthedocs.io/en/latest/?badge=latest)\n[![PyPI version](https://badge.fury.io/py/ppulp.svg)](https://badge.fury.io/py/ppulp)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n\n\u003cbr\u003e\n\n## Install\n\n**PyPI**\n\n```\npip install ppulp\n```\n\n**GitHub**\n\n```\ngit clone https://github.com/nariaki3551/ppulp.git\n```\n\n\u003cbr\u003e\n\n## Features\n\n- Variable product\n- If-then constraints\n- Absolute values\n- Piecewise linear approximation of nonlinear functions\n- Logical operations (And, Or, Xor)\n- Reduction (Sum, Prod)\n\n\n## Examples\n\n### Variables productions\n\n```python\n# from pulp import *\nfrom ppulp import *\n\n# create variables\nx = LpVariable(\"x\", cat=\"Binary\")\ny = LpVariable(\"y\", cat=\"Binary\")\n\n# create variable production\nz = x * y\n```\n\n### If-then constriant\n\n```python\nfrom ppulp import *\n\nx = LpVariable(\"x\", lowBound=-1)\ny = LpVariable(\"y\", lowBound=-1)\n\nprob = LpProblem(sense=\"Minimize\")\n\n# add if-then constraints\nprob += (x \u003c= 0) \u003e\u003e (y \u003e= 0)  # if (x \u003c= 0) then (y \u003e= 0)\nprob += (y \u003c= 0) \u003e\u003e (x \u003e= 0)  # if (y \u003c= 0) then (x \u003e= 0)\n```\n\n### Absolution value\n\n```python\nx = LpVariable(\"x\")\ny = LpVariable(\"y\")\nAbs(x+y)\n```\n\n### Approximation of nonlinear functions\n\n```python\nfrom ppulp import *\nimport math\n\nx = LpVariable(\"x\", lowBound=3)\ny = LpVariable(\"y\", lowBound=4)\n\n# create non-linear function\nf = PiecewiseLinear(math.log, xl=7, xu=100, num=3)\n\nprob = LpProblem()\nprob += f(x + y)\nprob += f(x) \u003e= 10\n```\n\n\n### Reduction\n\n```python\nfrom ppulp import *\n\nx = [LpVariable(name=f\"x{i}\", ini_value=2) for i in range(5)]\n\n# summation\nlpSum(x)\n\n# production\nlpProd(x)\n```\n\n## Learning more\n\n[document](https://ppulp.readthedocs.io/en/latest/)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnariaki3551%2Fppulp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnariaki3551%2Fppulp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnariaki3551%2Fppulp/lists"}