% 線形計画法
% 非有界の場合

% minimize f'x
% subject to Ax <= b
%
% linprog(f, A, b)

% minimize    -x_1    -x_2
% subject to -3 x_1   - x_2 <= 15
%            -2 x_1 - 3 x_2 <= 24
%              x_1 >= 0, x_2 >= 0
% を
% minimize    -x_1    -x_2
% subject to -3 x_1   - x_2 <= 15
%            -2 x_1 - 3 x_2 <= 24
%             -x_1         <= 0
%                    - x_2 <= 0
% と書き換えて解く

f = [ -1; -1 ];
A = [ -3,  -1;
      -2,  -3;
     -1,  0;
      0, -1 ];
b = [ 15; 24; 0; 0 ];
x = linprog(f, A, b);
x
