No feasible solution found. How to fix it

6 次查看(过去 30 天)
I am solving a transport problem using lingprog, but I don't understand why it doesn't have a feasible solution. Could there be a bug in the code?
A = [ 4 5 6 7 7; 5 4 4 4 8; 4 6 5 7 6; 3 3 5 5 11];
b = [100 120 80 100 100 80 120 130 110];
C = cat(2, A(1,:), A(2, :), A (3,:), A (4,:));
lb=zeros(1,length(C));
p1 = cat(2, ones(1,5), zeros(1,5), zeros (1,5), zeros (1,5));
p2 = cat(2, zeros(1,5), ones(1,5), zeros (1,5), zeros (1,5));
p3 = cat(2, zeros(1,5), zeros (1,5), ones(1,5), zeros (1,5));
p4 = cat(2, zeros(1,5), zeros (1,5), zeros (1,5), ones(1,5));
P = cat(1,p1,p2,p3,p4);
Y = cat(2, eye(5), eye(5), eye(5), eye(5));
Qeq = cat(1, P, Y);
[x, fval] = linprog (C, [], [], Qeq, b, lb);
No feasible solution found.
Linprog stopped because no point satisfies the constraints.

采纳的回答

Matt J
Matt J 2021-5-3
编辑:Matt J 2021-5-3
You have provided equality constraints that have no solutions, as can be seen by:
rank(Qeq)
ans = 8
rank([Qeq,b.'])
ans = 9

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Logical 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by