Matrix Optimization using optimization toolbox

14 visualizaciones (últimos 30 días)
Patrick  Martin
Patrick Martin el 13 de Feb. de 2019
Comentada: Patrick Martin el 14 de Feb. de 2019
I have a matrix with each row being a task and each column being a worker. The cells contain a performance for each worker on each task. Each worker can take up to two tasks with each task only requiring one worker. I want to alocate workers in a way that maximizes performance. How would i go about doing this?

Respuesta aceptada

Matt J
Matt J el 13 de Feb. de 2019
Editada: Matt J el 13 de Feb. de 2019
Should be pretty easy with the problem-based linear program solver,
X = optimvar('X',numTasks,numWorkers,'Type','integer','LowerBound',0,'UpperBound',1);
prob = optimproblem('ObjectiveSense','maximize');
prob.Constraints.oneworker=sum(X,2)<=1;
prob.Constraints.maxTasks=sum(X,1)<=2;
prob.Objective=sum(performances(:).*X(:));
Xsolution = solve(prob);

Más respuestas (0)

Categorías

Más información sobre Problem-Based Optimization Setup en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by