-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
541 lines (488 loc) · 17.8 KB
/
Copy pathindex.html
File metadata and controls
541 lines (488 loc) · 17.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Solve optimization problems with this Linear Programming Toolset, featuring Simplex, Branch and Bound, TSP solvers, Golden Ratio Search, and more.">
<meta name="keywords"
content="linear programming, optimization tools, simplex algorithm, dual simplex, two phase simplex, branch and bound, tsp solver, golden ratio search, data envelopment analysis, hungarian algorithm, machine scheduling, sensitivity analysis">
<meta name="author" content="Your Name or Organization">
<meta name="robots" content="index, follow">
<title>Linear Programming Toolset</title>
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "WebApplication",
"name": "Linear Programming Toolset",
"description": "A free, interactive toolset for solving linear programming, integer programming, and combinatorial optimization problems, including Simplex, Branch and Bound, TSP solvers, Hungarian Algorithm, Data Envelopment Analysis, Golden Ratio Search, and more.",
"url": "https://linprog.bdw.run/",
"applicationCategory": "EducationalApplication",
"operatingSystem": "Web",
"keywords": "linear programming, optimization tools, simplex algorithm, dual simplex, two phase simplex, branch and bound, knapsack problem solver, tsp solver, cheapest insertion tsp, nearest neighbor tsp, hungarian algorithm, data envelopment analysis, golden ratio search, machine scheduling, sensitivity analysis, linear programming duality, graphical solver, cutting plane optimization, steepest descent",
"featureList": [
"Dual Simplex Algorithm",
"Two Phase Simplex Solver",
"Graphical Linear Programming",
"Goal Penalties Simplex",
"Goal Preemptive Simplex",
"Math Preliminaries",
"Sensitivity Analysis Tool",
"Linear Programming Duality",
"Data Envelopment Analysis (DEA)",
"Linear Programming Modeling",
"Knapsack Problem Solver",
"Branch and Bound Simplex",
"Cutting Plane Optimization",
"Cheapest Insertion TSP",
"Nearest Neighbor TSP",
"Hungarian Algorithm Solver",
"Machine Scheduling Optimization",
"Golden Ratio Search",
"Steepest Descent Optimization"
],
}
</script>
<style>
/* Generic CSS for web tools with pitch black theme and amber accents */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: Arial, Helvetica, sans-serif;
}
body {
display: flex;
background-color: #000000;
/* Pitch black background */
color: #FFFFFF;
/* White text */
height: 99vh;
/* height: 100vh; */
overflow: hidden;
/* padding-top: 60px; */
/* Dead space at top of page */
}
/* Sidebar */
aside {
width: 310px;
/* width: 30vw; */
background: #1A1A1A;
/* Dark gray */
color: #FFFFFF;
padding: 1rem;
transition: transform 0.3s ease;
position: fixed;
/* top: 60px; */
/* Align below body padding */
/* height: calc(100% - 60px); */
height: 100vh;
/* Adjust height for top padding */
overflow-y: auto;
/* z-index: 1000; */
}
aside.hidden {
transform: translateX(-100%);
}
aside h2 {
font-size: 1.2rem;
color: #CC3300;
/* Soft amber */
margin-bottom: 0.5rem;
}
aside button {
display: block;
width: 100%;
margin: 0.25rem 0;
padding: 0.5rem;
background: #333333;
color: #FFFFFF;
border: none;
cursor: pointer;
border-radius: 4px;
text-align: left;
font-size: 0.9rem;
font-weight: bold;
transition: background 0.2s ease;
z-index: 9999;
position: relative;
}
aside button:hover {
background: #CC3300;
/* Amber on hover */
color: #000000;
}
/* Main content */
main {
flex: 1;
padding: 1rem;
margin-left: 302px;
overflow-y: auto;
transition: margin-left 0.3s ease;
}
main.full-width {
margin-left: 0;
}
/* Toggle button (hamburger) */
.toggle-sidebar {
position: fixed;
top: 20px;
/* Inside dead space */
left: 20px;
background: #CC3300;
/* Soft amber */
color: #000000;
border: none;
padding: 6px 10px;
cursor: pointer;
border-radius: 4px;
font-size: 1rem;
z-index: 1200;
width: 36px;
height: 36px;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
z-index: 1;
}
.toggle-sidebar:hover {
background: #FF9800;
/* Darker amber on hover */
}
/* Hamburger/close icon */
/* .toggle-sidebar::before {
content: "☰";
} */
/* .toggle-sidebar:hover::before {
content: "✕";
} */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}
/* Firefox */
input[type=number] {
-moz-appearance: textfield;
}
#form textarea:focus,
#form input:focus,
#form select:focus {
border-color: #CC3300;
/* Amber border on focus */
outline: none;
}
/* Results area */
#results {
background: #1A1A1A;
border: 1px solid #333333;
padding: 10px;
border-radius: 4px;
color: #FFFFFF;
/* // text-align: center; Center text in output/results */
}
/* Headings */
h1 {
color: #CC3300;
/* Amber title */
margin-bottom: 1rem;
}
/* Responsive adjustments */
@media (max-width: 600px) {
aside {
/* width: 200px; */
/* top: 50px; */
/* height: calc(100% - 50px); */
/* height: 100%; */
}
body {
/* padding-top: 50px; */
}
main {
/* margin-left: 200px; */
}
main.full-width {
/* margin-left: 0; */
}
/* .toggle-sidebar {
top: 8px;
left: 8px;
width: 32px;
height: 32px;
font-size: 0.9rem;
} */
}
/* Pitch Black Tool List Section */
#tool-list {
max-width: 900px;
margin: 2rem auto;
padding: 1.5rem;
background: #0a0a0a;
border-radius: 16px;
box-shadow: 0 0 12px rgba(255, 153, 0, 0.05);
font-family: "Inter", system-ui, sans-serif;
border: 1px solid #1f1f1f;
}
/* Section Title */
#tool-list h2 {
text-align: center;
color: #FF9800;
/* Bright amber */
font-size: 1.8rem;
font-weight: 700;
letter-spacing: 0.5px;
margin-bottom: 1.5rem;
}
/* Tool List Grid */
#tool-list ul {
list-style: none;
margin: 0;
padding: 0;
display: grid;
grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
gap: 1rem;
}
/* Each Tool Card */
#tool-list li {
background: #121212;
border: 1px solid #2a2a2a;
border-radius: 12px;
padding: 1rem 1.2rem;
transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
#tool-list li:hover {
transform: translateY(-4px);
border-color: #CC3300;
box-shadow: 0 0 10px rgba(204, 51, 0, 0.3);
}
/* Tool Headings */
#tool-list h3 {
margin-top: 0;
margin-bottom: 0.4rem;
font-size: 1.1rem;
font-weight: 600;
}
/* Tool Links */
#tool-list a {
text-decoration: none;
color: #FF6600;
transition: color 0.2s ease, text-shadow 0.2s ease;
}
#tool-list a:hover {
color: #FFB74D;
text-shadow: 0 0 6px rgba(255, 153, 0, 0.6);
}
/* Description Text */
#tool-list p {
color: #CCCCCC;
font-size: 0.95rem;
line-height: 1.5;
margin: 0;
}
/* Bold Keywords */
#tool-list strong {
color: #FF9800;
font-weight: 600;
}
</style>
</head>
<body>
<button class="toggle-sidebar" onclick="toggleSidebar()">✕</button>
<aside id="sidebar">
<h2 style="margin-left: 60px; margin-top: 10px;">Algorithms</h2>
<button style="margin-top: 30px;" onclick="loadUI('adding_activities_and_constraints')">Adding Activities And
Constraints</button>
<button onclick="loadUI('branch_and_bound')">Branch And Bound Simplex</button>
<button onclick="loadUI('knapsack')">Branch And Bound Knapsack</button>
<button onclick="loadUI('traveling_sales_person')">Traveling Sales Person CIN / NNH</button>
<button onclick="loadUI('cutting_plane')">Cutting Plane</button>
<button onclick="loadUI('dea')">Data Envelopment Analysis</button>
<button onclick="loadUI('steepest_descent')">Steepest Ascent / Descent</button>
<button onclick="loadUI('dual_simplex')">Dual Simplex</button>
<button onclick="loadUI('duality')">Linear Programming Duality</button>
<button onclick="loadUI('goal_simplex')">Goal Simplex</button>
<button onclick="loadUI('goldenratio_search')">Golden Ratio Search</button>
<button onclick="loadUI('graphical_solver')">Graphical Solver</button>
<button onclick="loadUI('hungarian_algorithm')">Hungarian Algorithm</button>
<button onclick="loadUI('machine_scheduling')">Machine Scheduling</button>
<button onclick="loadUI('math_preliminaries')">Math Preliminaries</button>
<button onclick="loadUI('sensitivity_analysis')">Sensitivity Analysis</button>
<button style="margin-bottom: 5vh;" onclick="loadUI('two_phase_simplex')">Two Phase Simplex</button>
<section style="margin-bottom: 15vh;"><a style="color: white; " href="https://github.com/BrettWilsonDev/linprog-toolset">Made By Brett Wilson</a></section>
</aside>
<main id="main-content">
<h1 style="margin-left: 60px;" id="title">← Select an Algorithm</h1>
<div id="form"></div>
<div style="margin-bottom: 10vh;" id="results">
<section id="tool-list" aria-label="Available Optimization Tools">
<h2>Available Optimization Tools</h2>
<ul>
<li>
<h3><a href="#" onclick="loadUI('dual_simplex')">Dual Simplex Algorithm</a></h3>
<p>Solves <strong>linear programming problems</strong> efficiently with the <strong>Dual Simplex
method</strong>, perfect for modified constraints.</p>
</li>
<li>
<h3><a href="#" onclick="loadUI('two_phase_simplex')">Two Phase Simplex Solver</a></h3>
<p>A two-stage <strong>Simplex algorithm</strong> for complex <strong>linear programming</strong> problems.
</p>
</li>
<li>
<h3><a href="#" onclick="loadUI('graphical_solver')">Graphical Linear Programming Solver</a></h3>
<p>Visualizes and solves two-variable <strong>linear programming problems</strong> using <strong>graphical
methods</strong>.</p>
</li>
<li>
<h3><a href="#" onclick="loadUI('goal_simplex')">Goal Simplex</a></h3>
<p>Handles <strong>multi-objective optimization</strong> with penalty-based and preemptive <strong>goal
programming</strong>.</p>
</li>
<li>
<h3><a href="#" onclick="loadUI('math_preliminaries')">Math Preliminaries for Optimization</a></h3>
<p>Learn foundational <strong>optimization basics</strong> for understanding <strong>linear programming
concepts</strong>.</p>
</li>
<li>
<h3><a href="#" onclick="loadUI('sensitivity_analysis')">Sensitivity Analysis Tool</a></h3>
<p>Analyzes changes in <strong>linear programming</strong> solutions with <strong>sensitivity
analysis</strong>.</p>
</li>
<li>
<h3><a href="#" onclick="loadUI('duality')">Linear Programming Duality Solver</a></h3>
<p>Explores <strong>dual formulation</strong> of <strong>linear programming problems</strong>.</p>
</li>
<li>
<h3><a href="#" onclick="loadUI('dea')">Data Envelopment Analysis (DEA) Tool</a></h3>
<p>Measures efficiency with <strong>Data Envelopment Analysis</strong> for decision-making units.</p>
</li>
<li>
<h3><a href="#" onclick="loadUI('adding_activities_and_constraints')">Linear Programming Modeling Tool</a>
</h3>
<p>Dynamically add <strong>activities and constraints</strong> to <strong>linear programming
models</strong>.</p>
</li>
<li>
<h3><a href="#" onclick="loadUI('knapsack')">Knapsack Problem Solver</a></h3>
<p>Solves the <strong>knapsack problem</strong> using <strong>Branch and Bound</strong> for optimal
selection.</p>
</li>
<li>
<h3><a href="#" onclick="loadUI('branch_and_bound')">Branch and Bound Simplex</a></h3>
<p>Uses <strong>Branch and Bound</strong> for complex <strong>integer programming</strong> problems.</p>
</li>
<li>
<h3><a href="#" onclick="loadUI('cutting_plane')">Cutting Plane Optimization</a></h3>
<p>Refines solutions with <strong>cutting plane methods</strong> for <strong>integer programming</strong>.
</p>
</li>
<li>
<h3><a href="#" onclick="loadUI('traveling_sales_person')">Traveling Sales Person Solver</a></h3>
<p>Solves the <strong>Traveling Salesman Problem</strong> with the <strong>Cheapest Insertion and Nearest Neighbor</strong>
heuristic.</p>
</li>
<li>
<h3><a href="#" onclick="loadUI('hungarian_algorithm')">Hungarian Algorithm Solver</a></h3>
<p>Solves <strong>assignment problems</strong> with the <strong>Hungarian Algorithm</strong>.</p>
</li>
<li>
<h3><a href="#" onclick="loadUI('machine_scheduling')">Machine Scheduling Optimization</a></h3>
<p>Optimizes <strong>scheduling</strong> for machines in <strong>operations research</strong>.</p>
</li>
<li>
<h3><a href="#" onclick="loadUI('goldenratio_search')">Golden Ratio Search Calculator</a></h3>
<p>Performs <strong>one-dimensional optimization</strong> with the <strong>Golden Ratio Search</strong>.</p>
</li>
<li>
<h3><a href="#" onclick="loadUI('steepest_descent')">Steepest Ascent / Descent Algorithm</a></h3>
<p>Optimizes functions with the <strong>Steepest Descent algorithm</strong> for gradient-based solutions.
</p>
</li>
</ul>
</section>
</div>
</main>
<script type="module">
import ModuleFactory from "./src/web/wasm/linprog-toolset.js";
import * as dual_simplex from "./src/web/ui/dual_simplex.js";
import * as two_phase_simplex from "./src/web/ui/two_phase_simplex.js";
import * as graphical_solver from "./src/web/ui/graphical_solver.js";
import * as goal_simplex from "./src/web/ui/goal_simplex.js";
import * as math_preliminaries from "./src/web/ui/math_preliminaries.js";
import * as sensitivity_analysis from "./src/web/ui/sensitivity_analysis.js";
import * as duality from "./src/web/ui/duality.js";
import * as dea from "./src/web/ui/dea.js";
import * as adding_activities_and_constraints from "./src/web/ui/adding_activities_and_constraints.js";
import * as knapsack from "./src/web/ui/knapsack.js";
import * as branch_and_bound from "./src/web/ui/branch_and_bound.js";
import * as cutting_plane from "./src/web/ui/cutting_plane.js";
import * as traveling_sales_person from "./src/web/ui/traveling_sales_person.js";
import * as hungarian_algorithm from "./src/web/ui/hungarian_algorithm.js";
import * as machine_scheduling from "./src/web/ui/machine_scheduling.js";
import * as goldenratio_search from "./src/web/ui/goldenratio_search.js";
import * as steepest_descent from "./src/web/ui/steepest_descent.js";
let Module = null;
async function initWasm() {
if (!Module) {
Module = await ModuleFactory();
console.log("WASM module initialized");
}
return Module;
}
window.onload = async function () {
await initWasm();
};
const uiModules = {
dual_simplex,
two_phase_simplex,
graphical_solver,
goal_simplex,
math_preliminaries,
sensitivity_analysis,
duality,
dea,
adding_activities_and_constraints,
knapsack,
branch_and_bound,
cutting_plane,
traveling_sales_person,
hungarian_algorithm,
machine_scheduling,
goldenratio_search,
steepest_descent,
};
window.loadUI = async (algo) => {
const module = uiModules[algo];
if (!module) {
document.getElementById("title").innerText = "Unknown algorithm";
return;
}
document.getElementById("title").innerText = "";
document.getElementById("form").innerHTML = "";
document.getElementById("results").innerHTML = "";
const wasm = await initWasm();
module.render(document.getElementById("form"), document.getElementById("results"), wasm);
};
window.verbose = function () {
Module.toggleVerbose();
};
let toggleBool = false;
window.toggleSidebar = function () {
const sidebar = document.getElementById("sidebar");
const mainContent = document.getElementById("main-content");
sidebar.classList.toggle("hidden");
mainContent.classList.toggle("full-width");
const toggleButton = document.querySelector(".toggle-sidebar");
// toggleButton.innerHTML = "☰";
toggleBool = !toggleBool;
if (toggleBool) {
toggleButton.innerHTML = "✕";
toggleButton.innerHTML = "☰";
}
else {
toggleButton.innerHTML = "☰";
toggleButton.innerHTML = "✕";
}
};
</script>
</body>
</html>