Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gilp-0.0.1rc4.tar.gz (15.8 kB view details)

Uploaded Source

Built Distribution

gilp-0.0.1rc4-py3-none-any.whl (16.2 kB view details)

Uploaded Python 3

File details

Details for the file gilp-0.0.1rc4.tar.gz.

File metadata

  • Download URL: gilp-0.0.1rc4.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

Hashes for gilp-0.0.1rc4.tar.gz
Algorithm Hash digest
SHA256 223a3dbf49d489c04317467d0e3b7677c8ace5b753d765c1e7824340373eaf07
MD5 4620f844808ab0dd52f082a597950ee9
BLAKE2b-256 62741b7c2a8c948b96b20ac75aa4adaeb6f7132c3dc2b1e20ef2e32b130346b0

See more details on using hashes here.

File details

Details for the file gilp-0.0.1rc4-py3-none-any.whl.

File metadata

  • Download URL: gilp-0.0.1rc4-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

Hashes for gilp-0.0.1rc4-py3-none-any.whl
Algorithm Hash digest
SHA256 feee50e8e6308c62077d171e1ef511e342be0ea870e6b13a38afe6d8a2fd611d
MD5 de464a2998b9116f48b90375917f7938
BLAKE2b-256 7f70a472fe2f46a777c3d9dd2fc3e663eebecefc5f3ac31b1e84560fccaf3956

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page