写了一个估价函数,
然后每个局面只枚举估价函数值为前2名的走法,耗时0.1秒,没有枚举出更优解;
然后每个局面只枚举估价函数值为前3名的走法,耗时2.5秒,没有枚举出更优解;
然后每个局面只枚举估价函数值为前4名的走法,耗时44秒,得到了1个更优解:
6170(3,6)(2,4)(9,9)(1,1)(8,3)(4,6)(5,5)(7,3)(4,1)(9,2)(9,2)(5,1)(8,2)(8,4)(8,9)(9,6)(6,7)(5,10)(10,5)(10,4)(9,3)(9,6)(10,5)(10,4)(9,3)(9,2)(10,1)
然后每个局面只枚举估价函数值为前5名的走法,耗时28分钟,没有枚举出更优解;
然后每个局面只枚举估价函数值为前6名的走法,耗时7.4小时,得到的更优解是:
6250(3,6)(2,4)(9,9)(8,3)(4,6)(5,5)(7,3)(4,1)(9,2)(9,2)(5,1)(8,2)(8,4)(8,9)(9,6)(6,7)(5,10)(10,5)(10,4)(9,3)(9,6)(10,5)(10,4)(9,3)(8,1)(10,1)
6330(3,6)(4,2)(3,3)(3,4)(4,1)(3,1)(8,3)(5,1)(5,5)(7,3)(9,2)(9,2)(8,4)(9,1)(9,8)(8,9)(6,8)(5,6)(5,7)(9,6)(9,9)(8,5)(8,8)(6,10)(10,5)(10,4)(9,3)(10,4)(10,3)(8,2)(10,2)(9,3)
6380(2,4)(4,2)(3,3)(3,1)(4,1)(4,7)(8,3)(2,5)(3,6)(4,7)(7,3)(8,4)(8,2)(9,2)(9,1)(6,5)(9,8)(8,9)(9,9)(8,8)(8,8)(5,6)(9,1)(10,4)(9,2)(9,1)(10,1)
然后每个局面只枚举估价函数值为前7名的走法,耗时2.4天,得到的更优解是:
6500(3,6)(2,4)(4,2)(3,3)(3,1)(4,1)(4,1)(8,3)(5,5)(7,3)(8,4)(8,2)(9,2)(9,8)(9,9)(5,6)(10,8)(5,7)(8,9)(8,8)(9,6)(8,8)(6,6)(9,5)(9,4)(9,4)(9,3)(10,1)(9,1)(9,2)
6550(3,6)(4,2)(3,3)(3,1)(4,1)(4,1)(8,3)(5,5)(7,3)(8,4)(9,8)(9,9)(5,6)(10,8)(5,7)(8,9)(8,8)(7,4)(9,2)(9,6)(8,8)(6,6)(9,5)(9,4)(9,3)(9,3)(10,1)(9,1)(9,2)
然后每个局面只枚举估价函数值为前8名的走法,耗时7天,得到的更优解是:
6640(3,6)(2,4)(4,2)(3,3)(3,1)(4,1)(8,3)(5,5)(7,3)(8,4)(8,2)(9,2)(9,8)(9,9)(5,6)(10,8)(5,7)(8,9)(8,8)(9,6)(8,8)(6,6)(9,5)(9,4)(9,4)(9,3)(10,1)(7,1)(9,1)(8,2)
6690(3,6)(4,2)(3,3)(3,1)(4,1)(8,3)(5,5)(7,3)(8,4)(9,8)(9,9)(5,6)(10,8)(5,7)(8,9)(8,8)(7,4)(9,2)(9,6)(8,8)(6,6)(9,5)(9,4)(9,3)(9,3)(10,1)(7,1)(9,1)(8,2)
然后每个局面只枚举估价函数值为前10名的走法,耗时16天,得到的更优解是:
6720(2,4)(3,6)(8,3)(5,5)(7,3)(8,2)(3,1)(8,2)(7,2)(4,1)(10,7)(9,9)(10,8)(5,5)(8,4)(5,7)(8,9)(9,6)(8,8)(8,8)(8,1)(9,5)(9,4)(9,4)(10,3)(10,1)(7,1)(9,1)(10,1)
6760(4,2)(3,1)(8,3)(5,5)(5,4)(7,3)(4,1)(8,4)(10,7)(9,9)(10,8)(5,5)(5,7)(8,9)(8,2)(9,2)(9,6)(8,8)(8,8)(8,1)(9,5)(9,4)(9,4)(10,3)(10,1)(7,1)(9,1)(10,1)
然后枚举所有可能的走法,耗时30天,没有枚举出更优解
因此得出结论:
对于1楼的局面,所有可能的走法中,得分最高的走法是:
6760(4,2)(3,1)(8,3)(5,5)(5,4)(7,3)(4,1)(8,4)(10,7)(9,9)(10,8)(5,5)(5,7)(8,9)(8,2)(9,2)(9,6)(8,8)(8,8)(8,1)(9,5)(9,4)(9,4)(10,3)(10,1)(7,1)(9,1)(10,1)
其中:
估价函数值=当前得分+最大消除分+最大奖励分
最大消除分=求和(5*该颜色的剩余个数^2)for(剩余个数大于1的颜色)
最大奖励分=(10-剩余个数为1的颜色数)*(10+剩余个数为1的颜色数)*20
剪枝条件:
对于 估价函数值<=当前最高得分 的分支,则直接跳过,不进行更深层次的枚举 |