in reply to Re^7: Adding Special Rules to Sort
in thread Adding Special Rules to Sort

Joy, you have a response that broke new ground. You made it clear that you still don't understand the problem asked, nor do you understand the solution offered.

Part 3 of the specification said that if you tied on the first two criteria but had played head to head, then the winner should be ranked first except when that win is part of a cycle like the one where where A beats B beats C beats A. The challenge is therefore how to calculate which wins should be counted, and which wins are to be ignored because they are part of a cycle.

My solution was to take the transitive closure of the relation "won over". This is the relation "there is a chain of wins leading from one to the other." Once you have that transitive closure, you can easily find whether a particular win is part of a cycle. If A beat B, but there is a chain of wins from B to A, then A's win over B is part of a cycle and can't be used in that criteria. If A beat B and there is no chain of wins from B to A, then A's win can be used as a sorting criteria.

Now one can debate whether the best way to do this is to compute the whole transitive closure up front. But there is no way of solving the question asked without somehow being able to figure out whether a given win is part of an ambiguous cycle or not. And the process of doing that when A beat B is exactly the same as answering the question of whether (B, A) is in the transitive closure of the relation "won over". So you can't get away from dealing with the transitive closure, whether or not you use that language or whether you compute the whole thing or just part of it on demand.

Please note in particular that simply encoding wins in numbers in some fancy way will not readily let you know which wins are to be used as sorting criteria, and which need to be discarded as being ambiguous.

Replies are listed 'Best First'.
Re^9: Adding Special Rules to Sort
by zentara (Cardinal) on Mar 02, 2009 at 12:44 UTC
    I won't be responding again in this thread.

    What happened? Changed your transitive closure again ? :-) You are not getting any more secrets out of me...... ha ha....I will rule the betting world with my model. :-)


    I'm not really a human, but I play one on earth My Petition to the Great Cosmic Conciousness