Sei sulla pagina 1di 6

TASK

Q/As

1. Interpretation
Ignore these values

2. Interpretation of a 3
Assume that the student is already there
Decrease the capacity accordingly
Do not consider a variable for it

Goal

In all cases, for the firsts round


Try to assign turns taking into account
capacities of the turns (after eliminating the 3s)
penalty of 1 (up to 10% excess), 3 afterwards
no overlaps in the student timetables
penalty of 5

Two possible goals


Minimise the students not happy at all
Each student with a non-accepted preference counts as 1

Minimise the preferences not accepted


Each student with k non-accepted preferences out of p counts as k/p
PRE-PROCESSING STRATEGY
To minimize the amount (size) of data processed at a time, this strategy can be adopted:
• Select a department ->
• Get list of students in this department ->
• Get the set of all courses enrolled by these students ->
• Get the timetable of these set of courses ->
• Get the preferences of the list of students in this department if it was given.

THE VARIOUS DEPARTMENTS


In the given data, there are different courses students are studying. Here, we will refer to them
as departments. The table below shows a segment of what we have

Id. All the various departments Frequency (number of students)


1. EABEng 2
2. EG 23
… … …
7. LBCM 233
8. LBq 342
… … …
38. MIEB 368
39. MIEC 369
40. MIEMat 155
41. MIEMN 298
42. MIEA 406
43. MIEGI 452
44. MIEEC 1024
45. MIEF 132
46. MIEI 1073
47. MIEMc 570
48. MIEQB 429
… … …
76. PDTAi 7
SUM = 7052

If we choose the department

42. MIEA 406

from the table above, we will have


406 students, 57 courses, 285 turns, and 231 students with 1721 preferences.
Model A

// Data reading here

// Incremental variable
// no. of variables (𝑐𝑜𝑢𝑛𝑡_𝑣𝑎𝑟) = 2078
𝑣𝑎𝑟{𝑖𝑛𝑡} 𝑎[𝑖 𝑖𝑛 1. . 𝑐𝑜𝑢𝑛𝑡_𝑣𝑎𝑟] (𝑚, 𝑑𝑜𝑚_𝑣𝑎𝑟[𝑖]);

// CAPACITY CONSTRAINT

∀𝑘 ∈ 𝑡𝑢𝑟𝑛_𝑛𝑜 ∑ (𝑎[𝑗] == 𝑘) ≤ 𝑡𝑢𝑟𝑛_𝑐𝑎𝑝𝑎𝑐𝑖𝑡𝑦[𝑘]


𝑖 ∈ 𝑠𝑡𝑢𝑑𝑒𝑛𝑡,
𝑗 ∈ 𝑐𝑜𝑢𝑟𝑠𝑒_𝑣𝑎𝑟[𝑖]
(( ) )

// OVERLAPPING CONSTRAINT

∀𝑖 ∈ 𝑠𝑡𝑢𝑑𝑒𝑛𝑡 0 == ∑ 𝑜𝑣𝑒𝑟𝑙𝑎𝑝[𝑎[𝑗], 𝑎[𝑘]]


