使用 Python/SageMath 的一些立方体求解器

问题描述 投票:0回答:1

我是 SageMath/Python 的新手,我尝试使用平铺求解器。

我未能检索到 Soma Cube 的 240 个预期解(参见维基百科页面)。

这是我到目前为止所做的:

from sage.combinat.tiling import TilingSolver, Polyomino
from sage.all_cmdline import *   # import sage library

P1 = Polyomino([(0,0,0), (0,0,1), (0,1,0)], color='red')
P2 = Polyomino([(0,0,0), (0,0,1), (0,1,0), (0,2,0)], color='red')
P3 = Polyomino([(0,0,0), (0,1,1), (0,1,0), (0,2,0)], color='red')
P4 = Polyomino([(0,0,1), (0,1,1), (0,1,0), (0,2,0)], color='red')
P5 = Polyomino([(0,0,0), (0,0,1), (1,0,1), (1,1,1)], color='red')
P6 = Polyomino([(0,0,0), (0,0,1), (1,0,1), (1,1,1)], color='red')
P7 = Polyomino([(0,0,0), (1,0,1), (1,0,0), (1,1,0)], color='red')


# G = P1.show3d()
# G.show(aspect_ratio=1, viewer='jmol')

T = TilingSolver([P1, P2, P3, P4, P5, P6, P7], box=(3,3,3))
T.number_of_solutions()

T.number_of_solutions() #returns 15 504 instead of 240 ??

也许考虑了一些立方体对称性,但是 15 504 / 240 = 64.6....

你有什么想法吗?

python math solver
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.