An integer programming formulation for a fair tournament scheduling in TeamGym in Iceland

by

Andrea Valdimarsdóttir

Thesis of 30 ECTS credits submitted to the School of Science and Engineering at Reykjavík University in partial fulfillment of the requirements for the degree of Master of Science (M.Sc.) in Engineering Management

June 2021

Supervisor: Eyjólfur Ingi Ásgeirsson, Ph.D., Supervisor Associate Professor, Reykjavík University, Iceland

Examiner: Rannveig GuØmundsdóttir, M.Sc., Examiner Head of AGR Services, AGR Dynamics, Iceland

i Copyright Andrea Valdimarsdóttir June 2021

ii An integer programming formulation for a fair tournament scheduling in TeamGym in Iceland

Andrea Valdimarsdóttir

June 2021

Abstract

Organizing a sports tournament schedule can be challenging and time-consuming. In this project, the process of generating a TeamGym tournament schedule is automated. Today, the tournaments at FSÍ are made manually. By automating the process, the time for making the tournaments at FSÍ should be considerably shortened and reduce the risk of errors. The main goal of this project is to create a mathematical model that ensures a fair tournament for all teams while fulfilling specific requirements such as all teams must compete once on each event, each round should preferably contain all types of events and care must be taken that teams’ rest periods are within the agreed time frame.

The results of the project show that a fair and feasible solution can be found with automation that decreases the scheduling time and ensures a fairer and better-organized tournament.

Keywords: Tournament schedule, gymnastics, TeamGym, optimization model.

iii Heiltölubestunarlíkan sem b˝r til sanngjarnt mótsplan fyrir hópfimleika á Íslandi

Andrea Valdimarsdóttir

júní 2021

Útdráttur

ùaØ getur veriØ krefjandi og tímafrekt aØ útbúa íΩróttamótsplön. Í Ωessu verkefni er ferliØ viØ aØ útbúa hópfimleikamótsplan gert sjálfvirkt. Í dag eru fimleikamótin hjá FSÍ gerØ handvirkt en meØΩví aØ gera ferliØ sjálfvirkt ætti tíminn viØ gerØ fimleikamóta hjá FSÍ aØ styttast til muna ásamt Ωví aØ minnka líkur á villum. MarkmiØΩessa verkefnis er aØ útbúa stærØfræØilíkan sem tryggir sanngjarnt mót fyrir öll liØ en á sama tíma Ωarf aØ fara eftir ákveØum skilyrØum. Dæmi um slík skilyrØi eru aØ öll liØΩurfa aØ keppa einu sinni á hverju áhaldi, hver umferØ á helst aØ innihalda allar gerØir áhalda og passa Ωarf aØ hvíldartími hvers liØs sé innan ákeØins tímaramma.

NiØurstöØur verkefnisins gefa til kynna aØ hægt er aØ búa til sanngjarnari og hagkvæmari lausn sem er sjálfvirk og tekur mun styttri tíma aØ útbúa.

Efnisor: Mótsplan, fimleikar, TeamGym, bestunarlíkan.

iv Acknowledgements

I want to thank my supervisor Dr. Eyjólfur Ingi Ásgeirsson, for the support, meetings, and guidance throughout this project. I would also like to thank Sólveig Jónsdóttir, the CEO of FSÍ, and Íris Svavarsdóttir, former tournament planer at FSÍ, for their cooperation and meetings. Furthermore, I would like to thank my family, friends, and fellow students for the support throughout my time at Reykjavik University.

v Contents

Acknowledgements v

Contents vi

List of Figures viii

List of Tables ix

1 Introduction 1

2 Background 2 2.1 Artistic gymnastics ...... 2 2.1.1 Disciplines in artistic gymnastics ...... 2 2.1.2 Levels in artistic gymnastics ...... 5 2.1.3 Scoring in artistic gymnastics ...... 5 2.2 TeamGym ...... 6 2.2.1 TeamGym events ...... 6 2.2.2 TeamGym levels ...... 8 2.2.3 TeamGym scoring ...... 8 2.3 The TeamGym Scheduling Problem ...... 9 2.4 The Current Scheduling Process ...... 9

3 Literature Review 11 3.1 Scheduling problems ...... 11 3.2 Fairness in scheduling ...... 12

4 Model 13 4.1 General features of the model ...... 13 4.1.1 Sets ...... 13 4.1.2 Parameters ...... 14 4.2 Variables ...... 14 4.3 Constraints ...... 16 4.3.1 Hard constraints ...... 16 4.3.2 Soft constraints ...... 16 4.4 Objective function ...... 18 4.5 The model ...... 19 4.6 Model adaptability ...... 20 4.6.1 Changes to the model ...... 20

5 Data 22

vi 5.1 Data collection ...... 22 5.2 Data process ...... 22 5.3 Model input ...... 23

6 Results 25 6.1 Model results ...... 25 6.1.1 Results from test case one ...... 25 6.1.2 Results from test case two ...... 27

7 Discussion 29

8 Conclusion 32

Bibliography 33

vii List of Figures

2.1 Vault [3] ...... 3 2.2 High bar [4] ...... 3 2.3 Even parallel bars [5] ...... 3 2.4 Uneven parallel bars [3] ...... 3 2.5 Floor exercises [6] [7] ...... 4 2.6 Balance beam [9] ...... 4 2.7 Pommel horse [3] ...... 4 2.8 Rings [3] ...... 5 2.9 Balance movement in floor exercises [3] ...... 7 2.10 Tumbling [16] ...... 7 2.11 Trampet with vault [3] [17] ...... 7 2.12 Schedule from the 2nd Cup tournament in 2021 ...... 10

5.1 Flow of the data process ...... 23

7.1 Comparison of penalty scores per team for both test cases and the old FSÍ tournament ...... 31

viii List of Tables

2.1 Women’s and men’s disciplines in artistic gymnastics ...... 3 2.2 Age range of each level and relevant tournaments [8] [10] ...... 5 2.3 Maximum score for each level [12] [11] ...... 6 2.4 Highest score in men’s and women’s free routines from the Cup tourn. in 2020 [13] ...... 6 2.5 Women, men and mixed teams compete on same events in TeamGym ...... 8 2.6 Categories, levels and divisions in TeamGym [18] ...... 8 2.7 Maximum score for each rating [18] ...... 9 2.8 Top 3 senior women’s teams from the Cup tournament in 2020 [13] ...... 9 2.9 TeamGym tournaments [18] ...... 10

5.1 List of teams competing ...... 23 5.2 Other data needed for the model ...... 23 5.3 Weight factors for TeamGym tournaments ...... 24

6.1 Number of violated constraints for test case one ...... 26 6.2 Total penalty score for test case one ...... 26 6.3 Tournament schedule for test case one (due to limited space the table has been divided) ...... 27 6.4 Number of violated constraints for test case two (same results for both parts) . . 28 6.5 Penalty score for part one in case two ...... 28 6.6 Penalty score for part two in case two ...... 28 6.7 Tournament schedule for test case two, part one ...... 28 6.8 Tournament schedule for test case two - part two ...... 28

7.1 An old FSÍ tournament schedule - part one ...... 30 7.2 An old FSÍ tournament schedule - part two ...... 30 7.3 Penalty scores from an old FSÍ tournament - part one ...... 30 7.4 Penalty scores from an old FSÍ tournament - part two ...... 30

ix x Chapter 1

Introduction

This project will cover the analysis for an integer programming formulation for fair tour- nament scheduling of TeamGym in Iceland. Creating a suitable sports schedule can be a daunting task and, it requires a lot of preparation, logistical planning, and a vital understand- ing of the sport itself. Furthermore, the plan should meet as many requirements and wishes as possible from the Icelandic Gymnastics Association (FSÍ) and other stakeholders. Gymnastics in Iceland is on the rise, and today the sport is the third most practiced in Iceland after football and golf. Furthermore, gymnastics has the second most participants from ages 17 and younger and the most practiced sport for women in general [1]. There are 28 gymnastics clubs operating in Iceland. The biggest clubs are; Gerpla, Stjarnan, Fjölnir, and Grótta. Gymnastics can be practiced individually in artistic gymnastics or as a team, which is called TeamGym. A lot of time has been spent by FSÍ personnel planning tournaments. A few years ago, they tried to improve their methods due to time consumption. They created an organized Excel document that greatly facilitated their work. However, FSÍ employees are still handling the tournament planning by hand. There has been little concern about fairness between teams as FSÍ’s primary goal has been to create as short of a tournament as possible. As the sport has been proliferating in recent years, clubs are sending more and more teams to each tournament, making it more challenging to organize the competitions. Therefore, changes to the tournament structure are necessary, and therefore it is ideal for creating a model that gathers teams and divides them into dierent rounds for the tournament schedule. The model will save time and reduce costs for FSÍ as the employees can use their time for other things while the model is working. The research objective for this project is to create a mathematical model that generates a fair tournament schedule for FSÍ. To ensure fairness amongst teams in TeamGym tourna- ments, the following needs to be examined; the competition order of events and whether or not the break between rounds is too short or too long. The overall aim is to automate gener- ating tournament schedules by minimizing scheduling time, reducing errors, and meeting as many requirements as possible while delivering a fair, feasible solution to all competitors. Chapter two provides basic information about TeamGym and artistic gymnastics, its events, levels, and scoring. In chapter three, a review of the most relevant literature will be put forth. Chapter four presents the mathematical model and the model adaptability. A brief description will be given of the data, data collection, and data process in chapter five. Chapter six presents the model results and analysis. Chapter seven is the discussion chapter, and in chapter eight, the conclusion can be found. Chapter 2

