Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2017
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. | Round 1 | Round 2 | Round n
  2. ------ | -------------- | -------------- | --------------
  3. Game 1 | Team1 vs Team2 | Team3 vs Team5 | Team? vs Team?
  4. Game 2 | Team3 vs Team4 | Team1 vs Team6 | Team? vs Team?
  5. Game n | Team? vs Team? | Team? vs Team? | Team? vs Team?
  6.  
  7. from constraint import *
  8.  
  9. problem = Problem()
  10. problem.addVariable("Activity", [i for i in range(1, 22+1)])
  11. problem.addVariables(["Team1", "Team2"], [i for i in range(1, 42+1)])
  12. problem.addVariable("Round", [i for i in range(1, 22+1)])
  13. problem.addConstraint(lambda a, b: a != b, ("Team1", "Team2"))
  14. ???
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement