• Nie Znaleziono Wyników

Job scheduling algorithm based on multi-criteria optimization

N/A
N/A
Protected

Academic year: 2021

Share "Job scheduling algorithm based on multi-criteria optimization"

Copied!
11
0
0

Pełen tekst

(1)

Summary

The Job Scheduling problem is an important area of research. It is very popular among many researchers from all over the world. However, the Job Scheduling problem is NP-complete; it is impossible to find an algorithm which solves the aforementioned problem in a deterministic way and in polynomial time. In that paradigm the main task of research is to find algorithms which give as good as possible results in a reasonable time-frame. Beyond a doubt, it is a great opportunity to check the effectiveness of Job Scheduling algorithms and to compare them with solutions of other researchers. These are meaningful competitions, such as the recent Job Scheduling Competition on the TunedIT platform. In this paper we are going to present our novelty algorithm based on multi-criteria optimization, which achieved second place during the aforementioned competition. The key point of our approach is the usage of some additional heuristics which allowed us to arrive at such good results.

Keywords: Job scheduling, Multi-criteria optimization 1. Introduction

Scheduling problems arise in a variety of settings [1–2]. Generally, scheduling problems involve jobs that must be scheduled on machines subject to certain constraints to optimize some objective function. The goal is to specify a schedule that determines when and on which machine each job is to be executed. Scheduling theory is concerned with the formulation and study of various scheduling models and the development of associated solution techniques [3–4]. Some widely studied classical models are single machine, parallel machine, flow scheduling and job scheduling models [5–7]. The job scheduling problem belongs to the set of problems classified as NP Hard Problems [3, 8–10]. The search-based approach to the job scheduling problem is based on the exploration of a feasible solution space to identify an optimal solution. Adaptive search algorithms like Genetic Algorithms [11–12], Tabu Search [13–14] and Simulated Annealing [15– 16] have been applied to this domain with success and in many cases are capable of providing optimal or near optimal solutions. Many researchers defined the job scheduling problem as multi-objective optimization task [17–18].

In our approach we utilized multi-criteria optimization [19–20] and some heuristics to deal with problem of job scheduling.

(2)

1.1. Problem definition

This problem is very well known. As far as I know, it was first presented by Graham in 1966 [22].

Job scheduling is an optimization problem in computer science and operations research in which jobs are assigned to resources at particular times.

The most basic version is as follows. We are given n jobs J1, J2, ..., Jn of varying sizes, which need to be scheduled on m identical machines, while trying to minimize the makespan. The makespan is the total length of the schedule (that is, when all the jobs have finished processing).

Figure 1. General job scheduling task

There are many variations of the problem. Below we described the task of the challenge “Algorithm for Job Scheduling and Task Allocation under Constraints” [21].

(3)

The task consists of assigning workers to particular tasks with the minimization of cost of all performed tasks and delay reduction: in other words, maximization of profit and minimization of lateness. All tasks (Tasks) require some skills (Skills) and have a specified complexity (Quantity) and specified execution time (Deadline). Each worker has specified skills (Worker_skills), which allow him/her to perform a specified quantity of work during the work day (Daily_quantity). In addition, it is important to take into account the cost of work for all workers and make the assumption that on the same task more than one worker can work at the same time. The general diagram of Job Scheduling is presented in Fig. 1.

2. Algorithm Description

Our algorithm is based on some heuristics which allow us to plan the jobs in the optimal way. At the beginning of the algorithm execution, all tasks were grouped into subgroups. Tasks are grouped based on skills and sorted by means of execution time. Each group also contains a list of users with appropriate skills. The brief description of our algorithm which reached second place in [21] consists of the following steps.

