/simplex-method

作業研究加分

Primary LanguageC++

simplex-method

background

作業研究加分程式

本程式只處理化成標準式的規定

  1. 目標函數最大
  2. 約束條件等式
  3. 決策變量非負
  4. 資源限量非負 需使用者在輸入參數時,需要注意,須符合上述四個條件。 simplex method drawio (3)
void compute();
bool optimality_test();
//check if the solution is optimal

Parameter: No parameter Return value:retuen a boolean which show the optimal solution is found

int find_col_pivot();
//

int find_row_pivot(int); //minimum ratio test Parameter: int val: pivot column Return value: int val: pivot row

void Gaussian_elimination(int, int);
//矩陣運算

Parameter: pivot row、pivot column Return value: No return value

install

g++

usage

image

我要處理的問題為:
MAX = 3 * X1 + 5 * X2;
s.t.
X1 <= 4;
2 * X2 <= 12;
3 * X1 + 2 * x2 <= 18;
and
X1 , X2 >= 0;

請寫成線性規劃的標準型
row size: 3
col size: 6
isMax: 1
objective: -3 * X1 -5*X2 - 0 - 0 - 0 =0
MATRIX:

1 * X1 + 0 * X2 + 1 * X3 + 0 * X4 + 0 * X5 = 4;
0 * X1 + 2 *X2 + 0 * X3 + 1 * X4 + 0 * X5 = 12;
3 * X1 + 2 *X2 + 0 * X3 + 0 * X4 + 1 * X5 = 18;

image

code<test.txt

example

program function

maintainers

Contributing

License