title: Scheduling algorithm for a round-robin tournament?
body: <p>I recently did studying stuff and meet up with Donald Knuth. But i didn't found the right algorithm to my problem.</p>
  
  <p><strong>The Problem</strong> We have a league with n players. every week they have a match with one other. in n-1 weeks every team fought against each other. there are n/2 matches a day. but one team can only fight once in a week. if we generate an (n/k) combination we get all of the combinations... (assuming k = 2) but i need to bring them in the right order. </p>
  
  <p>My first suggestion was... not the best one. i just made an array, and then let the computer try if he finds the right way. if not, go back to the start, shuffle the array and do it again, well, i programmed it in PHP (n=8) and what comes out works, but take many time, and for n=16 it gives me a timeout as well.</p>
  
  <p>So i thought if maybe we find an algorithm, or anybody knows a book which covers this problem.</p>
  
  <p>And here's my code: 
  <a href="http://pastebin.com/Rfm4TquY">http://pastebin.com/Rfm4TquY</a></p>