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.1rc5.tar.gz (15.8 kB view details)

Uploaded Source

Built Distribution

gilp-0.0.1rc5-py3-none-any.whl (16.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: gilp-0.0.1rc5.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.1rc5.tar.gz
Algorithm Hash digest
SHA256 147431b903923a63574607686b74b26c4e06beda30c0d4691fcbe161bd184bce
MD5 e4ebc1b7a433b8678c99870e4f2956ba
BLAKE2b-256 87f61713a45dd85e2243627efc0220f58963a009f851a39532d3b91145ee4f01

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gilp-0.0.1rc5-py3-none-any.whl
  • Upload date:
  • Size: 16.1 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.1rc5-py3-none-any.whl
Algorithm Hash digest
SHA256 85b7597629e4e60252ce709accb36131695056e7b3e839d85179f40ccb696139
MD5 ce9dfaa04bd9b9bc4359961b2a0303da
BLAKE2b-256 29127d74d69343128d523c0515ab1918cd7702bbcb2198bd40e23aafa14a5c07

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