Background

There are many versions of gymnastics, but in Iceland, mainly two are practiced, artistic gymnastics and TeamGym. Artistic gymnastics is practiced individually, but TeamGym is in a team setting. In this chapter, both TeamGym and artistic gymnastics will be explained along with their disciplines/events, diculty levels, and scoring. Furthermore, the problem with sports scheduling will be defined as well as the current TeamGym scheduling process at FSÍ. This project will focus on the organization of TeamGym tournaments, but in chapter four, the model changes will be discussed so it can be used to create a tournament plan for artistic gymnastics. It is worth mentioning that the information about the disciplines/events was collected in cooperation with the CEO of FSÍ.

2.1 Artistic gymnastics

Artistic gymnastics is an , and it is one of the few sports that has been included in the Olympics since 1896. Since then, the equipment has changed, the diculty of training has become much more significant, and the sport has grown enormously due to the increased number of practitioners. The development of artistic gymnastics as it is practiced today began in the 19th century [2]. In this section, disciplines in artistic gymnastics and the main rules on each discipline will be explained, along with their diculty levels and scoring.

2.1.1 Disciplines in artistic gymnastics

In artistic gymnastics, the disciplines vary depending on whether it is in women’s or men’s categories. Women’s artistic gymnastics includes four separate events; vault, uneven parallel bars, balance beam, and floor exercise. On the other hand, there are six in men; floor, pommel horse, rings, vault, even parallel bars, and high bar. On all events, diculty exercises vary by levels, where exercises with higher degrees of diculty can receive more points. Table 2.1 shows women’s and men’s disciplines in artistic gymnastics, and below the table, a brief explanation of each discipline can be found. .. ARTISTIC GYMNASTICS 3

Table 2.1: Women’s and men’s disciplines in artistic gymnastics

Women Men Vault Vault Uneven parallel bars Even parallel bars Balance beam Pommel horse Floor Floor Rings High bar

Vault Both women and men compete in vaulting, where gymnasts run on a mat and vault over an apparatus. First, the gymnast must jump with both hands on to the apparatus, and then it is necessary to perform turns and twist in the air to raise the score before landing on their legs again.

Figure 2.1: Vault [3]

Bars events Women compete in uneven parallel bars, and men compete in even parallel bars and high bar, sometimes referred as the circus discipline. All three events require the gymnasts to twist, tumble and turn on the bars without touching the ground.

Figure 2.2: High bar [4] Figure 2.3: Even parallel bars [5]

Figure 2.4: Uneven parallel bars [3] 4 CHAPTER . BACKGROUND

Floor exercises Both men and women compete in floor exercises where requirements vary by level. The floor routine must include exercises where the gymnast shows agility, strength, balance, and jumping exercises. The main dierence between floor exercises for men and women is that women gymnasts perform with music where dance movements and artistry in rehearsals must be shown during the exercise.

Figure 2.5: Floor exercises [6] [7]

Balance beam Women compete on a balance beam, which is only 10 cm wide, 5 m long, and 125 cm high [8]. Balance beam requirements vary by level, but in most levels, the gymnast needs to perform exercise forwards/sideways and backwards and perform a complete rotation on one leg. Additionally, two interconnected exercises must be performed where at least one exercise is a salto.

Figure 2.6: Balance beam [9]

Pommel horse The pommel horse is considered to be the most challenging discipline in men’s gymnastics [10]. It requires a lot of strength for the gymnast to support himself by his hands alone above the horse in a series of circular movements, and the gymnast can not stop the movements except when the exercise is completed.

Figure 2.7: Pommel horse [3]

Rings In ring routines, the gymnast is required to perform swing exercises, strength exercises, and a jump-o while keeping the rings still. It demands enormous strength and diligence to be able to perform such exercises. .. ARTISTIC GYMNASTICS 5

Figure 2.8: Rings [3]

2.1.2 Levels in artistic gymnastics In Iceland, the gymnastics clubs follow the Icelandic Gymnastics Ladders, which aim to strengthen Icelandic gymnastics. Its goal is to support teaching gymnastics at all levels of gymnastics, allowing practitioners to learn competitive exercises and participate in competi- tions among peers. The first ladder was published in 1985, and it is issued every four years, at the beginning of each Olympic season, and is in line with the international refereeing rules of The International Gymnastics Federation (FIG) called Code of Point [11] [12]. The gymnastics ladder is made up of six levels for men and eight levels for women. It is intended for training and competitions in artistic gymnastics. Levels 1-5 are the upper levels of the ladder that compete both at FSÍ tournaments and invitational and intra-community tournaments. Levels 6-8 do not compete at FSÍ tournaments. These practitioners take their first steps in the sport and only perform compulsory exercises for a status assessment at invitational tournaments and intra-community tournaments. In addition to the ladder, there is a competition in free routines, which is the highest level of ability in artistic gymnastics. There the competition is only according to the Code of Points. Therefore it is said to be o the Icelandic Gymnastics ladder [11] [12]. Table 2.2 shows the expected age range as well as the appropriate tournaments for each level. Table 2.2: Age range of each level and relevant tournaments [8] [10]

Age Level Tournaments 6-7 8 Invitational and intra-community tournament 7-8 7 Invitational and intra-community tournament 8-9 6 Invitational and intra-community tournament 9-10 5 Level tournament 1, 2 & 3 10+ 4 Level tournament 1, 2 & 3 11+ 3 Autumn-, Level-, Cup tourn. & Icelandic Championship 12+ 2 Autumn-, Level-, Cup tourn., Icelandic- & GK championship 12+ 1 Autumn-, Level-, Cup tourn., Icelandic- & GK championship 13+ Free routines Autumn-, Level-, Cup tourn., Icelandic- & GK championship

2.1.3 Scoring in artistic gymnastics In artistic gymnastics, the scoring for each event is based on two ratings, a D rating, and an E rating. The D rating consists of diculty values, special requirements, and bonuses for interconnections. The E rating starts at 10.0, and deductions from the rating are made for 6 CHAPTER . BACKGROUND

each implementation error. Deductions can be 0.1, 0.3, and 0.5, but every time a gymnast falls, the minus is 1.0. In levels 6-8, the score for every event is only based on the E rating, but in other levels, the final score for each event is combined of ratings D and E [11] [12]. The maximum score for each level is as follows:

Table 2.3: Maximum score for each level [12] [11]

Level Score Level 6-8 10.0 Level 2-5 17.0 Level 1 According to Code of Points and The Icelandic Gymnasts ladder Free routines According to Code of Points

To better understand the score in artistic gymnastics, the highest score in men’s and women’s free routines from the last Cup tournament can be seen in table 2.8.

Table 2.4: Highest score in men’s and women’s free routines from the Cup tourn. in 2020 [13]

Category Vault Floor Beam U-parallel bars E-parallel bars High bar Pommel horse Rings Total Men’s 13.250 13.250 x x 12.150 12.600 11.050 12.200 74.500 Women’s 13.266 11.700 12.500 12.033 x x x x 49.499

2.2 TeamGym

In recent decades, there has been a development in group gymnastics, now called TeamGym. The first competition in TeamGym was held in in 1996 [14]. The sport has become very popular throughout Europe, especially in the Nordic countries [15]. In this section, TeamGym disciplines and the main rules for each event will be explained along with the TeamGym divisions and scoring.

2.2.1 TeamGym events In TeamGym, each team consists of eight to ten gymnasts except in younger categories where teams may have up to 15 gymnasts. Teams can compete in men’s, women’s, or mixed cate- gories. Each team must present performances to music on all three events, floor, tumbling, and trampet. On trampet and tumbling, each round consists of six gymnasts. On the other hand, teams in the youngest categories have between 6 and 12 competitors in each round. Dierent rules apply for the floor exercise where everyone in the team needs to take part in the routine.

Floor Floor routines can be from 75-165 seconds long and need to include nine diculty exercises, three jumps, two big jumps, and four balances, one of which must be a handstand held for at least two seconds. In addition to the diculty exercises that must be distributed evenly over the routine, special requirements must be met. These requirements include a group exercise, flexibility, and movement of all team members over the floor. .. TEAMGYM 7

Figure 2.9: Balance movement in floor exercises [3]

Tumbling Each team needs to perform three rounds of three interconnected exercises on the jumping track. The diculty of the jumps varies by category. Still, for every category, one round must be performed with forwards exercises, another with backwards exercises, and one round can be forwards, backwards, or mixed. The first round is called the team round, where everyone has to do the same jump; otherwise, the team gets points deducted.

Figure 2.10: Tumbling [16]

Trampet Each team needs to perform three rounds where one round must be over a vault, another without it, and one round may be either over a vault or not. Competitors are required to perform a salto, and in addition, there is a rotation requirement that varies between categories. The same goes for the first round of the trampet. In order for the team not to lose points, the team needs to perform a team round where everyone makes the same jump.

