Skip to content

Commit 74ece8f

Browse files
committed
first basis is automatic
1 parent 5cc49a6 commit 74ece8f

File tree

11 files changed

+29
-19
lines changed

11 files changed

+29
-19
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "SimplexTableaux"
22
uuid = "b49aa546-d643-4829-bb91-bc1e5e539d80"
33
authors = ["Ed Scheinerman <ers@jhu.edu>"]
4-
version = "0.0.8"
4+
version = "0.0.9"
55

66
[deps]
77
ChooseOptimizer = "858a232f-1959-5553-8cfc-91e1fd5304e2"

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ See [the documentation](https://docs.juliahub.com/General/SimplexTableaux/stable
1717

1818
As a demonstration project, this is not suitable for solving actual linear programming (LP) problems.
1919

20-
At present the user needs to specify a starting basis; see the documentation.
21-
2220
This module is set up for minimization problems only.
2321

2422
This module solves LPs using the simplex algorithm which is not the most performant method.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"documenter":{"julia_version":"1.11.6","generation_timestamp":"2025-08-04T11:16:12","documenter_version":"1.10.1"}}
1+
{"documenter":{"julia_version":"1.11.6","generation_timestamp":"2025-08-05T13:27:58","documenter_version":"1.10.1"}}

docs/build/create/index.html

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@
5555
3-element Vector{Int64}:
5656
1
5757
2
58-
3</code></pre><p>These are inefficient functions. We plan to change the implementation of <code>find_a_basis</code> to something more performant. </p><h2 id="Running-the-Simplex-Algorithm"><a class="docs-heading-anchor" href="#Running-the-Simplex-Algorithm">Running the Simplex Algorithm</a><a id="Running-the-Simplex-Algorithm-1"></a><a class="docs-heading-anchor-permalink" href="#Running-the-Simplex-Algorithm" title="Permalink"></a></h2><p>Once a tableau has been set up with a feasible basis, use <code>simplex_solve!(T)</code> to run the simplex algorithm and return solution to the LP.</p><pre><code class="nohighlight hljs">julia&gt; simplex_solve!(T)
58+
3</code></pre><p>These are inefficient functions. We plan to change the implementation of <code>find_a_basis</code> to something more performant. </p><h2 id="Running-the-Simplex-Algorithm"><a class="docs-heading-anchor" href="#Running-the-Simplex-Algorithm">Running the Simplex Algorithm</a><a id="Running-the-Simplex-Algorithm-1"></a><a class="docs-heading-anchor-permalink" href="#Running-the-Simplex-Algorithm" title="Permalink"></a></h2><p>Use <code>simplex_solve!(T)</code> to find the optimum value and minimizing vector for the linear program in <code>T</code>. The user may either specify a starting basis, using <code>set_basis!(T, B)</code>, or if no basis has been specificed, then one is provided using a brute force search. </p><pre><code class="nohighlight hljs">julia&gt; simplex_solve!(T)
59+
Starting basis found: [1, 2]
5960
Starting tableau
6061

6162
┌──────────┬───┬─────┬─────┬─────┬─────┬─────┬─────┐
@@ -66,7 +67,7 @@
6667
│ Cons 2 │ 0 │ 0 │ 1 │ -2 │ 1 │ 3 │ 5 │
6768
└──────────┴───┴─────┴─────┴─────┴─────┴─────┴─────┘
6869

69-
Column 1 leaves basis and column 4 enters
70+
Pivot 1: column 1 leaves basis and column 4 enters
7071

7172
┌──────────┬───┬───────┬─────┬───────┬─────┬──────┬──────┐
7273
│ │ z │ x_1 │ x_2 │ x_3 │ x_4 │ x_5 │ RHS │
@@ -76,7 +77,7 @@
7677
│ Cons 2 │ 0 │ 1/4 │ 0 │ 1/4 │ 1 │ -1/2 │ 1/2 │
7778
└──────────┴───┴───────┴─────┴───────┴─────┴──────┴──────┘
7879

79-
Column 2 leaves basis and column 5 enters
80+
Pivot 2: column 2 leaves basis and column 5 enters
8081

8182
┌──────────┬───┬───────┬───────┬───────┬─────┬─────┬──────┐
8283
│ │ z │ x_1 │ x_2 │ x_3 │ x_4 │ x_5 │ RHS │
@@ -86,11 +87,11 @@
8687
│ Cons 2 │ 0 │ -1/14 │ 2/7 │ -9/14 │ 0 │ 1 │ 9/7 │
8788
└──────────┴───┴───────┴───────┴───────┴─────┴─────┴──────┘
8889

89-
Optimality reached
90+
Optimality reached. Pivot count = 2
9091
Value = -1/7 = -0.14285714285714285
9192
5-element Vector{Rational}:
9293
0
9394
0
9495
0
9596
8//7
96-
9//7</code></pre></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../">« Overview</a><a class="docs-footer-nextpage" href="../other/">Other Functions »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.10.1 on <span class="colophon-date" title="Monday 4 August 2025 11:16">Monday 4 August 2025</span>. Using Julia version 1.11.6.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
97+
9//7</code></pre><blockquote><p><strong>Note</strong>: At present <code>find_a_basis</code> does a brute-force search through all possible <code>m</code>-element subsets of <code>{1,2,...,n}</code> until it finds a feasible basis. We plan to replace this with something better. </p></blockquote></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../">« Overview</a><a class="docs-footer-nextpage" href="../other/">Other Functions »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.10.1 on <span class="colophon-date" title="Tuesday 5 August 2025 13:27">Tuesday 5 August 2025</span>. Using Julia version 1.11.6.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>

0 commit comments

Comments
 (0)