I'm preparing for exam and I'm stuck with this problem:
We have n teams that play with each other twice. Each play ends without a draw. The team with the most wins is declared a winner (can be more than one). Design an algorithm that given some set of initial outcomes of plays checks whether a certain team still has a chance to become a winner in this tournament.
I don't know how to approach. The problem was put in category "Flows and matchings", but I don't see how this can be a maximum flow problem.
Suppose we want team A to win.
Clearly it is best if A wins all of its matches, so this gives us a target score. We can now compute the number of losses that each other team must suffer in order for A to win overall.
The problem is that we can only get at most 1 loser from each of the remaining games. So we need to work out how to match teams to games, where each match corresponds to a particular team losing in a particular game.
This is basically matching on a bipartite graph between teams and games, but we can also solve it with maximum flow via an extra source and sink node.
Then if you can construct a valid flow from source to sink that reaches the capacity (on each of the source to team edges) you have proved that it is still possible for team A to win.