on may 1998, a post on the sci.op-research newsgroup posed the following problem: suppose you have 32 golfers who organize each week into groups of four. the original post said that the goal is to select the foursomes so that each person only golfs with the same person once. how many weeks before all of the options are exhausted?
to solve the nine-week schedule problem, we will use koalog constraint solver, a java library for constraint programming, to write the code. information about koalog constraint solver (including its javadoc) is available at www.koalog.com/php/jcs.php. all of the techniques presented in this article do not depend on the choice of the solver, but could be implemented using many commercial or open source solvers. 【程序编程相关:使用Properties类带来的好处】
this problem has since become a famous combinatorial problem and is usually called the social golfer problem. it is a generalization of a round-robin tournament. it helps to bound the problem. you can easily show that there is no solution for a number of weeks strictly greater than ten. this follows from the fact that each player plays with three other players each week, and since there is a total of 31 other players, this means a player runs out of opponents after (31)/3 weeks. in this article, we will see how to construct a nine-week schedule. constructing a ten-week schedule or proving that none exists remains an open problem! 【推荐阅读:Windows 2000中如何配置JDK】
constraint programming... 下一页