I have a 2d matrix of m processors(columns) and n tasks(rows), the matrix is populated with the time each process takes to run on a processor, I need to find the optimal time of runnng these n tasks on m processors.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The described problem belongs to the category of Parallel Machine Scheduling Problems.
Also, since each task takes different time on different processors the problem is called Uniform Machine Scheduling Problem.
This kind of problems are strongly NP-hard, hence no polynomial-time algorithm is known. So, a brute force approach is really discouraged unless the matrix is very small because the complexity is similar to
O( n ^ m ).That being said, an optimal approach is probably feasible for not-so-big matrices by using Mixed-Integer Linear Programming (MILP) and solving it with the best linear solvers like Cplex or Gurobi (I hardly think open source solvers like LP-solve can handle problems beyond a certain size).
An example of MILP model appliable to this problem is described here.
However, given their complexity, this kind of problems are usually solved using heuristics/meta-heuristics and so without being sure to reach the optimal solution. Anyway, a good greedy algorithm followed with a good local search to improve the greedy solution, can go very close to the optimum.
EDIT :
A possible brute-force approach is computing all the possible combinations of assignments TASK-PROCESSOR and then compute the makespan. Here’s an example in C/C++