-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSimplex.java
More file actions
43 lines (36 loc) · 973 Bytes
/
Simplex.java
File metadata and controls
43 lines (36 loc) · 973 Bytes
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
package hackpack;
public class Simplex {
public static void main(String[] args) {
// TODO Auto-generated method stub
}
// Linear equations
// 3x + 2y + z = 7
// put coefficients into matrix
// put zeros into first spots, and one into top spot
// zeros in lower left, ones in \ diagonal
// cant pick next non-zero number
// smaller the value, the less precise the division
// pivot on maximum to reduce floating point error
/*
* 1
* 0 1
* 0 0 1
* 0 0 0 1 num
*/
// Gasssian elimination
// Linear equations and mod
// multiply by mod inverse to divide
// write it out and try to divide through, and then try to get mod inverse
// 2x == 4 mod 10
// 2x = 10x+4
// x == 2 mod 5
// Simplex (Linear Programming)
// x+y+z >= 0
// x+3y >= 15
// maximize 4x+2y+x
// add slack variables
// x+y+z + slack1 = 0
// x+3y + slack2 = 15
// find feasible solutions
// imagine hyperplanes, travel on edge, climb to another feasible point
}