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
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.