By shy
This is my homework of Operations Research & Optimization, so it may not be updated.
Contains a solver to linear programming problem using simplex method while showing the simplex table. Also it can tell the nature of the solution.
- Transform the LP problem to standard form:
Maximize
Subject to {A x = b, x >= 0
Make sure that an identity matrix must contain in A!
- Now we have A, b, c.
- import shypy
- Let Solution = maximize(c, A, b)
- Solution().show()
Note that bugs may exsist!
- In some cases, especially when there're multiple solutions, the number of basic variables may be more than
$m$ .
fib_search(f, a, b, n):
param f: The function to be evaluated.
param a: Left node of the interval
param b: Right node of the interval
param n: Total number of evaluation
return: Final Interval
example:
python def func(x): return x ** 2 - 6 * x + 2 fib_search(func, 0, 10, 34)