1. Optimizing the Third Division of the Ecuadorian Football
League.
Diego Recalde, Ramiro Torres, Polo Vaca
Escuela Politécnica Nacional
Quito, Ecuador
XIII Encuentro de Matemáticas. Quito-2012– p. 1
2. Outline
• Motivation.
• The Problem.
• Integer Formulation.
• Algorithms and solution.
• Computacional Results
• Conclusions
XIII Encuentro de Matemáticas. Quito-2012– p. 2
3. Outline
• Motivation.
• The Problem.
• Integer Formulation.
• Algorithms and solution.
• Computacional Results
• Conclusions
XIII Encuentro de Matemáticas. Quito-2012– p. 2
4. Motivation
• Professional football leagues
1. Real Madrid ($ 479,5)
2. FC Barcelona ($ 450,7)
3. Manchester United ($ 367)
4. Bayern Munich ($ 321,4 )
5. Arsenal ($ 251,1 )
XIII Encuentro de Matemáticas. Quito-2012– p. 3
5. Motivation
• Professional football leagues
1. Real Madrid ($ 479,5)
2. FC Barcelona ($ 450,7)
3. Manchester United ($ 367)
4. Bayern Munich ($ 321,4 )
5. Arsenal ($ 251,1 )
• No Professional football leagues
!Only in Quito
◦ Asociacion de Ligas de Pichincha(27 leagues)
◦ Union de Ligas Independientes (64 leagues)
◦ Federacion Ligas de Quito(84 leagues)
!each one with at least 20 teams.
XIII Encuentro de Matemáticas. Quito-2012– p. 3
6. Motivation
1. Successful implementation of Mathematical Programming
for scheduling the first division of the Ecuadorian Football
League.
2. Managers of Ecuadorian Football Federation (FEF) were
pleased with the results of the Mathematical Approach.
• Inclusion of the new characteristics of equity and
attractiveness in the schedules.
• The ease of having a computational tool to generate
schedules, as opposed to the tedious manual task.
• Unintentional errors of the empirical method are avoided.
XIII Encuentro de Matemáticas. Quito-2012– p. 4
7. Outline
• Motivation.
• The Problem.
• Integer Formulation.
• Algorithms and solution.
• Computacional Results
• Conclusions
XIII Encuentro de Matemáticas. Quito-2012– p. 5
8. The Third Division Ecuadorian Championship
• Every Provincial Association has a championship.
• Who participates in the Third Division Championship? the
two best positioned teams of every provincial championship.
• By regulation, 4 zones must be created.
Current partition in zones empirically created by FEF:
zona 1: Pichincha, Imbabura, Cotopaxi, Tungurahua, Chimborazo,
Bolivar
zona 2: Orellana, Sucumbios, Napo, Pastaza, Morona Santiago
zona 3: Loja, Azuay, Cañar, El Oro, Guayas
zona 4: Esmeraldas, Santo Domingo, Los Ríos, Manabí,
Santa Elena
XIII Encuentro de Matemáticas. Quito-2012– p. 6
9. Summary
Province teams Cities Zone Province teams Cities Zone
Azuay 6 3 3 Loja 12 5 3
Bolivar 6 4 1 Manabí 27 12 4
Cañar 12 5 3 Morona Santiago 5 2 2
Chimborazo 8 2 1 Sucumbios 7 2 2
Cotopaxi 7 3 1 Tungurahua 9 3 1
Esmeraldas 18 4 4 Orellana 6 1 2
El Oro 16 9 3 Pastaza 10 3 2
Guayas 14 3 3 Pichincha 11 5 1
Imbabura 18 5 1 Santa Elena 8 3 4
Los Rios 9 3 4 Santo Domingo 12 1 4
Province teams Cities Zone
Total 20 221 78 4
XIII Encuentro de Matemáticas. Quito-2012– p. 7
10. Our Problem
To find a partition of provinces in zones such that:
• Displacement of every team must be minimized in every
zone.
• Zones (partition) must be balanced in some way (ranking of
teams)
• Fixed number of teams on each zone.
XIII Encuentro de Matemáticas. Quito-2012– p. 8
11. Outline
• Motivation.
• The Problem.
• Integer Formulation.
• Algorithms and solution.
• Computacional Results
• Conclusions
XIII Encuentro de Matemáticas. Quito-2012– p. 9
17. Our Problem
Given:
Undirected Graph, distance-matrix(epresenting the length of the
arc), node activity measures, and an integer number p ∈ N
Task:
Find p sets of nodes(cliques) in such a way that the total cost of
the formed sets is minimized.
Moreover, the sets must be balanced according to different node
activity measures:
! football level ∈ [L0,L1]
! number of teams ∈ [,
19. Notation
Let:
• G = (V,E) : a graph, with the set of nodes V (teams) and
set of edges E.
• dij : represents the distance between nodes i and j.
• fi : denotes the football level of team i ∈ V .
• p : number of cliques to be partitioned.
XIII Encuentro de Matemáticas. Quito-2012– p. 12
20. Notation
Let:
• G = (V,E) : a graph, with the set of nodes V (teams) and
set of edges E.
• dij : represents the distance between nodes i and j.
• fi : denotes the football level of team i ∈ V .
• p : number of cliques to be partitioned.
Variables:
xci
j =
(
1 , if nodes i, j ∈ V are assigned to clique c
0 , otherwise
xci
i =
(
1 , if node i ∈ V belongs to clique c
0 , otherwise
XIII Encuentro de Matemáticas. Quito-2012– p. 12
21. Integer Programming Formulation
m´ın
p
X
c=1
X
(i,j)2E
dijxc
ij
subject to
+ xc
jk − xc
ij + xc
ik ≤ 1, ∀1 ≤ i j k ≤ |V |, c = {1, 2, . . . , p}
+ xc
jk + xc
ij − xc
ik ≤ 1, ∀1 ≤ i j k ≤ |V |, c = {1, 2, . . . , p}
− xc
jk + xc
ij + xc
ik ≤ 1, ∀1 ≤ i j k ≤ |V |, c = {1, 2, . . . , p}
p
X
c=1
xc
ii = 1, ∀i ∈ V
ii ≤Xi
j
xc
xc
ij +Xi
j
xc
ji ≤
22. xc
ii, ∀i ∈ V, c = {1, 2, . . . , p}
L0 ≤X
i2V
fixc
ii ≤ L1, ∀c = {1, 2, . . . , p}
xc
ij ∈ {0, 1}, ∀1 ≤ i ≤ j ≤ |V |, c = {1, 2, . . . , p}
XIII Encuentro de Matemáticas. Quito-2012– p. 13
23. Integer Programming Formulation
m´ın
p
X
c=1
X
(i,j)2E
dijxc
ij
The model is NP-hard!clique partitioning problem
subject to
+ xc
jk − xc
ij + xc
ik ≤ 1, ∀1 ≤ i j k ≤ |V |, c = {1, 2, . . . , p}
+ xc
jk + xc
ij − xc
ik ≤ 1, ∀1 ≤ i j k ≤ |V |, c = {1, 2, . . . , p}
− xc
jk + xc
ij + xc
ik ≤ 1, ∀1 ≤ i j k ≤ |V |, c = {1, 2, . . . , p}
p
X
c=1
xc
ii = 1, ∀i ∈ V
ii ≤Xi
j
xc
xc
ij +Xi
j
xc
ji ≤
24. xc
ii, ∀i ∈ V, c = {1, 2, . . . , p}
L0 ≤X
i2V
fixc
ii ≤ L1, ∀c = {1, 2, . . . , p}
xc
ij ∈ {0, 1}, ∀1 ≤ i ≤ j ≤ |V |, c = {1, 2, . . . , p}
XIII Encuentro de Matemáticas. Quito-2012– p. 13
25. Outline
• Motivation.
• The Problem.
• Integer Formulation.
• Algorithms and solution.
• Computacional Results
• Conclusions
XIII Encuentro de Matemáticas. Quito-2012– p. 14
26. Relaxed Problem
v1
v2
v3
v4
v6 v5
v7
XIII Encuentro de Matemáticas. Quito-2012– p. 15
27. Relaxed Problem
v1
v2
v3
v4
v6 v5
v7
XIII Encuentro de Matemáticas. Quito-2012– p. 15
28. Relaxed Problem
v1
v2
v3
v4
v6
v5
v7
XIII Encuentro de Matemáticas. Quito-2012– p. 15
29. Relaxed Problem
v1
v2
v3
v4
v6
v5
v7
Given: A set of node sources C, where |C| = p
xic =
(
1 , if nodes i ∈ V are assigned to source c ∈ C
0 , otherwise
XIII Encuentro de Matemáticas. Quito-2012– p. 15
30. Relaxed Model(RM)
m´ın
X
c∈C
X
i∈V rC
dicxic
subject to
X
c∈C
xic = 1, ∀i ∈ V r C
≤
X
i∈V rC
xic ≤
31. , ∀c ∈ C
L0 ≤
X
i∈V rC
fixic ≤ L1, ∀c ∈ C
xic ∈ {0, 1}, ∀i ∈ V r C, c ∈ C
XIII Encuentro de Matemáticas. Quito-2012– p. 16
32. Heuristics
The proposed algorithms consists of two phases(Kalcsics,
Nickel and Schöder):
1. Construct the set C of source nodes.
2. Assign v ∈ V r C to the corresponding source c ∈ C.
H1) Choose p random nodes to be included in C.
!probability is proportional to football level.
Solve RM.
H2) Choose nodes (i, j) where dij is the largest distance.
Include (i, j) in set C.
for l = 3, . . . p do
Find the farthest node k to all nodes in C.
C = C ∪ {k}.
end for
Solve RM.
Exclude dij
XIII Encuentro de Matemáticas. Quito-2012– p. 17
33. Local Search
Let Q = {Q1, . . . ,Qp} be the subsets obtained to solving RM.
Compute clique(Q).
for all Qi ∈ Q do
Exchange the source ci with j ∈ Qi
if c(Q′
i) c(Qi) then
ci = j
Solve RM !Q′.
Compute clique(Q′).
if clique(Q′) clique(Q) then
Q = Q′
end if
end if
end for
XIII Encuentro de Matemáticas. Quito-2012– p. 18
34. Branch Bound + Rounding
ii = 0 and xc
xc
ii = 1 xc
ik = 0, ∀k ∈ V
XIII Encuentro de Matemáticas. Quito-2012– p. 19
35. Branch Bound + Rounding
ii = 0 and xc
xc
ii = 1 xc
ik = 0, ∀k ∈ V
xc
ij = 1
✻
xc
jj = 1
✏✮✏
xc
jj = 0
xc
jk = 0, ∀k ∈ V
XIII Encuentro de Matemáticas. Quito-2012– p. 19
36. Branch Bound + Rounding
ii = 0 and xc
xc
ii = 1 xc
ik = 0, ∀k ∈ V
xc
ij = 1
✻
xc
jj = 1
✏✮✏
xc
jj = 0
xc
jk = 0, ∀k ∈ V
Moreover:
(
if xci
i ≥
=⇒ round up variable xci
i = 1
if xci
i ≤ 1 −
=⇒ round down variable xci
i = 0
XIII Encuentro de Matemáticas. Quito-2012– p. 19
37. Outline
• Motivation.
• The Problem.
• Integer Formulation.
• Algorithms and solution.
• Computacional Results
• Conclusions
XIII Encuentro de Matemáticas. Quito-2012– p. 20
38. Computacional Results
• Heuristic method implemented in C++.
• Core i5 with 4Gb RAM
• Gurobi and SCIP
XIII Encuentro de Matemáticas. Quito-2012– p. 21
39. Computacional Results
• Heuristic method implemented in C++.
• Core i5 with 4Gb RAM
• Gurobi and SCIP
IP Heur 1 Heur 2 B B
# nodes p obj t(seg) obj t(seg) obj t(seg) obj t(seg)
11 3 3 2094 44.22 2134 1.66 2181 0.02 2094 1.18
15 3 5 4460 17.44 4535 1.96 4579 0.21 4460 1.42
18 3 6 6230 88.22 6526 2.17 6526 0.34 6238 13.52
26 4 6 – M 8094 3.03 8998 1.05 7354 210.17
20 4 5 8852.4 185 8852.4 2.71 9089.9 0.45 8852.4 0.62
42 8 5 – M 12667.8 9.08 13295.5 1.29 12288 616.05
XIII Encuentro de Matemáticas. Quito-2012– p. 21
42. Outline
• Motivation.
• The Problem.
• Integer Formulation.
• Algorithms and solution.
• Computacional Results
• Conclusions
XIII Encuentro de Matemáticas. Quito-2012– p. 23
43. Conclusions
! Equitable and competitive championships.
! An external entity gives transparency to this process.
! Optimization methods vs empirical methods
Future Work
! Improve the current algorithms.
! Develop new algorithms.
! Analize the problem in special graphs.
XIII Encuentro de Matemáticas. Quito-2012– p. 24
44. For your attention
Thank you !!!
XIII Encuentro de Matemáticas. Quito-2012– p. 25