No feasible solution found. How to fix it
6 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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.
0 commentaires
Réponse acceptée
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Logical dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!