Excel 求解器在为 24 个团队生成 12 周时间表时无法获得最佳解决方案
Excel solver failure to get optimal solution when generating a schedule for 12 week schedule for 24 teams
我的任务是为 24 个独特的团队制定时间表。
规则:
- 在 11 周内,每支球队进行 2 场比赛
- 在第 12 周,每支球队进行一场比赛
- 结果是每支球队都只与其他球队比赛一次
问题设置
约束:
- 一个 24x24 的单元格矩阵是该问题的输入变量。每个值必须是 0 到 12 之间的一周。0 用于屏蔽单元格以避免安排团队与自己对战。
- 每行需要加起来144 (0+1+2+...12)
- 最右边的单元格必须使用 0,第 1-11 周 countif() 需要等于 2,第 12 周需要每个 team/ream
等于 1
寻求objective的目标是将所有周数的总和设为144*24 = 3456
当我是 运行 求解器时 (OpenSolver) 它会返回所有不同线性和非线性求解器的错误。有什么想法吗?
我不知道你的模型有什么问题(如果不看电子表格或没有头脑就很难判断 reader)。
这是一个真正需要我们在开始编码或打字之前首先建立数学模型的问题。这是我针对这个问题的数学模型:
我使用的定义:
game(t1,t2,r) = 1 if team t1 plays against team t2 in round r (only for t1<t2 to prevent double counting)
= 0 otherwise
并非完全微不足道,但这可以通过任何 MIP 求解器实现:所有约束都是线性的。当我尝试这样做时,我的结果如下:
---- 24 VARIABLE game.L schedule for teams
round1 round2 round3 round4 round5 round6 round7 round8
team1 .team15 1
team1 .team16 1
team1 .team17 1
team1 .team18 1
team1 .team19 1
team1 .team20 1
team1 .team22 1
team1 .team24 1
team2 .team12 1
team2 .team15 1
team2 .team16 1
team2 .team19 1
team2 .team20 1
team2 .team21 1
team2 .team23 1
team2 .team24 1
team3 .team12 1
team3 .team13 1
team3 .team14 1
team3 .team15 1
team3 .team16 1
team3 .team21 1
team3 .team23 1
team3 .team24 1
team4 .team10 1
team4 .team14 1
team4 .team15 1
team4 .team16 1
team4 .team18 1
team4 .team21 1
team4 .team22 1
team4 .team23 1
team5 .team11 1
team5 .team15 1
team5 .team16 1
team5 .team18 1
team5 .team19 1
team5 .team20 1
team5 .team21 1
team5 .team22 1
team6 .team9 1
team6 .team10 1
team6 .team11 1
team6 .team16 1
team6 .team17 1
team6 .team20 1
team6 .team22 1
team6 .team23 1
team7 .team9 1
team7 .team10 1
team7 .team12 1
team7 .team14 1
team7 .team16 1
team7 .team19 1
team7 .team21 1
team7 .team24 1
team8 .team9 1
team8 .team11 1
team8 .team12 1
team8 .team13 1
team8 .team14 1
team8 .team16 1
team8 .team19 1
team8 .team22 1
team9 .team18 1
team9 .team20 1
team9 .team21 1
team9 .team22 1
team9 .team23 1
team10.team17 1
team10.team20 1
team10.team21 1
team10.team23 1
team10.team24 1
team11.team17 1
team11.team18 1
team11.team19 1
team11.team23 1
team11.team24 1
team12.team17 1
team12.team18 1
team12.team22 1
team12.team24 1
team13.team17 1
team13.team18 1
team13.team19 1
team13.team20 1
team13.team23 1
team13.team24 1
team14.team17 1
team14.team18 1
team14.team20 1
team14.team21 1
team15.team17 1
team15.team19 1
team15.team22 1
+ round9 round10 round11 round12 round13 round14 round15 round16
team1 .team9 1
team1 .team10 1
team1 .team11 1
team1 .team12 1
team1 .team13 1
team1 .team14 1
team1 .team21 1
team1 .team23 1
team2 .team9 1
team2 .team10 1
team2 .team11 1
team2 .team13 1
team2 .team14 1
team2 .team17 1
team2 .team18 1
team2 .team22 1
team3 .team9 1
team3 .team10 1
team3 .team11 1
team3 .team17 1
team3 .team18 1
team3 .team19 1
team3 .team20 1
team3 .team22 1
team4 .team9 1
team4 .team11 1
team4 .team12 1
team4 .team13 1
team4 .team17 1
team4 .team19 1
team4 .team20 1
team4 .team24 1
team5 .team9 1
team5 .team10 1
team5 .team12 1
team5 .team13 1
team5 .team14 1
team5 .team17 1
team5 .team23 1
team5 .team24 1
team6 .team12 1
team6 .team13 1
team6 .team14 1
team6 .team15 1
team6 .team18 1
team6 .team19 1
team6 .team21 1
team6 .team24 1
team7 .team11 1
team7 .team13 1
team7 .team15 1
team7 .team17 1
team7 .team18 1
team7 .team20 1
team7 .team22 1
team7 .team23 1
team8 .team10 1
team8 .team15 1
team8 .team17 1
team8 .team18 1
team8 .team20 1
team8 .team21 1
team8 .team23 1
team8 .team24 1
team9 .team17 1
team9 .team19 1
team9 .team24 1
team10.team18 1
team10.team19 1
team10.team22 1
team11.team20 1
team11.team21 1
team11.team22 1
team12.team19 1
team12.team20 1
team12.team21 1
team12.team23 1
team13.team21 1
team13.team22 1
team14.team19 1
team14.team22 1
team14.team23 1
team14.team24 1
team15.team18 1
team15.team20 1
team15.team21 1
team15.team23 1
team15.team24 1
team16.team17 1
team16.team18 1
team16.team19 1
team16.team20 1
team16.team21 1
team16.team22 1
team16.team23 1
team16.team24 1
+ round17 round18 round19 round20 round21 round22 round23
team1 .team2 1
team1 .team3 1
team1 .team4 1
team1 .team5 1
team1 .team6 1
team1 .team7 1
team1 .team8 1
team2 .team3 1
team2 .team4 1
team2 .team5 1
team2 .team6 1
team2 .team7 1
team2 .team8 1
team3 .team4 1
team3 .team5 1
team3 .team6 1
team3 .team7 1
team3 .team8 1
team4 .team5 1
team4 .team6 1
team4 .team7 1
team4 .team8 1
team5 .team6 1
team5 .team7 1
team5 .team8 1
team6 .team7 1
team6 .team8 1
team7 .team8 1
team9 .team10 1
team9 .team11 1
team9 .team12 1
team9 .team13 1
team9 .team14 1
team9 .team15 1
team9 .team16 1
team10.team11 1
team10.team12 1
team10.team13 1
team10.team14 1
team10.team15 1
team10.team16 1
team11.team12 1
team11.team13 1
team11.team14 1
team11.team15 1
team11.team16 1
team12.team13 1
team12.team14 1
team12.team15 1
team12.team16 1
team13.team14 1
team13.team15 1
team13.team16 1
team14.team15 1
team14.team16 1
team15.team16 1
team17.team18 1
team17.team19 1
team17.team20 1
team17.team21 1
team17.team22 1
team17.team23 1
team17.team24 1
team18.team19 1
team18.team20 1
team18.team21 1
team18.team22 1
team18.team23 1
team18.team24 1
team19.team20 1
team19.team21 1
team19.team22 1
team19.team23 1
team19.team24 1
team20.team21 1
team20.team22 1
team20.team23 1
team20.team24 1
team21.team22 1
team21.team23 1
team21.team24 1
team22.team23 1
team22.team24 1
team23.team24 1
当然,解不是唯一的。该模型在 0.2 秒内求解。
我的任务是为 24 个独特的团队制定时间表。
规则:
- 在 11 周内,每支球队进行 2 场比赛
- 在第 12 周,每支球队进行一场比赛
- 结果是每支球队都只与其他球队比赛一次
问题设置
约束:
- 一个 24x24 的单元格矩阵是该问题的输入变量。每个值必须是 0 到 12 之间的一周。0 用于屏蔽单元格以避免安排团队与自己对战。
- 每行需要加起来144 (0+1+2+...12)
- 最右边的单元格必须使用 0,第 1-11 周 countif() 需要等于 2,第 12 周需要每个 team/ream 等于 1
寻求objective的目标是将所有周数的总和设为144*24 = 3456
当我是 运行 求解器时 (OpenSolver) 它会返回所有不同线性和非线性求解器的错误。有什么想法吗?
我不知道你的模型有什么问题(如果不看电子表格或没有头脑就很难判断 reader)。
这是一个真正需要我们在开始编码或打字之前首先建立数学模型的问题。这是我针对这个问题的数学模型:
我使用的定义:
game(t1,t2,r) = 1 if team t1 plays against team t2 in round r (only for t1<t2 to prevent double counting)
= 0 otherwise
并非完全微不足道,但这可以通过任何 MIP 求解器实现:所有约束都是线性的。当我尝试这样做时,我的结果如下:
---- 24 VARIABLE game.L schedule for teams
round1 round2 round3 round4 round5 round6 round7 round8
team1 .team15 1
team1 .team16 1
team1 .team17 1
team1 .team18 1
team1 .team19 1
team1 .team20 1
team1 .team22 1
team1 .team24 1
team2 .team12 1
team2 .team15 1
team2 .team16 1
team2 .team19 1
team2 .team20 1
team2 .team21 1
team2 .team23 1
team2 .team24 1
team3 .team12 1
team3 .team13 1
team3 .team14 1
team3 .team15 1
team3 .team16 1
team3 .team21 1
team3 .team23 1
team3 .team24 1
team4 .team10 1
team4 .team14 1
team4 .team15 1
team4 .team16 1
team4 .team18 1
team4 .team21 1
team4 .team22 1
team4 .team23 1
team5 .team11 1
team5 .team15 1
team5 .team16 1
team5 .team18 1
team5 .team19 1
team5 .team20 1
team5 .team21 1
team5 .team22 1
team6 .team9 1
team6 .team10 1
team6 .team11 1
team6 .team16 1
team6 .team17 1
team6 .team20 1
team6 .team22 1
team6 .team23 1
team7 .team9 1
team7 .team10 1
team7 .team12 1
team7 .team14 1
team7 .team16 1
team7 .team19 1
team7 .team21 1
team7 .team24 1
team8 .team9 1
team8 .team11 1
team8 .team12 1
team8 .team13 1
team8 .team14 1
team8 .team16 1
team8 .team19 1
team8 .team22 1
team9 .team18 1
team9 .team20 1
team9 .team21 1
team9 .team22 1
team9 .team23 1
team10.team17 1
team10.team20 1
team10.team21 1
team10.team23 1
team10.team24 1
team11.team17 1
team11.team18 1
team11.team19 1
team11.team23 1
team11.team24 1
team12.team17 1
team12.team18 1
team12.team22 1
team12.team24 1
team13.team17 1
team13.team18 1
team13.team19 1
team13.team20 1
team13.team23 1
team13.team24 1
team14.team17 1
team14.team18 1
team14.team20 1
team14.team21 1
team15.team17 1
team15.team19 1
team15.team22 1
+ round9 round10 round11 round12 round13 round14 round15 round16
team1 .team9 1
team1 .team10 1
team1 .team11 1
team1 .team12 1
team1 .team13 1
team1 .team14 1
team1 .team21 1
team1 .team23 1
team2 .team9 1
team2 .team10 1
team2 .team11 1
team2 .team13 1
team2 .team14 1
team2 .team17 1
team2 .team18 1
team2 .team22 1
team3 .team9 1
team3 .team10 1
team3 .team11 1
team3 .team17 1
team3 .team18 1
team3 .team19 1
team3 .team20 1
team3 .team22 1
team4 .team9 1
team4 .team11 1
team4 .team12 1
team4 .team13 1
team4 .team17 1
team4 .team19 1
team4 .team20 1
team4 .team24 1
team5 .team9 1
team5 .team10 1
team5 .team12 1
team5 .team13 1
team5 .team14 1
team5 .team17 1
team5 .team23 1
team5 .team24 1
team6 .team12 1
team6 .team13 1
team6 .team14 1
team6 .team15 1
team6 .team18 1
team6 .team19 1
team6 .team21 1
team6 .team24 1
team7 .team11 1
team7 .team13 1
team7 .team15 1
team7 .team17 1
team7 .team18 1
team7 .team20 1
team7 .team22 1
team7 .team23 1
team8 .team10 1
team8 .team15 1
team8 .team17 1
team8 .team18 1
team8 .team20 1
team8 .team21 1
team8 .team23 1
team8 .team24 1
team9 .team17 1
team9 .team19 1
team9 .team24 1
team10.team18 1
team10.team19 1
team10.team22 1
team11.team20 1
team11.team21 1
team11.team22 1
team12.team19 1
team12.team20 1
team12.team21 1
team12.team23 1
team13.team21 1
team13.team22 1
team14.team19 1
team14.team22 1
team14.team23 1
team14.team24 1
team15.team18 1
team15.team20 1
team15.team21 1
team15.team23 1
team15.team24 1
team16.team17 1
team16.team18 1
team16.team19 1
team16.team20 1
team16.team21 1
team16.team22 1
team16.team23 1
team16.team24 1
+ round17 round18 round19 round20 round21 round22 round23
team1 .team2 1
team1 .team3 1
team1 .team4 1
team1 .team5 1
team1 .team6 1
team1 .team7 1
team1 .team8 1
team2 .team3 1
team2 .team4 1
team2 .team5 1
team2 .team6 1
team2 .team7 1
team2 .team8 1
team3 .team4 1
team3 .team5 1
team3 .team6 1
team3 .team7 1
team3 .team8 1
team4 .team5 1
team4 .team6 1
team4 .team7 1
team4 .team8 1
team5 .team6 1
team5 .team7 1
team5 .team8 1
team6 .team7 1
team6 .team8 1
team7 .team8 1
team9 .team10 1
team9 .team11 1
team9 .team12 1
team9 .team13 1
team9 .team14 1
team9 .team15 1
team9 .team16 1
team10.team11 1
team10.team12 1
team10.team13 1
team10.team14 1
team10.team15 1
team10.team16 1
team11.team12 1
team11.team13 1
team11.team14 1
team11.team15 1
team11.team16 1
team12.team13 1
team12.team14 1
team12.team15 1
team12.team16 1
team13.team14 1
team13.team15 1
team13.team16 1
team14.team15 1
team14.team16 1
team15.team16 1
team17.team18 1
team17.team19 1
team17.team20 1
team17.team21 1
team17.team22 1
team17.team23 1
team17.team24 1
team18.team19 1
team18.team20 1
team18.team21 1
team18.team22 1
team18.team23 1
team18.team24 1
team19.team20 1
team19.team21 1
team19.team22 1
team19.team23 1
team19.team24 1
team20.team21 1
team20.team22 1
team20.team23 1
team20.team24 1
team21.team22 1
team21.team23 1
team21.team24 1
team22.team23 1
team22.team24 1
team23.team24 1
当然,解不是唯一的。该模型在 0.2 秒内求解。