Figure 2.11: Trampet with vault [3] [17] 8 CHAPTER . BACKGROUND

Table 2.5: Women, men and mixed teams compete on same events in TeamGym

Women Men Mixed Floor Floor Floor Tumbling Tumbling Tumbling Trampet Trampet Trampet

2.2.2 TeamGym levels In Iceland, TeamGym follows the rules from the Code of Points (CoP) [18] as well as exceptions for each level. As the levels get higher, the diculty level increases, and the number of exceptions decreases. The CoP provides the basis of TeamGym exercises at all levels of regional, national, and international competitions. CoP also guides coaches and gymnasts, standardizes the refereeing of public competitions, and ensures that the best teams in any competition are identified. Like mentioned before in TeamGym, men and women compete separately or in a mixed (half male and half female) category. Each category has several levels in which all have two or three divisions, depending on the number of teams in each level. A-division is the best one, followed by B-division, and then comes the C-division. Today the two best levels, Senior and Junior, only have two divisions A and B but the other levels have all three. Table 2.6 shows all levels, divisions, and age of the gymnasts for each category in TeamGym in Iceland.

Table 2.6: Categories, levels and divisions in TeamGym [18]

Women Category Mixed Category Men Category Age Divisions Level 5 girls Level 5 mixed Boys younger 9 A,B,C Level 4 girls Level 4 mixed Boys younger 10-11 A,B,C Level 3 girls Level 3 mixed Boys older 12-13 A,B,C Level 2 girls Level 2 mixed Boys older 14-15 A,B,C Junior women Junior mixed Junior men 13-17 A,B Senior women Senior mixed Senior men 16+ A,B

2.2.3 TeamGym scoring In TeamGym, the scoring consists of three ratings, composition (C), diculty (D), and execution (E). The composition rating is based, among other things, on how the rounds are put together as mentioned in the subsection TeamGym events. For example, the jumping events, tumbling, and trampet must include a team round, at least one round forwards, and one backwards. The floor exercise must contain flexibility and group elements, a rhythmic sequence requirement, and a diculty distribution requirement. If those requirements are missing, the team gets points deducted. All events have an open rating in diculty which means, teams that perform more dicult elements get a higher score in this rating if they succeed. The execution rating is the same as in artistic gymnastics; it starts at 10.0, and deductions are made for each implementation error. Deductions can be 0.1, 0.2, 0.3, 0.4, 0.7 or 1.0. Teams can also get additional execution deductions. For example, if a team has a wrong number of gymnasts competing (1.0 in deduction per missing or extra gymnast) and if a gymnast falls from a standing position, or a hand supported balance to their butt, back, stomach, or side (deduction 0.3 each time per gymnast) [18]. .. THE TEAMGYM SCHEDULING PROBLEM 9

The final score for each event is the combined score of ratings C, D, and E. In Table 2.7 the maximum score for each rating can be seen. Furthermore, to better understand what scores teams are getting for each event, Table 2.8 shows the results of all events from the last Cup tournament of 2020 in the senior women’s category.

Table 2.7: Maximum score for each rating [18]

Rating Floor Tumbling Trampet Composition (C) 4.0 2.0 2.0 Diculty (D) Open Open Open Execution (E) 10.0 10.0 10.0

Table 2.8: Top 3 senior women’s teams from the Cup tournament in 2020 [13]

Team Floor Tumbling Trampet Total score Stjarnan 21.700 17.700 16.550 55.950 Gerpla 19.500 16.800 15.950 52.250 ÍA 17.575 14.100 11.650 43.325

2.3 The TeamGym Scheduling Problem

The TeamGym scheduling problem involves arranging teams for certain events in a specific round at a relevant tournament. The main requirement is to generate a fair schedule that meets certain requirements. To make the schedule as short and fair as possible, it is optimal to assign three teams to compete at dierent events during each round. There are three events in TeamGym, floor, tumbling, and trampet. All teams must compete in all events to have a chance to win the tournament. Each team can only compete in one event per round. It must also be taken into account that the time between events is neither too short nor too long. The preferred competition order in TeamGym is floor, tumbling, and then trampet. Due to time limitations, it is not possible to let all teams compete in their preferred order. In television broadcasts, tournaments are usually structured so that the more inferior teams start and the better teams end up competing in the final rounds to maximize the spectator entertainment before the award ceremony. Another constraint that may be taken into consideration is that the top two teams should compete one after the other in the same sequence of events so that it is more dicult to find out who wins until the final points of both teams have tallied.

2.4 The Current Scheduling Process

The scheduling process at FSÍ is rather manual but to get a better insight into the process, Sólveig Jónsdóttir and Íris Svavarsdóttir were contacted [19]. Sólveig is the CEO of FSÍ and Íris was in charge of TeamGym tournament planning for many years at FSÍ. Today the process is such that every gymnastics club registers teams to a relevant tournament. With the registration, coaches need to submit music and jumping sheets that contain information about the jumps that will be performed at the tournament. A rather simple Excel document 10 CHAPTER . BACKGROUND is used for tournament planning at FSÍ where teams are arranged by events and rounds. They start by placing three teams together in a round, all on one event. When all the teams have competed on the first event, the teams from the first round start competing on the second event, and so on. What happens with this method is that the teams always compete in the same order of rounds, but the teams shue internally in each round, so the teams compete on all events. If teams need to make changes to the schedule, they are asked to switch places amongst themselves. Usually, this works, but otherwise, if there are other special requests, they can contact FSÍ, which tries to meet the team’s requirements. Sólveig provided a used tournament schedule which can be seen in Figure 2.12.

Figure 2.12: Schedule from the 2nd Cup tournament in 2021

There are seven tournaments in Iceland [18]. Table 2.9 shows which levels and divisions are competing in which tournaments. The season begins with the 1st Icelandic Championship, where only A division teams in Senior and Junior categories compete. Next comes the Autumn Tournament, where B division teams in the Senior and Junior categories compete with all teams at other levels except the youngest competitors from level five. The result from the Autumn Tournament divides teams from category two and lower into divisions A, B and C. There are two Cup Tournaments, where the number of teams is approximately divided equally between tournaments. The final two tournaments are the Spring Tournament for divisions B and C in all levels and then the 2nd Icelandic Championship for all A-division teams.

Table 2.9: TeamGym tournaments [18]

Tournaments Senior Junior level 2 level 3 level 4 level 5 y-boys o-boys 1st Icelandic champ. A A Autumn tournament B B A,B,C A,B,C A,B,C A,B,C A,B,C GK tournament A A 1st Cup tournament A,B A,B A,B,C A,B,C A,B,C 2nd Cup tournament A,B,C A,B,C A,B,C Spring tournament B B B,C B,C B,C B,C B,C B,C 2nd Icelandic champ. A A A A A A A A Chapter 3

Literature Review

In this chapter, scheduling literature related to this study will be reviewed. Furthermore, methods and techniques that have been used in previous research with similar goals will be outlined.

3.1 Scheduling problems

Scheduling is one of the most researched areas of operational research, mainly due to the rich variety of dierent types of problems within the field [20]. Production scheduling is often identified with Frederick Taylor, Henry L. Gantt, and Selmer M. Johnson [21]. The Principles of Scientific Management was published in 1911 by Fredrick Taylor [21]. In this work, he highlights the benefits of applying scientific methods in company management. He also separated execution from planning. This became a critical factor since, during this time, manufacturing companies were growing more complex [22]. Gantt supported Taylor’s work, and to improve the decision making he invented the Gantt charts, that compare the planned production to the actual production. Following this, an American mathematician named Johnson published an influential paper on the mathematical analysis of production scheduling problems [22]. These three individuals each had their own vision on how to improve production scheduling problems; Taylor developed the organization, Gantt created tools that help to improve the process of the decision making, and Johnson solved optimization problems [22]. Production scheduling problems are usually divided into three categories; open shop, job shop, and flow shop. As is stated in [23], an open shop problem has no constraints regarding the routing of each job through the production process. A job shop environment is when the route is predetermined for each product. A flow shop environment is where each job has to follow the same route through the production process. The problem considered in this study is classified as an open shop scheduling problem (OSSP). An OSSP diers from a flow shop and a job shop schedules in that no restrictions are placed on the order in which the tasks for any job are to be processed. OSSP is a well-known subject which belongs to one of the most important issues in the engineering sector [24]. OSSP is classified as a NP hard problem that can be solved by using either Constraint Programming or Operation Research methods according to article [25]. This article furthermore states that these kinds of problems have a wider solution space than other basic scheduling problems, f.x. Job-shop and flow-shop scheduling. As stated in [24], many researchers have been attracted to this problem over the past decades and many algorithms have been proposed because of this fact. Branch-and-bound 12 CHAPTER . LITERATURE REVIEW algorithm [26], Genetic Algorithms [27] and multi-agent systems [28] are all an example of dierent types of OSSP algorithms. The OSSP are nevertheless as diverse as the algorithms including, minimization of; total tardiness of all jobs [29], makespan [30], sum of completion times of jobs [31] and the of sum of weighted tardiness of all jobs [25]. As stated in [23], an open shop is a scheduling problem with i jobs and j machines, where jobs visit all machines at most once where no restrictions are regarding the routing of each job. For this problem, the jobs are the teams, and the machines are the events, where all teams need to compete on all events at most once. However, this study seeks to ensure fairness between teams, which includes all teams wanting to go the same “correct route”. Due to the time limit, the model will break soft constraints regarding the teams’ route, and the schedule will receive penalty points.

