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

Uploaded Source

Built Distribution

gilp-0.0.1rc3-py3-none-any.whl (16.2 kB view hashes)

Uploaded Python 3

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