elpee


Nameelpee JSON
Version 0.4.1 PyPI version JSON
download
home_pagehttps://github.com/navindu-ds/elpee
SummarySolving linear programming problems step-by-step
upload_time2024-06-20 12:15:47
maintainerNone
docs_urlNone
authorNavindu De Silva
requires_python<4.0,>=3.9
licenseApache-2.0
keywords optimization linear programming operational research
VCS
bugtrack_url
requirements pyyaml sympy
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <img src="https://github.com/navindu-ds/elpee/assets/114894532/81c9a74a-435d-4dd7-bef4-e9d88708cffb">

# Elpee

[![PyPI Latest Release](https://img.shields.io/pypi/v/elpee.svg)](https://pypi.org/project/elpee/)  ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/elpee) [![PyPI Downloads](https://img.shields.io/pypi/dm/elpee.svg?label=PyPI%20downloads)](https://pypi.org/project/elpee/) [![License - Apache-2.0](https://img.shields.io/pypi/l/elpee.svg)](https://github.com/navindu-ds/elpee/blob/main/LICENSE) [![ReadtheDocs](https://img.shields.io/readthedocs/elpee)](https://elpee.readthedocs.io/) ![Libraries.io dependency status for latest release](https://img.shields.io/librariesio/release/pypi/elpee)


*Solving linear programming problems one step at a time.*

Elpee (short for **L** inear **P** rogramming) is a Python library for students and academics to viusalize the steps and iterations required to solve constrained linear optimization problems using linear programming methods.

## Documentation

Follow the documentation to get the best use of [elpee](https://elpee.readthedocs.io/).

## Install
To use elpee Python library, install it using [pip](https://pypi.org/project/elpee/):
```
(.venv) $ pip install elpee
```

## Example Problem
Define the Linear Programming Problem to be solved using the All Stack Starting Method by defining the Objective Function and the Constraint Expressions.
```
from elpee import LinearProblem

# set up a maximization problem
problem = LinearProblem(is_maximization=True)

# define the objective function
problem.add_objective('x + y')

# add the constraints to the problem
problem.add_constraint('-x + y <= 2')
problem.add_constraint('6*x + 4*y >= 24')
problem.add_constraint('y >= 1')
```

Add additional configurations to apply Big-M or Dual Simplex Method
```
problem.use_dual_simplex() # use to configure problem to use dual simplex method
problem.use_bigM() # use to configure problem to use big M method
```

Apply the Solver to solve the Linear Problem. The iterations to produce the results will be printed on the command line.
```
from elpee import ElpeeSolver

solution = ElpeeSolver.solve(problem)
```
Sample Output will be as follows (using dual_simplex).
```
...Generating Initial Feasible Solution for
     MIN           x            y            S1           S2           S3          Sol
      P           -1.0         -1.0          0            0            0            0
      S1          -1.0         1.0           1            0            0           2.0
      S2          -6.0         -4.0          0            1            0          -24.0
      S3           0           -1.0          0            0            1           -1.0
===========================================================================================

Taking S2 = 0; Entering x as a new basic variable;

...Generating Initial Feasible Solution for
     MIN           x            y            S1           S2           S3          Sol
      P           0.0         -0.333        0.0         -0.167        0.0          4.0
      S1          0.0         1.667         1.0         -0.167        0.0          6.0
      x           1.0         0.667         -0.0        -0.167        -0.0         4.0
      S3           0           -1.0          0            0            1           -1.0
===========================================================================================

Taking S3 = 0; Entering y as a new basic variable;

Feasible Solution # 1
     MIN           x            y            S1           S2           S3          Sol
      P           0.0          0.0          0.0         -0.167       -0.333       4.333
      S1          0.0          0.0          1.0         -0.167       1.667        4.333
      x           1.0          0.0          0.0         -0.167       0.667        3.333
      y           -0.0         1.0          -0.0         -0.0         -1.0         1.0
===========================================================================================

Optimized Solution Received!
```
And obtain an interpretation to the solution
```
Minimum Value for Objective Function = 4.333

Values for Decision Variables :
      x       = 3.333
      y       = 1.0

Surplus & Slack variables
  Constraint #1 Surplus    = 4.333 units
  Constraint #2 Surplus    : Satisfied at Boundary
  Constraint #3 Surplus    : Satisfied at Boundary
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/navindu-ds/elpee",
    "name": "elpee",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.9",
    "maintainer_email": null,
    "keywords": "optimization, linear programming, operational research",
    "author": "Navindu De Silva",
    "author_email": "navinduydds@gmail.com ",
    "download_url": "https://files.pythonhosted.org/packages/df/7f/0187044e8ac78dce7fd0854d49497cbc46078b089e87585a9f770be923a9/elpee-0.4.1.tar.gz",
    "platform": null,
    "description": "<img src=\"https://github.com/navindu-ds/elpee/assets/114894532/81c9a74a-435d-4dd7-bef4-e9d88708cffb\">\n\n# Elpee\n\n[![PyPI Latest Release](https://img.shields.io/pypi/v/elpee.svg)](https://pypi.org/project/elpee/)  ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/elpee) [![PyPI Downloads](https://img.shields.io/pypi/dm/elpee.svg?label=PyPI%20downloads)](https://pypi.org/project/elpee/) [![License - Apache-2.0](https://img.shields.io/pypi/l/elpee.svg)](https://github.com/navindu-ds/elpee/blob/main/LICENSE) [![ReadtheDocs](https://img.shields.io/readthedocs/elpee)](https://elpee.readthedocs.io/) ![Libraries.io dependency status for latest release](https://img.shields.io/librariesio/release/pypi/elpee)\n\n\n*Solving linear programming problems one step at a time.*\n\nElpee (short for **L** inear **P** rogramming) is a Python library for students and academics to viusalize the steps and iterations required to solve constrained linear optimization problems using linear programming methods.\n\n## Documentation\n\nFollow the documentation to get the best use of [elpee](https://elpee.readthedocs.io/).\n\n## Install\nTo use elpee Python library, install it using [pip](https://pypi.org/project/elpee/):\n```\n(.venv) $ pip install elpee\n```\n\n## Example Problem\nDefine the Linear Programming Problem to be solved using the All Stack Starting Method by defining the Objective Function and the Constraint Expressions.\n```\nfrom elpee import LinearProblem\n\n# set up a maximization problem\nproblem = LinearProblem(is_maximization=True)\n\n# define the objective function\nproblem.add_objective('x + y')\n\n# add the constraints to the problem\nproblem.add_constraint('-x + y <= 2')\nproblem.add_constraint('6*x + 4*y >= 24')\nproblem.add_constraint('y >= 1')\n```\n\nAdd additional configurations to apply Big-M or Dual Simplex Method\n```\nproblem.use_dual_simplex() # use to configure problem to use dual simplex method\nproblem.use_bigM() # use to configure problem to use big M method\n```\n\nApply the Solver to solve the Linear Problem. The iterations to produce the results will be printed on the command line.\n```\nfrom elpee import ElpeeSolver\n\nsolution = ElpeeSolver.solve(problem)\n```\nSample Output will be as follows (using dual_simplex).\n```\n...Generating Initial Feasible Solution for\n     MIN           x            y            S1           S2           S3          Sol\n      P           -1.0         -1.0          0            0            0            0\n      S1          -1.0         1.0           1            0            0           2.0\n      S2          -6.0         -4.0          0            1            0          -24.0\n      S3           0           -1.0          0            0            1           -1.0\n===========================================================================================\n\nTaking S2 = 0; Entering x as a new basic variable;\n\n...Generating Initial Feasible Solution for\n     MIN           x            y            S1           S2           S3          Sol\n      P           0.0         -0.333        0.0         -0.167        0.0          4.0\n      S1          0.0         1.667         1.0         -0.167        0.0          6.0\n      x           1.0         0.667         -0.0        -0.167        -0.0         4.0\n      S3           0           -1.0          0            0            1           -1.0\n===========================================================================================\n\nTaking S3 = 0; Entering y as a new basic variable;\n\nFeasible Solution # 1\n     MIN           x            y            S1           S2           S3          Sol\n      P           0.0          0.0          0.0         -0.167       -0.333       4.333\n      S1          0.0          0.0          1.0         -0.167       1.667        4.333\n      x           1.0          0.0          0.0         -0.167       0.667        3.333\n      y           -0.0         1.0          -0.0         -0.0         -1.0         1.0\n===========================================================================================\n\nOptimized Solution Received!\n```\nAnd obtain an interpretation to the solution\n```\nMinimum Value for Objective Function = 4.333\n\nValues for Decision Variables :\n      x       = 3.333\n      y       = 1.0\n\nSurplus & Slack variables\n  Constraint #1 Surplus    = 4.333 units\n  Constraint #2 Surplus    : Satisfied at Boundary\n  Constraint #3 Surplus    : Satisfied at Boundary\n```\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "Solving linear programming problems step-by-step",
    "version": "0.4.1",
    "project_urls": {
        "Documentation": "https://elpee.readthedocs.io/",
        "Homepage": "https://github.com/navindu-ds/elpee",
        "Repository": "https://github.com/navindu-ds/elpee"
    },
    "split_keywords": [
        "optimization",
        " linear programming",
        " operational research"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4bc816bcdd5006c09233373e777e626593f2769b6677be570603ad1ac32c5e09",
                "md5": "e60fc0d16ee74cdd3e5f8398389087d1",
                "sha256": "ae7a033dd803568f25d108484f83787730e630127d4e28c4e1e9608c2635acd8"
            },
            "downloads": -1,
            "filename": "elpee-0.4.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e60fc0d16ee74cdd3e5f8398389087d1",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.9",
            "size": 35924,
            "upload_time": "2024-06-20T12:15:44",
            "upload_time_iso_8601": "2024-06-20T12:15:44.831418Z",
            "url": "https://files.pythonhosted.org/packages/4b/c8/16bcdd5006c09233373e777e626593f2769b6677be570603ad1ac32c5e09/elpee-0.4.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "df7f0187044e8ac78dce7fd0854d49497cbc46078b089e87585a9f770be923a9",
                "md5": "57213956f8acb86926388cc4d0b42688",
                "sha256": "0f501c95b3ea0312725abae06ddf8b8e370a3adca58386c60c57a9ffd9f0f0ec"
            },
            "downloads": -1,
            "filename": "elpee-0.4.1.tar.gz",
            "has_sig": false,
            "md5_digest": "57213956f8acb86926388cc4d0b42688",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.9",
            "size": 70302,
            "upload_time": "2024-06-20T12:15:47",
            "upload_time_iso_8601": "2024-06-20T12:15:47.709524Z",
            "url": "https://files.pythonhosted.org/packages/df/7f/0187044e8ac78dce7fd0854d49497cbc46078b089e87585a9f770be923a9/elpee-0.4.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-20 12:15:47",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "navindu-ds",
    "github_project": "elpee",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [
        {
            "name": "pyyaml",
            "specs": [
                [
                    "==",
                    "6.0.1"
                ]
            ]
        },
        {
            "name": "sympy",
            "specs": [
                [
                    "==",
                    "1.12.1"
                ]
            ]
        }
    ],
    "lcname": "elpee"
}
        
Elapsed time: 0.35052s