3.2 Fairness in scheduling The concept of ‘fairness’ is shapeless and challenging to define [32]. The main reason is that it can have an extensive meaning depending on the study. Correspondingly, there are many fewer studies on the ‘fairness’ of scheduling policies than on the ‘performance’ of scheduling policies. Adam [32] describes the tradition of scheduling policies, where the focus has been on performance metrics such as queue length, production rate, and response time. Furthermore, he dictates the significance of fairness and mentions how fairness in scheduling can often be as important or even more important than optimizing traditional performance measures. For example, while minimizing the mean response time between customers, it can be important to ensure that individual customers/jobs are treated ‘fairly’. Ajtai, Aspnes, Naor, Rabani, Schulman, and Waarts [33] state that the unfairness of a system is calculated by the maximum dierence between the desired and actual load overall processes (e.g., the carpool problem suggested by Fagin and Williams [34]). All kinds of scheduling has been studied substantially, but the fundamental issue of fairness in scheduling is mainly considered open and has usually not been considered quan- titatively. In the past decade, there has been a rising focus on fairness in scheduling (e.g., see [35] about fairness in sta scheduling and [36] about fairness in production scheduling). Chapter 4

Model

In this chapter, a gymnastic tournament scheduling problem is modeled as an optimization problem using binary and integer variables. The mathematical function is linear, and all the variables take integer values. The data used for this problem is data provided by FSÍ and adapted to their scheduling needs. The model’s objective is to minimize penalties and find the fairest scheduling plan for each team. That is done by minimizing the weight factors that occur if soft constraints are broken while satisfying all hard constraints. Section 4.1 consists of general features of the model where sets, subsets, and parameters necessary to build the model are described. Variables regarding the model can be found in Section 4.2, and constraints can be found in Section 4.3. The objective function is explained in Section 4.4. In Section 4.5, the model itself is represented from beginning to end. Finally, in Section 4.6, the model adaptability is explored.

4.1 General features of the model

In this section, the model’s sets and subsets will be defined as well as outline the parameters used in the model.

4.1.1 Sets The model uses four sets that define the structure for the model’s approach. These sets represent teams, events, rounds, and competition periods. To simplify the model, subsets are formed from the sets.

) Set of teams competing in the tournament. The teams are denoted with the letter C ), C = 1, 2,..., ) 2 { | |} ⇢ Set of events in the tournament. The events are denoted with the letter 4 ⇢, 2 4 = 1, 2,.., ⇢ . { | |} ' Set of rounds in the tournament. The rounds are denoted with the letter A ', 2 A = 1, 2,..., ' { | |} % Set of competition periods in the tournament where each period contains 7 adjacent rounds, e.g. period 1 includes rounds 1-7, period 2 includes rounds 2-8 and so on until the final round has been placed in a competition period. The competition periods are denoted with the letter ? %, ? = 1, 2,..., % 2 { | |} 14 CHAPTER . MODEL

Subsets )⇢ Set of teams and events. If C, 4 )⇢, then team C can be assigned to event 4. ( ) 2 )' Set of teams and rounds. If C, A )', then team C can compete in round A. ( ) 2 ⇢' Set of events and rounds, indicating what event can occur in each round. If 4, A ⇢', then event 4 will be assigned to round A. ( ) 2 )% Set of teams and competition periods. If C, ? )%, then team C will be assigned ( ) 2 to competition period ?.

)⇢' Set of teams, events and rounds. If C, 4, A )⇢', then team C can compete on ( ) 2 event 4 in round A.

4.1.2 Parameters In this subsection, the parameters for the model will be described.

Weighted parameters Soft constraints are allowed to be violated against a penalty score. Penalties have dierent weight factors depending on how serious it is to break the relevant constraint. The weight factors are represented with the letter W and a number corresponding to the relevant constraint in the model.

,4.9C,A Weight factor if a team competes more than once per round C, A )'. ( ) 2

,4.104,A Weight factor if an event happens more than once per round 4, A ⇢'. ( ) 2

,4.11A Weight factor if more than three teams compete per round A '. 2

,4.12C Weight factor if a team competes on tumbling before floor C ). 2

,4.13C Weight factor if a team competes on trampet before floor C ). 2

,4.14C Weight factor if a team competes on trampet before tumbling C ). 2

,4.15C,A Weight factor if a team competes in back-to-back rounds C, A )'. ( ) 2

,4.16C Weight factor if a team competes in more than one competition period C ). 2 ,4.17 Weight factor if the team with the best recent performance does not compete in the last round.

,4.184,A Weight factor if the two teams with the best recent performances do not compete in the same order of events in back-to-back rounds 4, A ⇢'. ( ) 2

4.2 Variables

In Section 4.2, decision variables, penalty variables, and fairness variables for the model will be formulated, and a brief description of each variable will be given. .. VARIABLES 15

Decision variables The first set of decision variables decide whether a team is competing on a particular event in a specific round, where T is the set of teams, E is the set of events, and R is the set of rounds.

1, if team C ) competes on event 4 ⇢ in round A ' IC,4,A = 2 2 2 (4.1) (0, otherwise

The next set of variables 4.2 determines whether a team competes in a specific round which is helpful to keep track of which teams are competing in each round.

1, if team C ) competes in round A ' HC,A = 2 2 (4.2) (0, otherwise

The set of variables 4.3 determines whether a team competes in a specific competition period. This can be useful to envisage the teams’ rest time as the variable @C, ? keeps track of which teams are competing in a particular competition period.

1, if team C ) competes in competition period ? % @C,? = 2 2 (4.3) (0, otherwise

Penalty variables Penalty variables are binary variables that have a value of 1 if the constraint is violated but 0 otherwise. In this model, the penalty variables are represented with the letter P and a number corresponding to the relevant constraint, which is described in Section 4.3

%4.9C,A Penalty because a team competes more than once per round C, A )'. ( ) 2

%4.104,A Penalty because an event happens more than once per round 4, A ⇢'. ( ) 2

%4.11A Penalty because more than three teams compete per round A '. 2

%4.12C Penalty because a team competes on tumpling before floor C ). 2

%4.13C Penalty because a team competes on trampet before floor C ). 2

%4.14C Penalty because a team competes on trampet before tumpling C ). 2

%4.15C,A Penalty because a team competes in back-to-back rounds C, A )'. ( ) 2

%4.16C Penalty because a team competes in more than one competition period C ). 2 %4.17 Penalty because the team with the best recent performance does not compete in the last round.

%4.184,A Penalty because the two teams with the best recent performances do not compete in the same order of events in back-to-back rounds 4, A ⇢'. ( ) 2 16 CHAPTER . MODEL

Other variables In the model, the total penalty score is minimized, and all teams should be allocated penalty points in a fair way. To do so, the following variables are added to the model to ensure fairness amongst teams. %4=0;CHC is an integer variable that maintains a total penalty score for each team C ). On the other hand, 08A=4BB is a fairness variable. It is an integer 2 variable that takes the value of the highest total penalty any team receives.

%4=0;CHC 0 (4.4)

08A=4BB 0 (4.5)

4.3 Constraints In TeamGym tournament scheduling, many rules and constraints need to be considered. Regarding the constraints introduced in the model, it is worth mentioning that most of the constraints can easily be modified as well as new constraints can be added within the same framework. Constraints can either be hard or soft constraints. Hard constraints must be satisfied, but soft constraints are allowed to be violated against a penalty score.

4.3.1 Hard constraints The hard constraints are mainly based on what all teams must satisfy at all times to be able to compete in a tournament. All of the hard constraints are the same for all teams. The following hard constraints are considered in the model:

The first constraint (4.6) makes sure that all teams compete exactly once per event.

IC,4,A = 1 C, 4 )⇢ (4.6) 8 ( ) 2 A ' ’2 Constraint (4.7) connects the variables, IC,4,A and HC,A . This is done to monitor whether team t is competing in round r. This constraint is useful for constraint (4.11) in the model.

HC,A IC,4,A C, 4, A )⇢' (4.7) 8 ( ) 2 Constraint (4.8) connects IC,4,A to @C, ?, so if team t competes on event e in a round r then the team must also be assigned a competition period p.

@C,? IC,4,A C, 4, A )⇢' (4.8) 8 ( ) 2 ?:A % ’2 4.3.2 Soft constraints As mentioned, if a soft constraint is violated, the schedule receives a penalty score. The total penalty depends on the type of constraint as well as how often each one is violated. Each penalty has a weight factor, which depends on how severe the violation of the relevant constraint is. More information about the weight factors can be found in chapter five. The soft constraints in the model are as follows: Constraint (4.9) ensures that all teams compete at a maximum of once per round. .. CONSTRAINTS 17

