Author: stef2
Date: 22-10-2010, 12:16
| i've made some code to see if any team is safe from relegation. This is an np-problem so it cannot be exactly solved but it will facilitate things abit. Example: the russian competition with Z= current standing and K= ties to be played
K = 0 1 1 1 0 0 1 0 0 0 0 1 1 1 0 1 1 0 1 1 1 0 0 1 0 0 0 0 0 1 0 0 1 1 0 1 0 1 0 1 0 0 1 0 0 1 1 0 1 1 1 0 0 0 1 1 0 0 0 0 0 1 0 1 0 1 0 0 0 0 1 0 0 0 0 1 1 0 1 1 0 0 1 0 0 0 0 0 1 1 1 1 0 0 1 0 1 0 0 1 1 0 0 1 0 1 0 0 0 1 0 0 0 1 1 1 0 0 1 0 0 0 0 0 1 1 0 1 0 0 0 0 0 1 0 0 0 0 1 1 1 0 1 1 0 0 0 0 0 1 1 0 0 0 0 1 1 0 1 1 0 0 1 0 0 1 0 0 1 0 0 1 1 0 1 0 1 0 0 0 1 1 0 0 1 1 1 0 0 0 0 0 1 0 0 0 1 0 0 1 1 1 1 0 0 0 0 0 1 1 1 1 0 0 1 1 0 0 0 0 0 0 0 0 0 0 1 0 1 1 0 0 1 1 1 0 0 0 0 0 1 0 0 1 1 0 0 1 1 1 0 0 0 0 0 0 Z= 22 56 0 24 50 0 22 48 0 23 39 0 24 36 0 24 36 0 24 33 0 23 32 0 24 31 0 24 27 0 24 25 0 24 23 0 24 23 0 24 23 0 24 22 0 24 17 0
We begin by the team you want to know there fate and the teams above it losing all their matches. this gives for the 7th ranked team:
K1 = 0 0 0 0 0 1 1 0 1 0 0 0 1 1 1 0 1 1 0 0 0 0 1 1 0 1 1 0 1 0 0 1 1 0 1 0 0 1 1 1 0 0 0 0 0 1 1 1 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 1 1 1 0 0 0 0 0 0 Z = 30 56 0 30 50 0 30 48 0 30 39 0 30 36 0 30 36 0 30 33 7 27 44 0 25 34 0 26 33 0 26 31 0 27 32 0 26 29 0 29 38 0 27 31 0 27 26 0 The matrix with ties is now 9 by 9 because only teams ranked lower than team 7 have matches to play against other lower ranked teams. Some lowerranked teams have gained more points than the 7-th ranked. They can lose their remaining matches. This gives
Z = 30 56 0 30 50 0 30 48 0 30 39 0 30 36 0 30 36 0 30 33 7 30 44 8 30 34 9 30 33 10 30 34 11 30 41 12 30 41 13 30 41 14 30 40 15 30 35 16 K= empty
In this case the 7th ranked team can become last or second to last in a worst case scenario. So it can still be relegated. The numbers in the third column are the original places of the teams. This can be applied to any team but teams ranked higher cannot be exactly solved e.g. for team 6 we get as an endresult
K1 = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 1 1 0 0 0 0 0 1 1 0 1 1 0 0 1 0 0 1 1 0 1 0 0 0 1 1 1 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 Z = 30 56 0 30 50 0 30 48 0 30 39 0 30 36 0 30 36 6 30 42 7 30 44 8 25 34 0 26 33 0 26 31 0 27 32 0 27 32 0 30 41 14 27 31 0 28 29 0
With 2 columns/rows empty we get that depending on the results of matches played between teams places 9 to 16, team 6 can/ can't be relegated. Another problem is the input who needs to be input manually. If someone needs this, i'll post it here. Or if someone can make something similar but easier to create input for, i'd like to know. |