A Python package for visualizing the geometry of linear programs.
Project description
GILP (Geometric Interpretation of Linear Programming)
Installation
The quickest way to start using gilp is with a pip install
pip install gilp
To develop and run tests, you will need to pip install with extra dependencies
pip install gilp[dev]
Example
The LP class creates linear programs from (3) numpy arrays: A, b, and c which define the LP in standard inequality form.
max c^Tx
s.t. Ax <= b
x >= 0
Consider the following input.
A = np.array([[1,0], [1, 2]])
b = np.array([[2],[4]])
c = np.array([[1],[1]])
lp = LP(A,b,c)
The corresponding LP is:
max 1x_1 + 1x_2
s.t 1x_1 + 0x_2 <= 2
1x_1 + 2x_2 <= 4
x_1, x_2 >= 0
To visualize the simplex algorithm on an LP, first create a plotly figure
and then use .show()
to open up an HTML file or .write_html()
to write an HTML file with a given name.
fig = simplex_visual(lp)
fig.show()
fig.write_html('example.html)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file gilp-0.0.1rc3.tar.gz
.
File metadata
- Download URL: gilp-0.0.1rc3.tar.gz
- Upload date:
- Size: 15.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/49.1.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.6.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3f15054ebd4d3c1d621fb58547251290fbdeb1b4448ee872cf83b8b58a1e4cf5 |
|
MD5 | 70c70d56e53257201009ed58db713b74 |
|
BLAKE2b-256 | 391eff2dc98c670e4e3c9e4eb1b7808ed231b16adae346f020885773475fb2df |
File details
Details for the file gilp-0.0.1rc3-py3-none-any.whl
.
File metadata
- Download URL: gilp-0.0.1rc3-py3-none-any.whl
- Upload date:
- Size: 16.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/49.1.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.6.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 237f36203f56291ea8c0b62dbfdaf045c9255250eb7f218bf177e7da150ec567 |
|
MD5 | b69821dd6f8beed896f67f4cf7974a24 |
|
BLAKE2b-256 | 4e2d80d69cc0526fde691c28c0627f26fa6e4fdaa6af09916482541db7147c80 |