IC,4,A 1 %4.9C,A C, A )' (4.9)  + 8 ( ) 2 4 ⇢ ’2 The next constraint makes sure that each event happens at a maximum of once per round.

IC,4,A 1 %4.104,A 4, A ⇢' (4.10)  + 8 ( ) 2 C ) ’2 Constraint (4.11) ensures that there is a maximum of three teams competing in each round.

HC,A 3 %4.11A A ' (4.11)  + 8 2 C ) ’2 As previously mentioned, there are three events in TeamGym. Every team wants to compete in the preferred order of events which is floor, tumbling, and then trampet. Un- fortunately, all teams can’t get their way due to time limits. The following three constraints help the model keep track of the event’s order for each team. If the order is not the preferred order, the team receives a penalty. Constraint (4.12) keeps track of the teams that compete on event two, tumbling, before event one, floor. If this is the case, the penalty variable gets activated, and the team receives a penalty.

' ' IC, ,A IC, ,A %4.12C C ), A ' (4.12) 1 ˆ 2 ˆ  8 2 2 ’Aˆ=A ’Aˆ=A Constraint (4.13) keeps track of which teams compete on trampet before floor. This is not the preferred order of events, and therefore the teams receive a penalty.

' ' IC, ,A IC, ,A %4.13C C ), A ' (4.13) 1 ˆ 3 ˆ  8 2 2 ’Aˆ=A ’Aˆ=A In constraint (4.14), the penalty gets active when a team competes on event number three, trampet, before event number two, tumbling.

' ' IC, ,A IC, ,A %4.14C C ), A ' (4.14) 2 ˆ 3 ˆ  8 2 2 ’Aˆ=A ’Aˆ=A The following constraint ensures that teams do not compete in consecutive rounds because it is required that teams get at a minimum amount of rest between events.

IC,4,A IC,4ˆ,A 1 1 %4.15C,A C ), A 1, 2,..., ' 1 (4.15) + +  + 8 2 2 { | | } 4 ⇢,4ˆ ⇢ˆ:4<4ˆ 2 ’2 ⇣ ⌘ In order to make sure that the rest between events does not get too long, it is convenient for each team to be assigned to one competition period. That means the teams compete on all events in the same competition period. As mentioned before, each period includes seven rounds. Constraint (4.16) tries to satisfy the following request.

@C,? 1 %4.16C C ) (4.16)  + 8 2 ? % ’2 18 CHAPTER . MODEL

FSÍ requests that the team with the best recent performance should compete in the last round. Constraint (4.17) tries to satisfy this request.

I⌫4BC,4,' = 1 %4.17 (4.17) + 4 ⇢ ’2 Constraint (4.18) is to make the tournament more exciting. The two teams with the best recent performance should compete in the same series of events in adjacent rounds. It ensures more tension so that it is not possible to find out who is the winner until the final scores of both teams have been shown.

I2=3⌫4BC,4,A = I⌫4BC,4,A 1 %4.184,A 4 ⇢, A 1, 2,..., ' 1 (4.18) + + 8 2 2 { | | } Constraint (4.19) keeps track of the total penalty score for each team. This constraint is useful for constraint (4.20) in the model.

%4.9C,A ,4.9C,A %4.12C ,4.12C %4.13C ,4.13C (4.19) ⇤ + ⇤ + ⇤ A ' A ' A ' ’2 ’2 ’2 %4.14C ,4.14C %4.15C,A ,4.15C,A + ⇤ + ⇤ A ' A ' ’2 ’2 %4.16C ,4.16C %4=0;CHC C ) + ⇤  8 2 ? % ’2 A fairness constraint was made for the model. The fairness variable is compared to the total penalty variables and always bears the same value as the highest value from the previously mentioned constraint (4.19). The fairness variable is minimized in the objective function that causes penalties to be more evenly distributed between teams.

%4=0;C84BC 0A8=4BB C ) (4.20)  8 2

4.4 Objective function The objective function is twofold. On the one hand, it aims to minimize the fairness variable, which causes total penalties to be more evenly distributed between teams. On the other hand, the model aims to minimize the sum of penalty variables where each variable has a dierent weight factor depending on how serious the violation is to the relevant constraint. .. THE MODEL 19

4.5 The model

<8= %4.9C,A ,4.9C,A %4.104,A ,4.104,A ⇤ + ⇤ + C ) A ' 4 ⇢ A ' ’2 ’2 ’2 ’2 %4.11A ,4.11A %4.12C ,4.12C %4.13C ,4.13C + ⇤ + ⇤ + ⇤ A ' C ) C ) ’2 ’2 ’2 %4.14C ,4.14C %4.15C,A ,4.15C,A %4.16C ,4.16C + ⇤ + ⇤ + ⇤ C ) C ) A ' C ) ’2 ’2 ’2 ’2 %4.17 ,4.17 %4.184,A ,4.184,A 0A8=4BB + ⇤ + ⇤ + C ) 4 ⇢ A ' ’2 ’2 ’2

B.C. IC,4,A = 1 C, 4 )⇢ (4.6) 8 ( ) 2 A ' ’2

HC,A IC,4,A C, 4, A )⇢' (4.7) 8 ( ) 2

@C,? IC,4,A C, 4, A )⇢' (4.8) 8 ( ) 2 ?:A % ’2

IC,4,A 1 %4.9C,A C, A )' (4.9)  + 8 ( ) 2 4 ⇢ ’2

IC,4,A 1 %4.104,A 4, A ⇢' (4.10)  + 8 ( ) 2 C ) ’2

HC,A 3 %4.11A A ' (4.11)  + 8 2 C ) ’2 ' ' IC, ,A IC, ,A %4.12C C ), A ' (4.12) 1 ˆ 2 ˆ  8 2 2 ’Aˆ=A ’Aˆ=A ' ' IC, ,A IC, ,A %4.13C C ), A ' (4.13) 1 ˆ 3 ˆ  8 2 2 ’Aˆ=A ’Aˆ=A ' ' IC, ,A IC, ,A %4.14C C ), A ' (4.14) 2 ˆ 3 ˆ  8 2 2 ’Aˆ=A ’Aˆ=A

IC,4,A IC,4ˆ,A 1 1 %4.15C,A C ), A 1, 2,..., ' 1 (4.15) + +  + 8 2 2 { | | } 4 ⇢,4ˆ ⇢ˆ:4<4ˆ 2 ’2 ⇣ ⌘

@C,? 1 %4.16C C ) (4.16)  + 8 2 ? % ’2

I⌫4BC,4,' = 1 %4.17 (4.17) + 4 ⇢ ’2

I2=3⌫4BC,4,A = I⌫4BC,4,A 1 %4.184,A 4 ⇢, A 1, 2,..., ' 1 (4.18) + + 8 2 2 { | | } 20 CHAPTER . MODEL

%4.9C,A ,4.9C,A %4.12C ,4.12C %4.13C ,4.13C (4.19) ⇤ + ⇤ + ⇤ A ' A ' A ' ’2 ’2 ’2 %4.14C ,4.14C %4.15C,A ,4.15C,A + ⇤ + ⇤ A ' A ' ’2 ’2 %4.16C ,4.16C %4=0;CHC C ) + ⇤  8 2 ? % ’2

%4=0;C84BC 08A=4BB C ) (4.20)  8 2

%4=C0;CHC 0 (4.4)

08A=4BB 0 (4.5)

IC,4,A , HC,A , @C,B 0, 1 { } 2 { }

%4.9C,A , %4.104,A , %4.11A , %4.12C, %4.13C, { %4.14C, %4.15C,A , %4.16C, %4.17, %4.184,A 0, 1 } 2 { } 4.6 Model adaptability The model is developed for TeamGym gymnastics in Iceland. The flexibility of the model nevertheless allows for tackling problems of larger and smaller sizes. It is easy to add or remove constraints to adapt to each scenario, e.g. the model could be adapted for artistic gymnastics, which is also very popular in Iceland. In Subsection 4.6.1, the changes of the model will be discussed so it can be used to create a tournament plan for artistic gymnastics in Iceland.

4.6.1 Changes to the model The model requires minimal adjustment to be able to use it for artistic gymnastics. To begin with, it would be necessary to classify and divide the competitors into groups that compete on the same discipline in the same round. Each group then acts as a team compared to the TeamGym plan. Unlike TeamGym, all events happen simultaneously, so the length of each round is determined by the largest group competing in the following round. The groups are at least four in the women’s category and six in the men’s category, which is the same as the number of disciplines. If there are more groups, they get a rest break between events. No new variables need to be added to the model, but some constraints need to be changed. For constraint (4.11), it must be ensured that the number of groups competing in each round varies depending on whether the competition is in the men’s or women’s category. The preferred order of events constraints, (4.12) - (4.14), need to be updated and increased since there are more disciplines in artistic gymnastics. In addition, constraint (4.19) needs to be updated with relevant penalties and weigh factors. The constraints that do not apply to the artistic gymnastics model are as follows; (4.15), (4.16), (4.17) and (4.18). The back-to-back constraint (4.15) is not applicable for artistic .. MODEL ADAPTABILITY 21 gymnastics because each group of gymnasts gets enough rest while competitors in the group are competing in each round. In this case, there should rather be a constrain that encourages groups to compete in consecutive rounds. The constraint that the best-performed group should compete in the last round does not apply since it can be dicult to choose which group consists of the best competitors. The same applies to the constraint regarding that the two best-performed groups should compete in the same series of events in adjacent rounds. In this case, the number of groups is never too high, which means that the number of rounds will not be too high either. Therefore, the competition period constraint (4.16) is not applicable. The research objective for this project is to create a mathematical model that generates a fair tournament schedule for FSÍ. The overall aim is to automate the process of generating tournament schedules by minimizing scheduling time, reducing errors, and meeting as many requirements as possible while delivering a fair feasible solution to all competitors. Other constraints in the model can remain the same. The aim of the objective function would still be the same, to minimize the fairness variable and minimize the sum of penalty decision variables. The weight factors for the penalties would subsequently be decided in collaboration with FSÍ. Furthermore, FSÍ could also request that more constraints be added to feel appropriate for the model. Chapter 5

