Finding the minimum cost of a matrix
Show older comments
Suppose i have cost matrix M= [ 100 250 300 400
600 900 400 300
250 300 160 190].
The size of matrix 3x4. Let column represent machines and row represent worker.I want to minimize cost Matrix M. Each column should have only one cost. I didn't want to use matchpair function.
How can i use intlinprog function of Matlab for minimization cost?
5 Comments
Danish Nasir
on 11 Sep 2021
your constraints are wrong for this problem. as you can see in the solutions 6 and 8 means worker 2 and 4 are simultaneusly work on machine 2. in a symmetric model as you mentioned balanced the other constraint should be added :
which means just 1 worker can work on every machine. including this you have 4+4 constraints (4 before):
you can create these 4 constraints by :
Aeq = [ ones(1,4) zeros(1,12);
zeros(1,4) ones(1,4) zeros(1,8);
zeros(1,8) ones(1,4) zeros(1,4);
zeros(1,12) ones(1,4);
1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0;
0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0;
0 0 1 0 0 0 0 1 0 0 1 0 0 0 1 0;
0 0 0 1 0 0 0 0 1 0 0 1 0 0 0 1];
if you get the solution, you can easily create 4 first row with this:
kron(eye(4),ones(1,4))
and 4 second row with this:
kron(ones(1,4),eye(4))
Danish Nasir
on 11 Sep 2021
Abolfazl Chaman Motlagh
on 11 Sep 2021
sure, i add generall method in comment of Accepted answer. give me some time to write it clear and properly.
Danish Nasir
on 11 Sep 2021
Accepted Answer
More Answers (0)
Categories
Find more on Linear Programming and Mixed-Integer Linear Programming in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