𝑗,𝑘 ∈ 𝑐𝑜𝑢𝑟𝑠𝑒_𝑣𝑎𝑟[𝑖]
( ∶𝑗<𝑘 ))
(

// PREFERENCE CONSTRAINT

∀ 𝑖 ∈ 𝑠𝑒𝑙𝑒𝑐𝑡𝑒𝑑_𝑠𝑡𝑢𝑑𝑒𝑛𝑡 (( ∑ (𝑝𝑟𝑒𝑓_𝑣𝑎𝑟[𝑗] ! = 𝑎[𝑗])) == 0)


𝑗 ∈ 𝑝𝑟𝑒𝑓_𝑐𝑜𝑢𝑟𝑠𝑒_𝑣𝑎𝑟[𝑖]

// SEARCH METHOD

Using Tabu search


Initial solution involves random assignment of turns to the incremental variable.

Capacity constraint violations

Each turn 𝑘 has corresponding capacity 𝑡𝑢𝑟𝑛_𝑐𝑎𝑝𝑎𝑐𝑖𝑡𝑦[𝑘]


We can store 10% of these in an integer array variable
𝑖𝑛𝑡 𝑇𝑒𝑛𝑃𝑒𝑟𝑐𝑒𝑛𝑡[𝑡𝑢𝑟𝑛_𝑛𝑜];

I plan to execute the code

𝑓𝑜𝑟𝑎𝑙𝑙(𝑘 𝑖𝑛 𝑡𝑢𝑟𝑛_𝑛𝑜)
𝑖𝑓 (𝐶1. 𝑣𝑖𝑜𝑙𝑎𝑡𝑖𝑜𝑛𝑠(𝑎[𝑘]) > 𝑇𝑒𝑛𝑃𝑒𝑟𝑐𝑒𝑛𝑡[𝑘]) 𝑝𝑒𝑛𝑎𝑙𝑡𝑦_𝐶1 = 3;
𝑒𝑙𝑠𝑒 𝑝𝑒𝑛𝑎𝑙𝑡𝑦_𝐶1 = 1;

but, 𝐶1. 𝑣𝑖𝑜𝑙𝑎𝑡𝑖𝑜𝑛𝑠(𝑎[𝑘]) returns “Error running comet”

𝑝𝑒𝑛𝑎𝑙𝑡𝑦_𝐶1 = 1;
Overlapping constraint violations

𝐶2. 𝑣𝑖𝑜𝑙𝑎𝑡𝑖𝑜𝑛𝑠() with a penalty of 5


𝑝𝑒𝑛𝑎𝑙𝑡𝑦_𝐶2 = 5;

Preference constraint violations


𝑝𝑒𝑛𝑎𝑙𝑡𝑦_𝐶3 = 1;

FIRST

• To minimize the number of students with at least a non-accepted preference


Each student with a non-accepted preference counts as 1

I introduced

𝑠𝑒𝑡{𝑖𝑛𝑡} 𝑡𝑎𝑘𝑒𝑛;

𝑓𝑜𝑟𝑎𝑙𝑙(𝑖 𝑖𝑛 𝑐𝑜𝑢𝑛𝑡_𝑣𝑎𝑟)
𝑖𝑓 (𝑝𝑟𝑒𝑓_𝑣𝑎𝑟_𝐼[𝑖] == 𝑎[𝑖]) 𝑡𝑎𝑘𝑒𝑛. 𝑖𝑛𝑠𝑒𝑟𝑡(𝑖);

Search for better result for 𝑖 𝑖𝑛 1. . 𝑐𝑜𝑢𝑛𝑡_𝑣𝑎𝑟: 𝑖 ∉ 𝑡𝑎𝑘𝑒𝑛

RESULT:

Capacity constraint violations


(For each turn)

violations frequency percentage %


0 278 97.54
1 2 0.70
2 3 1.05
3 1 0.35
7 1 0.35
Sum = 285

Overlapping constraint violations


(For each student)

violations frequency percentage %


0 270 84.38
1 34 10.63
2 10 3.13
3 6 1.88
Sum = 320
Preference constraint violations
(For each selected student)

violations frequency percentage %


0 108 52.94
1 51 25.00
2 23 11.27
3 15 7.35
4 5 2.45
5 2 0.98
Sum = 204

avg_cap = 18.000000
avg_over = 72.000000
avg_pref = 172.000000
avg_tot_vio = 550.000000
Average Iteration where solution is found = 748.000000
Average time taken (mins) where solution is found = 12.469783

SECOND

• To minimize generally the preferences not accepted


Each student with k non-accepted preferences out of p counts as k/p

RESULT:

Capacity constraint violations


(For each turn)

violations frequency Percentage %


0 278 97.54
1 2 0.70
2 2 0.70
4 2 0.70
6 1 0.35
Sum = 285

Overlapping constraint violations


(For each student)

violations frequency percentage %


0 282 88.13
1 26 8.13
2 10 3.13
3 2 0.63
Sum = 320
Preference constraint violations
(For each selected student)

violations frequency percentage %


0 94 46.08
1 52 25.49
2 25 12.25
3 20 9.80
4 8 3.92
5 5 2.45
Sum = 204

avg_cap = 20.000000
avg_over = 52.000000
avg_pref = 219.000000
avg_tot_vio = 499.000000
Average Iteration where solution is found = 744.000000
Average time taken (mins) where solution is found = 12.434367

Potrebbero piacerti anche