Data

In this chapter, a brief description will be given of the data. Section 5.1 describes the data collection along with the necessary information. The data processing is described in Section 5.2, and Section 5.3 consists of the required input for the model.

5.1 Data collection

The data required for the model consists of information about the teams, events, and rounds. Team information includes the number of teams in the tournament, which ones are competing each year, and information on who the two best teams are. FSÍ provided an Excel sheet with the teams competing at all tournaments, but data regarding the two best teams need to be done manually for each competition as it constantly changes. The events’ data consist of how many the events are, how often each event can happen in each round, among the preferred order of events. Regarding the rounds in the tournament, the total number of rounds is needed as well as how many teams are allowed to compete in each round. Data regarding the rounds and events were collected through interview with Íris, the former scheduling manager at FSÍ, as well as through emails, Facebook messages, and phone calls with Íris and Sólveig, the CEO of FSÍ. The current scheduling process was furthermore discussed with Íris, and FSÍ provided an Excel sheet with old tournaments. It should also be mentioned that additional data was gathered from FSÍ concerning the weight factors. The data used for the model is a combination of qualitative and quantitative. The majority of the data is numerical and classified as quantitative data. On the other hand, ensuring fairness between teams is mainly based on individuals’ opinions about what they think is fair which also makes the data of the model qualitative.

5.2 Data process

The data process can be seen in Figure 5.1. First, all the data was collected from emails, Facebook messages, phone calls, interviews, and Microsoft Excel documents. When the data collection was completed, all the data was processed in Microsoft Excel, and other important information for the model was recorded in a Microsoft Word document. Pandas software library was used to read the data from Excel to Python, the programming language that was used to program the model. .. MODEL INPUT 23

Figure 5.1: Flow of the data process

5.3 Model input The model is suitable for all TeamGym tournaments in Iceland. The data used in this case is from level 4 in women’s category, as it is one of the biggest competitions here in Iceland. Tables 5.1 and 5.2 show the data needed for the model. The list of teams competing is read from an Excel sheet, but the information about the two teams with the best recent performance is done manually, together with the number of events and time slots. In this model input, the best teams were said to be the first two teams from the Excel document. The events are three in TeamGym, and for this model, it was decided that each competition period should include seven rounds. The first period includes rounds 1-7, the next period rounds 2-8 and so on until the final round has been placed in a competition period. Regarding the number of rounds, FSÍ usually wants to have the tournaments as short as possible, so the minimum number of rounds is the same as the number of teams.

Table 5.1: List of teams competing Table 5.2: Other data needed for the model

Teams competing Other data ùór1 Fjölnir2 Data for test case one: ùór2 Höttur1 No. of rounds 24 ÍA1 Höttur2 No. of events 3 ÍA2 Selfoss1 No. of competition periods 18 ÍA3 Selfoss2 The best team ùór1 ÍA4 Kefavík 2nd best team ùór2 Afturelding1 Fimak1 Data for test case two: Afturelding2 Fimak2 No. of rounds 12 Gerpla1 Stjarnan1 No. of events 3 Gerpla2 Stjarnan2 No. of competition periods 6 Gerpla3 Grótta The best team ùór1 & Fjölnir2* Fjölnir1 Ármann 2nd best team ùór2 & Höttur1*

* In test case two, the tournament schedule is split into two equal parts, where both parts have a best and a 2nd best team. 24 CHAPTER .DATA

To be able to get a fair result from the model, weight factors need to be added. As stated above, all penalties have dierent weight factors depending on how serious it is to break the relevant constraints. It is more dicult to break the constraints that have higher weight factors. The weight factors can easily be changed, but the factors used for this model can be seen in table 5.3.

Table 5.3: Weight factors for TeamGym tournaments

W4.9 W4.10 W4.11 W4.12 W4.13 W4.14 W4.15 W4.16 W4.17 W4.18 1000 850 850 300 300 200 500 500 50 100 Chapter 6

Results

In this chapter, the model’s results will be presented along with the model size and other relevant information.

6.1 Model results As mentioned in chapter five, the programming language Python was used to program the mathematical model. A Gurobi solver extension called Gurobipy was used for the optimization. The model presented in chapter four and the data from chapter five were run together to get the model’s results. Two test cases were performed for the model. Test case one had all 24 teams competing in the same tournament part, while the other test case divided the teams into two groups that would compete in separate parts of the tournament. FSÍ usually uses case two when planning their tournaments.

6.1.1 Results from test case one The mathematical model for test case one contains 4273 integer variables (4248 binary) and 11182 constraints. The model’s runtime was rather long. After 10 hours, a feasible optimal solution was found with a value of 5300. The model violates 12 constraints that can be seen in Table 6.1. Total penalty scores for each team can be seen in Table 6.2 and moreover the final tournament schedule is found in Table 6.3. Due to limited space, the table has been divided, so the results are more visible. The table shows in which round each team competes for every event. The events are color-coded, floor is red, tumbling is blue and trampet is green. This is useful when reading the table to see if teams compete in the preferred order of events. The preferred order of colors should be red, blue and then green read from top to bottom for each team. In addition, it can be easily seen if teams break the competition period constraint, which ensures teams competing on all events within seven rounds. The results for test case one show that all four teams that receive a penalty score break constraints (4.13) and (4.16). Two of the teams then violate constraint (4.12) and the other two constraint (4.14). 26 CHAPTER . RESULTS

Table 6.1: Number of violated constraints for test case one

Violated constraints No. of violations Weight factors Team competes on tumbling before floor (4.12) 2 300 Team competes on trampet before floor (4.13) 4 300 Team competes on trampet before tumbling (4.14) 2 200 Team competes in more than one competition period (4.16) 4 500

Table 6.2: Total penalty score for test case one

Teams Total penalty score ùór1 1000 ùór2 1000 Fjölnir2 1100 Höttur1 1100 .. MODEL RESULTS 27

Table 6.3: Tournament schedule for test case one (due to limited space the table has been divided)

fiór1 fiór2 ÍA1 ÍA2 ÍA3 ÍA3 Afturelding1 Afturelding2 Gerpla1 Gerpla2 Gerpla3 Ármann Round 1 Trampet Round 2 Trampet Round 3 Floor Round 4 Round 5 Tumbling Floor Round 6 Round 7 Trampet Floor Tumbling Round 8 Floor Round 9 Tumbling Floor Trampet Round 10 Floor Tumbling Round 11 Floor Trampet Tumbling Round 12 Tumbling Trampet Round 13 Tumbling Trampet Round 14 Trampet Round 15 Trampet Round 16 Round 17 Round 18 Floor Round 19 Floor Round 20 Tumbling Floor Round 21 Floor Tumbling Round 22 Floor Trampet Tumbling Round 23 Tumbling Trampet Round 24 Tumbling Trampet

Fjölnir2 Höttur1 Höttur2 Selfoss1 Selfoss2 Keflavík Fimak1 Fimak2 Stjarnan1 Stjarnan2 Grótta Fjölnir1 Round 1 Tumbling Floor Round 2 Tumbling Floor Round 3 Trampet Tumbling Round 4 Trampet Floor Tumbling Round 5 Trampet Round 6 Tumbling Floor Trampet Round 7 Round 8 Trampet Tumbling Round 9 Round 10 Trampet Round 11 Round 12 Floor Round 13 Floor Round 14 Tumbling Floor Round 15 Floor Tumbling Round 16 Floor Trampet Tumbling Round 17 Floor Tumbling Trampet Round 18 Tumbling Trampet Round 19 Tumbling Trampet Round 20 Trampet Round 21 Trampet Round 22 Round 23 Floor Round 24 Floor

6.1.2 Results from test case two As mentioned above, case number two gives a more similar schedule to FSÍ’s, where the teams are split into two equal groups. The first 12 teams are assigned to the first part of the tournament, and the other 12 teams to the second part. The mathematical model for test case two was solved for both parts, and the results were the same. Both results contain 1082 integer variables (1069 binary) and 2386 constraints. It was solved in approximately 2 minutes and is therefore significantly faster than the first test case. The optimal solution for both parts is 5000, and the number of constraints violated in the models are 16 and can be seen in Table 6.4. Total penalty scores for each team can be seen in Tables 6.5 and 6.6. The final tournament schedule for both parts is found in Tables 6.7 and 6.8. The tables are with the same color code as in test case one. Therefore, it should be easy to see if teams are competing in the preferred order of events as well as if teams break the competition period 28 CHAPTER . RESULTS

