% 目的関数
c = [ 0;
      0;
      0;
     -1;
     -1 ];
% 線形条件
Aeq = [ 1, 0, -1, -1,  0;
        0, 1,  1,  0, -1 ];
beq = [ 0;
        0 ];
% 線形不等式
Aineq = [ -eye(5); eye(5) ];
bineq = [ zeros(5,1); 8; 4; 3; 4; 6 ];

% 線形計画法
[x,fmin] = linprog(c, Aineq,bineq, Aeq,beq, [],[]);
x
flow = -fmin;
flow
