作業研究加分程式
本程式只處理化成標準式的規定
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
g++
我要處理的問題為:
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;
code<test.txt