constraint. The results for test case two show that the teams that receive 600 as penalty score break constraints (4.12) and (4.13). While the teams receiving a penalty score of 500 brake constraints (4.13) and (4.14).

Table 6.4: Number of violated constraints for test case two (same results for both parts)

Violated constraints No. of violations Weight factors Team competes on tumbling before floor (4.12) 4 300 Team competes on trampet before floor (4.13) 8 300 Team competes on trampet before tumbling (4.14) 4 200

Table 6.5: Penalty score for part one Table 6.6: Penalty score for part two in case two in case two

Teams Penalty score Teams Penalty score ùór1 500 Fjölnir2 500 ùór2 500 Höttur1 600 ÍA3 600 Selfoss2 500 ÍA4 600 Keflavík 500 Afturelding1 600 Fimak1 600 Gerpla1 500 Stjarnan1 500 Gerpla2 600 Stjarnan2 600 Gerpla3 500 Grótta 600

Table 6.7: Tournament schedule for test case two, part one

fiór1 fiór2 ÍA1 ÍA2 ÍA3 ÍA4 Afturelding1 Afturelding2 Gerpla1 Gerpla2 Gerpla3 Ármann Round 1 Trampet Tumbling Floor Round 2 Floor Tumbling Trampet Round 3 Floor Trampet Tumbling Round 4 Tumbling Trampet Floor Round 5 Trampet Tumbling Floor Round 6 Trampet Tumbling Floor Round 7 Floor Tumbling Trampet Round 8 Trampet Floor Tumbling Round 9 Floor Trampet Tumbling Round 10 Floor Tumbling Trampet Round 11 Tumbling Floor Trampet Round 12 Tumbling Trampet Floor

Table 6.8: Tournament schedule for test case two - part two

Fjölnir2 Höttur1 Höttur2 Selfoss1 Selfoss2 Keflavík Fimak1 Fimak2 Stjarnan1 Stjarnan2 Grótta Fjölnir1 Round 1 Trampet Tumbling Floor Round 2 Floor Tumbling Trampet Round 3 Floor Trampet Tumbling Round 4 Tumbling Trampet Floor Round 5 Trampet Tumbling Floor Round 6 Trampet Tumbling Floor Round 7 Floor Tumbling Trampet Round 8 Trampet Floor Tumbling Round 9 Floor Trampet Tumbling Round 10 Floor Tumbling Trampet Round 11 Tumbling Floor Trampet Round 12 Tumbling Trampet Floor Chapter 7

Discussion

As seen in the results chapter, it is impossible to get a feasible solution without violating constraints. Both test cases found an optimal solution but the solving time dierentiated by almost 10 hours between the two cases. The model found it more challenging to find the optimal solution for the first test case when the model took around 10 hours to run but only 2 minutes for both parts in case two. One of the reasons why the model is taking such a long time to prove the optimal solution can be because the scheduling model has a lot of symmetry. Commonly, integer optimization models regarding scheduling have a great deal of symmetry. When that happens, the branch-and-bound method can be weak because the size of the tree that needs to be analyzed to find the optimal integer solution increases enormously in size. To improve the time that takes to solve the problem, a symmetry-breaking constraint can be added to the model in the future to enhance the model. When the cases are compared, it is seen that the optimal solution is better for case one since the optimal solutions for both parts in case two need to be combined. For case one, four teams received penalties because they all violated three constraints. For both parts, in case two, four more teams received penalties; however, each penalty was lower. When the model starts to break a constraint for a team, it is more likely to break another one for the same team rather than let some other team violate the constraint. For future models, something could be done to prevent this from happening. The computer that was used to run the model is from 2015. Therefore, a result could be reached faster with a newer and more powerful computer. Runtime should not be an issue for FSÍ as they plan the tournaments well in advance, and they could run the model for a few days or over the weekend. Furthermore, the model could be made more user-friendly, and it would be convenient to have Python deliver a more visual solution. The program only prints out basic results, which then needs to be worked on to create a table or something similar for FSÍ. Pandas software could also be used to return the solutions to Excel. In addition to these results, both of the test cases were compared to an old tournament from FSÍ. In Tables 7.1 and 7.2 an old FSÍ tournament for category 4 can be seen. Both parts include 12 teams and 12 rounds. Since three teams compete in each round, the resting period per team will be four rounds. This results that each team’s competition period is nine rounds but not seven like in the model. Regarding the preferred order of events, one-third of the teams satisfied the request, which is equal to the proportion obtained for test case one and two. Based on this old schedule, the penalty points of each team were calculated and set out in Tables 7.3 and 7.4. As the tables show, all 24 teams are being penalized by 500, 1000, or 1100, leading to a higher total penalty than previously assigned for both test cases. Comparison of penalty scores per team for both test cases and the old FSÍ tournament can be seen in Figure 7.1. As can be seen in the figure, test case one has few but relatively high 30 CHAPTER . DISCUSSION

penalty scores, test case two has a more even distribution of penalty scores where 16 out of 24 teams get violation points. Still, the teams from the old tournament all get penalty points in the range of 500-1100. These results further encourage that the model is providing a better and fairer solution.

Table 7.1: An old FSÍ tournament schedule - part one

fiór1 fiór2 ÍA1 ÍA2 ÍA3 ÍA4 Afturelding1 Afturelding2 Gerpla1 Gerpla2 Gerpla3 Ármann Round 1 Floor Trampet Tumbling Round 2 Floor Trampet Tumbling Round 3 Floor Tumbling Trampet Round 4 Floor Trampet Tumbling Round 5 Tumbling Floor Trampet Round 6 Tumbling Floor Trampet Round 7 Tumbling Trampet Floor Round 8 Tumbling Floor ’ Trampet Round 9 Trampet Tumbling Floor Round 10 Trampet Tumbling Floor Round 11 Trampet Floor Tumbling Round 12 Trampet Tumbling Floor

Table 7.2: An old FSÍ tournament schedule - part two

Fjölnir2 Höttur1 Höttur2 Selfoss1 Selfoss2 Grótta Keflavík Fimak1 Fimak2 Stjarnan1 Stjarnan2 Fjölnir1 Round 1 Floor Trampet Tumbling Round 2 Floor Trampet Tumbling Round 3 Floor Tumbling Trampet Round 4 Floor Trampet Tumbling Round 5 Tumbling Floor Trampet Round 6 Tumbling Floor Trampet Round 7 Tumbling Trampet Floor Round 8 Tumbling Floor Trampet Round 9 Trampet Tumbling Floor Round 10 Trampet Tumbling Floor Round 11 Trampet Floor Tumbling Round 12 Trampet Tumbling Floor

Table 7.3: Penalty scores from an old Table 7.4: Penalty scores from an old FSÍ tournament - part one FSÍ tournament - part two

Teams Penalty score Teams Penalty score ùór1 500 Fjölnir2 500 ùór2 500 Höttur1 500 ÍA1 1000 Höttur2 1000 ÍA2 1000 Selfoss1 1000 ÍA3 500 Selfoss2 500 ÍA4 500 Keflavík 1100 Afturelding1 1100 Fimak1 1100 Afturelding2 1100 Fimak2 1000 Gerpla1 1000 Stjarnan1 1000 Gerpla2 1000 Stjarnan2 1100 Gerpla3 1100 Grótta 500 Ármann 1100 Fjölnir1 1100 31

Figure 7.1: Comparison of penalty scores per team for both test cases and the old FSÍ tournament Chapter 8

Conclusion

In this thesis, a tournament scheduling problem was modeled with a mathematical model using integer programming. The model is designed to create fair tournaments by meeting as many requirements as possible from FSÍ and other stakeholders. To ensure fairness amongst teams in TeamGym tournaments, the following needs to be examined; the competition order of events and whether or not the break between rounds is too short or too long. Employees have always handled tournament planning within FSÍ by hand. As the sport has been growing rapidly in recent years, it is becoming increasingly to organize tournaments. Therefore, it is ideal to create a model that organizes and places teams into dierent rounds for the tournament schedule. The model will save time and cost as the employee can use the time for other things while the model is working. The model found it challenging to find the optimal solution for test case one since the problem has much symmetry. The solution that was found resulted in having fewer penalty scores than the old FSÍ tournament that was constructed manually. The model was quicker to arrive at the optimal solution for both parts in case two, where the teams were split into two equal groups. The first 12 teams are assigned to the first part of the tournament, and the other 12 teams to the second part. In case number two, the results showed both lower and fewer penalties than the old FSÍ tournament. According to the results, both test cases have their advantages and disadvantages. Case one has a better optimal solution but is not as fair as case number two as more teams distribute the penalties between themselves. Both cases can be of use to FSÍ, and it is up to them to decide which case to use. The goal of this project was to create a mathematical model using integer programming that generates a fair tournament schedule for TeamGym in Iceland. This goal has been achieved as well as the aim of automating the process of generating the tournament schedules while meeting as many requirements as possible. For future models, something could be done to prevent the model from breaking two constraints for the same teams while other teams do not get any penalty. Furthermore, for future works, the process could be made more user-friendly, and the results could be shown in a more visual way directly from the programming language. It would also be interesting to see if it is possible to use the model for other sporting events such as, e.g., decathlon in athletics. Of course, some changes to the model are necessary, but the basics should remain the same; all competitors need to compete in all disciplines exactly once, and everyone wants to compete in a preferred order with a suitable break between events. Bibliography