In the first step, delayed tasks were sorted in the increasing order of quantity. The given tasks were completed by all users at the same time in order to minimize the average lateness. The users with the biggest coefficient quantDailycostDaily were the cheapest. Hence, they were assigned to the task which demanded the shortest execution time. In case of the impossibility to finish the task on time the next user was assigned to the same task: the task that requires any amount of time smaller than 1 is usually selected to be completed. It is possible that from time to time we have to consider tasks which are scheduled (planned) to do later. For instance, we can make the assumption that we have 10 workers with the same skill, and for the first 5 days only 3 workers have to work in order to finish the work on time. It is possible that on the 6th day we have so much work that not even all workers working together will be able to finish it. One of the possible solutions to that problem is to do part of the work earlier. We can then leave a proper quantity of work for the 6th day. The best way to avoid such situations is to calculate the daily quantity of work for each skill at the beginning of each day.

2.1. Implementation details

In Fig. 2 we can see details of the job scheduling classes. The Job class is the class which describes part of the Task done by the Worker. The Worker class consists of the following parameters:

timeLeft = 1 – (time of work in the current day); this value is set at the beginning of each day (timeLeft =1) and decreases during algorithm execution,

currentDay – current day of work for the considered Worker.

The next class is the Skill class, which consists of the following parameters: • Tasks – sorted list of tasks to do (unfinished tasks), that require considerable skill,

maxDailyQuantity – maximum quantity of all tasks (related with considered skill) that can be done during the current day; this variable is calculated at the beginning of each iteration (at

(4)

the beginning of each day) and decreases during the algorithm’s execution; this value cannot be larger than the sum of the quantity that all workers (related with considered skill) can do during one day,

Workers – all users related with considered skill (workers who have appropriated skills to do the tasks from the Tasks list); sorted list – the first one is the user whose work is the cheapest (has the bigger coefficient: DailyQuantity/DailyCost).

The JobScheduling class has the following parameters: • MAX_DEADLINE – maximum deadline of all tasks,

coefficient – this coefficient is utilized to choose tasks in the current iteration; the value of this coefficient is set at the beginning of each day (coefficient =0) and increases during the algorithm’s execution.

Figure 2. Job Scheduling

(5)

2.2. Schema of Algorithm

The schema presented in the paper shows only the main idea of the algorithm; clearly, many important details are included in the source code [21].

In Fig. 3, we can see the following points of the algorithm procedure: 1. Load Configuration

During configuration loading a list of tasks, workers and skills is created. Each task is added to an appropriate skill object. Each user is added to an appropriate skill object (if the user has 3 WorkerSkills, he/she is added to 3 skill objects) – the user is inserted into the Workers’ list in the appropriate place,

2. Set timeLeft for each worker, 3. For each Skill set maxDailyQuantity,

skillsStatistics[s][d] – sum of quantity of all tasks for skill s on day d (if task t should be finished on day d, the quantity of the task is added to: skillsStatistics[s][d], skillsStatistics[s][d+1],…, skillsStatistics[s][ MAX_DEADLINE]);

MAX_DEADLINE – maximum value of deadlines of all tasks; if (day < MAX DEADLINE) then

for (int d = day; d < maxDeadLine; d++) do

if (skillsStatistics[i][d] / (d – day + 1) > maxDailyQuantity) then maxDailyQuantity = skillsStatistics[i][d] / (d – day + 1);

end if end for else

maxDailyQuantity = skillsStatistics[i][MAX DEADLINE – 1]; end if

where

day – current day;

maxDeadLine – maximal value of deadline of all tasks of currentSkill, 4. Assign 0 to “coefficient”,

5. Sort skills,

6. Take the first skill and assign to currentSkill, 7. Assign first task to currentTask,

8. Remove currentTask from currentSkill.Tasks,

9. Assign workers to do the currentTask. At this moment we make a decision regarding which workers can be utilized to do the currentTask. If (currentTask.Deadline – day) <= 1, all workers from the Workers list can be utilized; otherwise only “the cheapest” users are considered. Workers who have been chosen are sorted due to specific criteria (optimization task for the sort procedure is defined in the next subsection).

(6)

11. Increment coefficient, 12. day++.

Steps of the algorithm with multi-criteria optimization were bolded. Optimization tasks for these steps we will define in the next subsection.

(7)

2.3. Multi-Criteria Optimization in Our Algorithm

