Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^3: Possible pairings for first knockout round of UEFA champions league

by Anonymous Monk
on Dec 22, 2012 at 20:22 UTC ( [id://1010046]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Possible pairings for first knockout round of UEFA champions league
in thread Possible pairings for first knockout round of UEFA champions league

²) Furthermore branching allows to cache/memoize results for subtrees to go even faster.
What? How?
  • Comment on Re^3: Possible pairings for first knockout round of UEFA champions league

Replies are listed 'Best First'.
Re^4: Possible pairings for first knockout round of UEFA champions league
by LanX (Saint) on Dec 22, 2012 at 20:54 UTC
    The algorithm constructs recursively possible combinations of runner-ups meeting an ordered set of group winners:

    Paris Schalke Malaga Dortmund Turin Bayern Barcelona ManU

    now if you take a look at this excerpt of the results and you will notice that the last 4 branches are repeating.

    | ... | Arsenal Porto Donezk Mailand Madrid Celtic Galatasaray Valencia Arsenal Porto Donezk Mailand Valencia Madrid Galatasaray Celtic Arsenal Porto Donezk Mailand Valencia Celtic Galatasaray Madrid Arsenal Porto Donezk Mailand Celtic Madrid Galatasaray Valencia ... | Arsenal Mailand Porto Donezk Madrid Celtic Galatasaray Valencia Arsenal Mailand Porto Donezk Valencia Madrid Galatasaray Celtic Arsenal Mailand Porto Donezk Valencia Celtic Galatasaray Madrid Arsenal Mailand Porto Donezk Celtic Madrid Galatasaray Valencia ... | |

    Which is obviously right since the first 4 are only permutations of the same set.

    So the following pairings (Turin  Bayern   Barcelona  ManU) x (Madrid Celtic Galatasaray Valencia) are always the same.

    Now storing the result for a normalized representation of a already calculated set,

    (something like join "-",sort(@drawn) as a hash key)

    helps reusing the once calculated subresult after encountering any permutation of (Arsenal Mailand Porto Donezk)

    It depends on the ratio between memory and time complexity but this normally gives an enormous boost to such search algorithms.

    Cheers Rolf

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1010046]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (6)
As of 2024-04-24 08:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found