Search code examples
algorithmoptimizationmax-flowford-fulkerson

Algorithm: Eliminating players that no longer have a chance to win the tournament


I have been working on the algorithm for this problem, but can't figure it out. The problem is below:

In a tournament with X player, each player is betting on the outcomes of basketball matches in the NBA.

Guessing the correct match outcome earns a player 3 points, guessing the MVP of the match earns 1 point and guessing both wrong - 0 points.

The algorithm needs to be able to determine if a certain player can't reach the number 1 spot in this betting game.

For example, let's say there are a total of 30 games in the league, so the max points a player can get for guessing right is (3+1)*30=120.

In the table below you can see players X,Y and Z. Player X guessed correctly so far 20 matches so he have 80 points. Players Y and Z have 26 and 15 points, and since there are only 10 matches left, even if they guess correctly all the remaining 10 it would not be enough to reach the number 1 spot. Therefore, the algorithm determined that they are eliminated from the game.

Team Points Points per match Total Games Max Points possible Games left Points Available Eliminated?
X 80 0-L 1-MVP 3-W 30 120 10 0-40 N
Y 26 0-L 1-MVP 3-W 30 120 10 0-40 Y
Z 15 0-L 1-MVP 3-W 30 120 10 0-40 Y

The baseball elimination problem seems to be the most similar to this problem, but it's not exactly it.

How should I build the reduction of the maximum-flow problem to suit this problem?

Thank you.


Solution

  • I don't get why you are looking at very complex max-flow algorithms. Those might be needed for very complex things (especially when pairings lead to zero-sum results and order/remaining parings start to matter -> !much! harder to do worst-case analysis).

    Maybe the baseball problem you mention is one of those (did not check it). But your use-case sounds trivial.

    1. Get current leader score LS
    2. Get remaining matches N
    3. For each player P
      4. Get current player score PS
      5. Eliminate iff PS + 3 * N < LS
    
    (assumes parallel progress: standings always synced to all players P have played M games
     -> easy to generalize though)
    

    This is simple. Given your description there is nothing preventing us from asumming worst-case performance from every other player aka it's a valid scenario that every other player guesses wrong for all upcoming guesses -> score S of player P can stay at S for all remaining games.

    Things might quickly change to NP-hard decision-problems when there are more complex side-constraints (e.g. statistical distributions / expectations)