In Steps 5, 9 and 10 of our algorithm we have utilized multi-criteria optimization. We have defined three optimization tasks for sort procedures. Each of them has a defined different preference model (preference relation). In our opinion, the approach which utilizes only one aggregated criterion is less effective and flexible than multi-criteria optimization.

Optimization task for sort skill procedure (Step 5 of the algorithm): statistics[s] – sum of quantity of all tasks (for skill s), which are delayed; y, z – skill objects;

y1 – minTimeLeft for skill y; y2 – statistics[y];

z1 – minTimeLeft for skill z; z2 – statistics[z];

)}

(

;

)

,

{(

y

z

X

X

y

1

z

1

y

1

z

1

y

2

z

2

R

=

×

<

=

<

If relation R contains (y,z) it means that y is “better” than z.

Optimization task for workers sort procedure (Step 9 of the algorithm): task – considered task (currentTask);

quantity – task quantity to do (currentTask.Quantity); day – current day;

taskEnd – current time of end work in day for task; y, z – workers;

y1 – max (quantity/y2 + y3, taskEnd);

y2 – dailyQuantity (for currentSkill) for worker y;

y3 – current time of end work in day for worker y (1- y.TimeLeft); z1 – max(quantity/z2 + z3, taskEnd);

z2 – dailyQuantity (for currentSkill) for worker z;

z3 – current time of end work in day for worker y (1- z.TimeLeft);

)}

(

;

)

,

{(

y

z

X

X

y

1

z

1

y

1

z

1

y

2

z

2

R

=

×

<

=

Optimization task for the task sort procedure (Step 10 of the algorithm): y, z – tasks;

day – current day index; y1 – deadline of task y;

y2 – current time of end work of task y in day; y3 = y1- day – y2;

y4 – quantity of task y (remaining quantity to do); z1 – deadline of task z;

z2 – current time of end work of task z in day; z3 = z1- day – z2;

(8)

z4 – quantity of task z (remaining quantity to do);

)}

0

0

(

)

0

0

(

)

0

0

(

)

0

0

(

;

)

,