[1] Í. Í. Íslands. (2019). “IØkenndur 2019 eftir íΩróttagreinum”, [Online]. Available: htt ps://www.isi.is/um-isi/utgafa/tolfraedi/ (visited on 01/25/2021). [2] History of Gymnastics, en. [Online]. Available: https://www.sportsrec.com/ history-gymnastics-6622864.html (visited on 01/25/2021). [3] Gymnastics Vault Clipart - Silhouette Gymnast Clipart , Free Transparent Clipart - ClipartKey, en. [Online]. Available: https://www.clipartkey.com/view/ JhoxT_gymnastics-vault-clipart-silhouette-gymnast-clipart/ (visited on 05/22/2021). [4] Set female athletes gymnasts in artistic gymnastics silhouette Stock Vector, en-US. [Online]. Available: https://stock.adobe.com/images/set-female-athlet es-gymnasts-in-artistic-gymnastics-silhouette/181641240 (visited on 05/22/2021). [5] Pinterest, en. [Online]. Available: https://in.pinterest.com/pin/514325219938243216/ (visited on 05/22/2021). [6] Pinterest, en. [Online]. Available: https://www.pinterest.es/pin/312296555397795182/ (visited on 05/22/2021). [7] Handstand Yoga Man Male Silhouette - Male Gymnast Clip Art , Free Transparent Clipart - ClipartKey, en. [Online]. Available: https://www.clipartkey.com/ view/wRThix_handstand- yoga- man- male- silhouette- male- gymnast- clip/ (visited on 05/22/2021). [8] Um áhaldafimleika kvenna, is. [Online]. Available: https://fimleikasamband. is/um-ahaldafimleika-kvenna/ (visited on 04/30/2021). [9] Pinterest, en. [Online]. Available: https://www.pinterest.com/pin/200902833359972312/ (visited on 05/22/2021). [10] Um áhaldafimleika karla, is. [Online]. Available: https://fimleikasamband.is/ um-ahaldafimleika-karla/ (visited on 04/30/2021). [11] S. H. Pétursson, A. Ó. ùórhannesson, and D. Solymar, “Islenski fimleikastiginn, áhaldafimleikar karlar”, is, p. 48, [12] A. Ólafsdóttir, B. Pétursdóttir, H. Bjarnadóttir, S. D. Árnadóttir, and R. ù. Ragnars- dóttir, “Islenski fimleikastiginn, áhaldafimleikar konur”, is, p. 50, [13] Live Score - Sport Event Systems. [Online]. Available: https://live.sportevent systems.se/score/?country=isl&year=2020 (visited on 05/22/2021). [14] What is Teamgym, en. [Online]. Available: https://www.ekteamgym.nl/en/ what-is-teamgym/ (visited on 01/25/2021). 34 BIBLIOGRAPHY

[15] Teamgym, en. [Online]. Available: http://www.espoontelinetaiturit.fi/en/ laji/-en/ (visited on 01/25/2021). [16] Pinterest, en. [Online]. Available: https://www.pinterest.com/pin/189080884340218347/ (visited on 05/22/2021). [17] Teamgym trampet, en. [Online]. Available: https://www.continentalsports. co.uk/dorado-team-gym-trampette (visited on 05/22/2021). [18] FSÍ, Keppnisreglur í hópfimleikum á íslandi, Jan. 2021. [Online]. Available: https: //fimleikasamband.is/wp-content/uploads/2021/01/Keppnisreglur_ jan-2021.pdf (visited on 03/20/2021). [19] S. Jónsdóttir and Í. Svavarsdóttir, Private communication, Jan. 2021. [20] C. N. Potts and V. A. Strusevich, “Fifty years of scheduling: A survey of milestones”, en, The Journal of the Operational Research Society, vol. 60, no. S1, S41–S68, May 2009, Num Pages: 28 Place: Abingdon, Publisher: Taylor & Francis Ltd., : 01605682. : http://dx.doi.org/10.1057/jors.2009.2. (visited on 05/01/2021). [21] F. W. Taylor, The Principles of Scientific Management. New York, Harper, 1911. [22] J. W. Herrmann, “The Perspectives of Taylor, Gantt , and Johnson: How to improve Production Scheduling”, Sept 2010. [Online]. Available: http://www.isr.umd. edu/~jwh2/papers/Herrmann.IJOQM.2010.%20pdf (visited on 04/30/2021). [23] M. L. Pinedo, Scheduling: Theory, Algorithms, and Systems. 3rd ed. New York, Springer, 2008. [24] A. A. Rahmani Hosseinabadi, J. Vahidi, B. Saemi, A. Kumar, and M. Elhoseny, “Extended Genetic Algorithm for solving open-shop scheduling problem”, Soft Com- puting, vol. 23, pp. 1–18, Jul. 2019. : 10.1007/s00500-018-3177-y. (visited on 05/05/2021). [25] B. Naderi, S. M. T. F. Ghomi, M. Aminnayeri, and M. Zandieh, “A study on open shop scheduling to minimise total tardiness”, International Journal of Production Research, vol. 49, no. 15, pp. 4657–4678, Aug. 2011, : 0020-7543. : 10. 1080/00207543.2010.497174. (visited on 05/20/2021). [26] U. Dorndorf, E. Pesch, and T. Phan-Huy, “Solving the open shop scheduling problem”, en, Journal of Scheduling, vol. 4, no. 3, pp. 157–174, 2001, : 1099-1425. : https://doi.org/10.1002/jos.73. (visited on 05/20/2021). [27] B. Çalis and S. Bulkan, “A research survey: Review of ai solution strategies of job shop scheduling problem”, en, Journal of Scheduling, 2012. : https://doi. org/10.1007/s10845-013-0837-8. (visited on 05/20/2021). [28] G. Guizzi, R. Revetria, G. Vanacore, and S. Vespoli, “On the open job-shop scheduling problem: A decentralized multi-agent approach for the manufacturing system perfor- mance optimization”, en, Procedia CIRP, 12th CIRP Conference on Intelligent Com- putation in Manufacturing Engineering, 18-20 July 2018, Gulf of Naples, , vol. 79, pp. 192–197, Jan. 2019, : 2212-8271. : 10.1016/j.procir.2019.02.045. (visited on 05/20/2021). [29] F. S. Al-Anzi, K. Al-Zame, and A. Allahverdi, “Weighted Multi-Skill Resources Project Scheduling”, en, Journal of Software Engineering and Applications, vol. 3, no. 12, pp. 1125–1130, Dec. 2010, Number: 12 Publisher: Scientific Research Pub- lishing. : 10.4236/jsea.2010.312131. (visited on 05/20/2021). BIBLIOGRAPHY 35

[30] A. Kononov and M. Sviridenko, “A linear time approximation scheme for makespan minimization in an open shop with release dates”, en, Operations Research Letters, vol. 30, no. 4, pp. 276–280, Aug. 2002, : 01676377. : 10.1016/S0167- 6377(02)00115-3. (visited on 05/20/2021). [31] L. Tang and D. Bai, “A new heuristic for open shop total completion time problem”, en, Applied Mathematical Modelling, vol. 34, no. 3, pp. 735–743, Mar. 2010, : 0307904X. : 10.1016/j.apm.2009.06.014. (visited on 05/20/2021). [32] A. Wierman, “Fairness and scheduling in single server queues”, en, Surveys in Oper- ations Research and Management Science, vol. 16, no. 1, pp. 39–48, Jan. 2011, : 1876-7354. : 10.1016/j.sorms.2010.07.002. (visited on 05/03/2021). [33] M. Ajtai, J. Aspnes, M. Naor, Y. Rabani, L. J. Schulman, and O. Waarts, “Fairness in Scheduling”, en, Journal of Algorithms, vol. 29, no. 2, pp. 306–357, Nov. 1998, : 01966774. : 10.1006/jagm.1998.0953. (visited on 05/03/2021). [34] R. Fagin and J. Williams, “A fair carpool scheduling algorithm. In IBM Journal of Research and Development, 27(2):133-139”, March 1983. [35] M. H. A. Ibrahim, R. Ahmad, N. K. Ibrahim, S. Chuprat, and H. Haron, “Nurse scheduling with fairness criteria for public hospital”, in 2011 IEEE International Conference on Computer Applications and Industrial Electronics (ICCAIE), Dec. 2011, pp. 91–95. : 10.1109/ICCAIE.2011.6162111. [36] A. Agnetis, B. Chen, G. Nicosia, and A. Pacifici, “Price of fairness in two-agent single-machine scheduling problems”, en, European Journal of Operational Research, vol. 276, no. 1, pp. 79–87, Jul. 2019, : 0377-2217. : 10.1016/j.ejor.2018. 12.048. (visited on 05/03/2021).