Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
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
// Incremental variable
// no. of variables (𝑐𝑜𝑢𝑛𝑡_𝑣𝑎𝑟) = 2078
𝑣𝑎𝑟{𝑖𝑛𝑡} 𝑎[𝑖 𝑖𝑛 1. . 𝑐𝑜𝑢𝑛𝑡_𝑣𝑎𝑟] (𝑚, 𝑑𝑜𝑚_𝑣𝑎𝑟[𝑖]);
// CAPACITY CONSTRAINT
// OVERLAPPING CONSTRAINT
// PREFERENCE CONSTRAINT
// SEARCH METHOD
𝑓𝑜𝑟𝑎𝑙𝑙(𝑘 𝑖𝑛 𝑡𝑢𝑟𝑛_𝑛𝑜)
𝑖𝑓 (𝐶1. 𝑣𝑖𝑜𝑙𝑎𝑡𝑖𝑜𝑛𝑠(𝑎[𝑘]) > 𝑇𝑒𝑛𝑃𝑒𝑟𝑐𝑒𝑛𝑡[𝑘]) 𝑝𝑒𝑛𝑎𝑙𝑡𝑦_𝐶1 = 3;
𝑒𝑙𝑠𝑒 𝑝𝑒𝑛𝑎𝑙𝑡𝑦_𝐶1 = 1;
𝑝𝑒𝑛𝑎𝑙𝑡𝑦_𝐶1 = 1;
Overlapping constraint violations
FIRST
I introduced
𝑠𝑒𝑡{𝑖𝑛𝑡} 𝑡𝑎𝑘𝑒𝑛;
𝑓𝑜𝑟𝑎𝑙𝑙(𝑖 𝑖𝑛 𝑐𝑜𝑢𝑛𝑡_𝑣𝑎𝑟)
𝑖𝑓 (𝑝𝑟𝑒𝑓_𝑣𝑎𝑟_𝐼[𝑖] == 𝑎[𝑖]) 𝑡𝑎𝑘𝑒𝑛. 𝑖𝑛𝑠𝑒𝑟𝑡(𝑖);
RESULT:
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
RESULT:
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