301
General Discussion / Re: if self.isCoder(): post() #Programming Thread
« on: May 02, 2016, 08:41:11 pm »Oh well.
Suppose we have a computing system including N independent processors, threads, devices, executors etc (set P = {p_1,...,p_N}). There are also M tasks (set T = {t_1,...,t_M}) being passed in the said computing system to be handled. We know how much time (or any other meaningful resource in a particular case) is needed to process a given t_i from T, some tau(t_i), by either processor, that is each task can be executed by each of the processors in the same amount of time, and note that processors can't delegate some of the tasks assigned to them to any other processor. The objective is to find such schedule that the total amount of time to execute all tasks on either processor would be minimal.
A schedule is a mapping A_R : T -> P such that if A_R(t_i) = p_j, task t_i from T is said to be assigned to processor p_j from P. A schedule can be also defined as a partition of set T into N disjunctive subsets.
The criterium (that is objective function) to determine how good the outcoming schedule (and thus the algorithm we've used) is is the following: f_r = max f_j (1<=j<=n) -> min, where f_j = tau(t_j_1) + ... + tau(t_j_k) stands for how much time it requires for processor p_j to execute all the tasks (k' tasks alltogether) assigned to it.
This definitely doesn't sound related the cron/crontab utility on linux, which just executes things at a given time. As for the actual algorithm, my instinct (which is fairly rusty for algorithmic problems) tells me that this is sorta a knapsack problem.