{(

4 4 1 1 3 3 1 1 3 3 4 4 3 3 3 3

z

y

z

y

z

y

z

y

z

y

z

y

z

y

z

y

X

X

z

y

R

=

>

>

>

>

>

×

=

If relation R contains (y, z), it means that y is “better” than z (worker y will appear before worker z on the list).

The results for our algorithms with real data are reported in the next section. 3. The Results of Our Experiments

We have carried out a series of experiments on real data – see Tab. 1- from the TunedIt [21] platform. In Tab. 1 we have the AverageLateness which is calculated over all tasks. In case the task is finished on time or is finished earlier, the lateness is equal to zero. The Profit is calculated in a simple way, as a difference between the total value of tasks and the cost of doing them according to the generated plan. The Score has been chosen in such a way that the AverageLateness occupies 3 higher digits after the comma, while 1000

profit typically occupies 4–6 digits after the comma.

We won second place on the leader board – see Tab. 2- our final result was the same as the winning result and equal to 0.043878. The detailed results are presented in Tab. 1.

Score = RoundedAverageLateness + ScoreFromProfit

1000

)

(

1000

*

(int)

double

eness

AverageLat

ss

rageLatene

RoundedAve

=

if (Profit <= 1000000) then ScoreFromProfit = 0.000999; else ScoreFromProfit = (1/Profit) *1000; end if

(9)

Table of examined data sets – all from TunedIT Job Scheduling competition [21]

Data No.o

f Users Skills No.of Tasks No.of lateness Average Profit Score

1.txt 7405 1045 463175 0.045381 5052319 0.04519792 2.txt 3660 1040 453690 0.045200 4931228 0.04520278 3.txt 5932 438 419992 0.043596 4577492 0.04321846 4.txt 8290 1467 483596 0.045417 5267677 0.04518983 5.txt 3932 532 423808 0.044028 4618708 0.04421651 6.txt 2019 1168 407734 0.108121 4421205 0.10822618 7.txt 5739 826 406137 0.044596 4423548 0.04422606 8.txt 6794 492 496284 0.044842 5417161 0.04418459 9.txt 5411 691 479761 0.043918 5231887 0.04319113 10.txt 5719 231 475604 0.04431 5183158 0.04419293

Table2. The Leaderboard for the TunedIT Job Scheduling competition [21], Examined data sets: all from Table1

Rank Team PreliminaryResul

t FinalResult 1 jzbontar 0.043801 0.043878 2 Piotr Czerpak 0.043801 0.043878 3 TEAM_CODES 0.043801 0.043878 4 Notissa 0.043801 0.043878 5 Jannes Verstichel 0.043801 0.043878 6 artem 0.043801 0.043878 7 podludek 0.043806 0.044216 8 rabitic 0.044403 0.044680 9 Rav 0.047203 0.046747 10 Baseline 0.197606 0.195016 11 Herald Kllapi 0.197606 0.195016 12 Xenopax 0.197606 0.195016 13 cpreston 0.197606 0.195016 14 Oscar 0.197606 0.195016 15 ga1 0.197606 0.195016

(10)

4. Conclusion

Our job scheduling method is based on the best result for multi-criterion optimization reached during the aforementioned competition. It is also one of the best methods among those known for that difficult task. Our future plan is to check the effectiveness of our algorithms against the other data in the field.

Acknowledgements

This research has been supported by Grant 1309-802 from the Ministry of Science and Higher Education of the Republic of Poland.

Bibliography

[1] Karger, D., Stein, C. and Wein, J.: Scheduling Algorithms (2010).

[2] Pinedo, M.: Planning and Scheduling in Manufacturing and Services, Springer (2005). [3] Wiers, V. C. S.: A review of the applicability of OR and AI scheduling techniques in

practice, Omega, 25(2), pp. 145–153 (1997).

[4] Pinedo, M.: Scheduling: Theory, Algorithms and Systems. Prentice Hall (1995). [5] Baker, K. R.: Introduction to sequencing and scheduling, New York, Wiley (1974).

[6] Chandrasekaran, M., Asokan, P., Kumanan, S., Balamurugan, T., and Nickolas, S.: Solving job shop scheduling problems using artificial immune system, In: International Journal Advanced Manufacturing Technology, 31(5–6), pp. 580–593 (2005).

[7] Fink, A., and Vob, S.: Solving the continuous flow shop scheduling problem by meta-heuristic, In: European Journal of Operations Research, vol. 151, pp. 400–414 (2003). [8] French, S.: Sequencing and scheduling: An introduction to the mathematics of the job shop,

Chichester, West Sussex, E. Horwood (1982).

[9] Giffler, B. and Thompson, G. L.: Algorithms for solving production scheduling problems, Operations Research, 8(4), pp. 487–503 (1960).

[10] Garey, M. R., Johnson D. S. and Sethi, R.: The complexity of fowshop and jobshop scheduling, Mathematics of Operations Research, 1(1976)117–129.

[11] Mahanim Omar, Adam Baharum, Yahya Abu Hasan: A job-shop scheduling problem using genetic algorithm. (2004).

[12] Yang Gao, Hongqiang Rong, Joshua Zhexue Huang: Adaptive grid job scheduling with genetic algorithms. (2004).

[13] Fatos Xhafa, Javier Carretero, Bernabe Dorronsoro, Enrique Alba: A Tabu search algorithm for scheduling independent jobs in computational grids. (2008).

[14] Hurink, J., Jurish, B. and Thole, M.: Tabu search for the job-shop scheduling problem with multi-purpose machines.

[15] Jayalakshmi, S. and Rajagopalan, S. P.: Modular Simulated Annealing in Classical Job Shop Scheduling, In: Information Technology Journal, 6: pp. 222–226 (2007).

[16] Takeshi Yamada, Ryohei Nakano: Job-Shop Scheduling by Simulated Annealing Combined with Deterministic Local Search. (1995).

(11)

[17] Zhou Yaqin: Study on job-shop scheduling with multi-objectives based on genetic algorithms (2010).

[18] Li-Ning Xing, Ying-Wu Chen, Ke-Wei Yang: Multi-objective flexible job shop schedule: Design and evaluation by simulation modeling (2009).

[19] Czerpak, P.: Automatic Plan Scheduling as Multi-Objective Optimization. In: Methods of Optimisation and Data Analysis – Selected Issues. Kesra Nermend, Tomasz Komorowski (eds.) (ISBN: 978-83-7518-242-2), pp.13–29 (2010).

[20] Czerpak, P., Drozda, P., Sopyła, K.: Use of Poly-Optimization for Automatic Scheduling at University. Congress of Young IT Scientist. In: Polish Journal of Environmental Studies. vol. 18, no. 3B 2009, pp. 93–97 (2009).

[21] Tuned It: http://tunedit.org/challenge/job-scheduling (2011).

[22] Graham, R.: Bounds for certain multiprocessing anomalies, In: Bell System Technical Journal 45: pp. 1563–1581 (1966).

WYKORZYSTANIE OPTYMALIZACJI WIELOKRYTERIALNEJ W ALGORYTMIE HARMONOGRAMOWANIA ZADAē

Streszczenie

Problem szeregowania zadaĔ to bardzo istotna dziedzina badaĔ. Jest ona bardzo popularna wĞród wielu naukowców z całego Ğwiata. Problem szeregowania zadaĔ naleĪy do kategorii problemów NP-zupełnych – nie istnieją algorytmy deterministyczne, które rozwiązywałyby ten problem w czasie wielomianowym. Dlatego głównym celem badaczy jest opracowanie algorytmu, który pozwoli na osiągniĊcie jak najlepszych wyników w rozsądnym czasie. Niewątpliwie stwarza to moĪliwoĞü sprawdzenia efektywnoĞci własnych algorytmów i porównania ich z algorytmami innych badaczy. Jedną z takich moĪliwoĞci były zawody ogłoszone na portalu TunedIT. W niniejszej pracy zaprezentujemy nasz algorytm, wykorzystujący optymalizacjĊ wielokryterialną, który dał nam drugie miejsce we wspomnianych zawodach. Kluczowym punktem algorytmu są pewne heurystyki, które pozwoliły nam osiągnąü tak dobry wynik.

Słowa kluczowe: harmonogramowanie zadaĔ, optymalizacja wielokryterialna Piotr Czerpak

Piotr Artiemjew

Wydział Matematyki i Informatyki

Uniwersytet WarmiĔsko-Mazurski w Olsztynie email: piotrczerpak@matman.uwm.edu.pl

Cytaty

Powiązane dokumenty

Rozważając przedstawiony przykład, można zauważyć brak jednej spójnej me- tody oceny niezawodnościowej procesów produkcyjnych, która obejmowałaby

Omdat dit homogene stelsel meer onbekenden dan vergelijkingen heeft , heeft het volgens stelling 2 een niet triviale oplossing, hetgeen betekent dat er een oplossing bestaat

Jednostka jest osobą, jednak najczęściej jest tak zanurzona w wykonywanie roli, że staje się w pełni rolą dla innych i w konsekwencji dla siebie samej.. Czasami jednak

Estimation of the density of the eruption length of 107 eruptions of the Old Faithful geyser: the estimator f 7 resulting from the algorithm has bandwidth h 7 = 0.25... Estimation

Pierwsze trzy „pokrywają się mniej więcej tematycznie” (jak zapewnia jej autor) „z trzema wykładami, które wygłosił w Uniwersytecie Columbia w kwietniu 1980

• “Nowy Sącz Experiment” in the end of 50’s and 60’s years and its influence on city's innovation,.. • 7 economical “tigers” – there is always somebody behind

Als ontwikkelaars het voor het zeggen hadden, zouden gebieden effectief en winstgevend worden ontwikkeld, maar blijven ruimtelijke kwaliteit, goed ontwerp en toekomstbestendigheid

0 współczynnikach funkcji, których część rzeczywista jest ograniczona О коэффициентах функций, вещественная часть которых ограничена.. In this note we are going