Skip to content

Commit 81f0ec7

Browse files
committed
Update docs
1 parent 44ae3dd commit 81f0ec7

File tree

2 files changed

+29
-9
lines changed

2 files changed

+29
-9
lines changed

README.md

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,35 @@
11
# SimpleTableaux
22

3-
Solve linear programming problems using the simplex method by pivoting
3+
This module can be used to show how to solve linear programming problems using the simplex method by pivoting
44
tableaux.
55

66
This is an illusration project for solving
77
feasible optimization problems of the form
8-
$\max c^t x$ subject to $Ax ≤ b$ and $x \ge 0$.
8+
$\max c^t x$ subject to $Ax ≤ b$ and $x \ge 0$.
99

10-
Here are some quick start instructions.
10+
## Caveats
11+
12+
As a demonstration project, this is not suitable for solving actual linear programming (LP) problems.
13+
At present it will fail if:
14+
* The LP is infeasible.
15+
* The LP is unbounded.
16+
* Other unidentified reasons.
17+
18+
It is also set up for maximization problems only. To solve a minimization problem use the dual LP by
19+
replacing the inputs `A`, `b`, and `c` with `A'`, `c`, and `b` respectively.
20+
21+
22+
23+
24+
# Quick Start Instructions
1125

1226
## Set up the problem
1327

1428
This example comes from [this video](https://www.youtube.com/watch?v=rzRZLGD_aeE).
1529

1630
Create the matrix `A`, the RHS vector `b`, and the objective function coefficients `c`:
1731
```
32+
julia> using SimpleTableaux
1833
julia> A = [3 5; 4 1];
1934
julia> b = [78; 36];
2035
julia> c = [5; 4];
@@ -36,7 +51,6 @@ Notice that the last row is the encoding of the objective function.
3651

3752
```
3853
julia> x = pivot_solve(T)
39-
Iteration 0
4054
3×6 DataFrame
4155
Row │ x1 x2 s1 s2 val RHS
4256
│ Exact Exact Exact Exact Exact Exact
@@ -45,7 +59,9 @@ Iteration 0
4559
2 │ 4 1 0 1 0 36
4660
3 │ -5 -4 0 0 1 0
4761
48-
Iteration 1
62+
63+
Pivot at (2,1)
64+
4965
3×6 DataFrame
5066
Row │ x1 x2 s1 s2 val RHS
5167
│ Exact Exact Exact Exact Exact Exact
@@ -54,7 +70,9 @@ Iteration 1
5470
2 │ 1 1/4 0 1/4 0 9
5571
3 │ 0 -11/4 0 5/4 1 45
5672
57-
Iteration 2
73+
74+
Pivot at (1,2)
75+
5876
3×6 DataFrame
5977
Row │ x1 x2 s1 s2 val RHS
6078
│ Exact Exact Exact Exact Exact Exact
@@ -63,7 +81,7 @@ Iteration 2
6381
2 │ 1 0 -1/17 5/17 0 6
6482
3 │ 0 0 11/17 13/17 1 78
6583
66-
Optimum value = 78
84+
Optimum value after 2 iterations = 78
6785
2-element Vector{Rational{BigInt}}:
6886
6
6987
12
@@ -86,11 +104,13 @@ julia> c' * x == 78
86104
true
87105
```
88106

89-
## Repeat using an LP solver (HiGHS)
107+
## Repeat using a proper LP solver
90108

91109
```
92110
julia> lp_solve(T)
93111
2-element Vector{Float64}:
94112
6.0
95113
12.0
96-
```
114+
```
115+
116+
The `lp_solve` function uses the [HiGHS](https://highs.dev/) solver.

0 commit comments

Comments
 (0)