目录
1,魔方三要素
(1)组成部件
和三阶魔方类似,形状参考:

但是颜色不要参考这个,这个颜色设定不符合标准颜色排布。
我在网上找不到卖三阶半转魔方的,只找到外国网友自制的这个,参考Takafumi's Half turn cube
关键就是中心块不是正方形,所以每次只能旋转180度。
(2)可执行操作
和三阶魔方类似,6种操作,但是每次只能旋转180度。
(3)目标态
同三阶魔方
2,复原方法
(1)调整8个角块的位置
利用我的交换公式自动推导并采用文中的默认编号

运行:
int main()
{
CubeBlock block1(0, 8);//8角块
vector<CubeBlock>b = vector<CubeBlock>{ block1 };
Opt opt1{ { {2,3,0,1,4,5,6,7} } ,"上" };
Opt opt2{ { {0,1,2,3,6,7,4,5} } ,"下" };
Opt opt3{ { {0,1,7,6,4,5,3,2} } ,"前" };
Opt opt4{ { {5,4,2,3,1,0,6,7} } ,"后" };
Opt opt5{ { {7,1,2,4,3,5,6,0} } ,"左" };
Opt opt6{ { {0,6,5,3,4,2,1,7}} ,"右" };
CubeOpt op1(b, opt1);
CubeOpt op2(b, opt2);
CubeOpt op3(b, opt3);
CubeOpt op4(b, opt4);
CubeOpt op5(b, opt5);
CubeOpt op6(b, opt6);
vector<CubeOpt>opts = { op1,op2,op3,op4,op5,op6 };
for (int i = 0; i < opts.size(); i++)mans[i] = opts[i].getName();
Cube cube(b, opts);
cube.bfs(0, 3, 3);
return 0;
}
运行结果:
只输出一行 k=96
也就是说,不存在只有3个角块位置不对的情况。
所以,只需要随便把下面一层的4个角块中的3个归位,那么第4个角块就一定是归位的。
此时,最多只需要一次旋转操作就可以恢复所有角块的位置。
2026.9.8更新:
上面这段推理有点隐晦,我基于V8 修改了main函数,并把搜索目标改成cube.bfs(0, 1, 3),得到:
int main()
{
CubeBlock block1(8);//8角块
b = vector<CubeBlock>{ block1 };
Opt opt1{ { {2,3,0,1,4,5,6,7} } ,"上" };
Opt opt2{ { {0,1,2,3,6,7,4,5} } ,"下" };
Opt opt3{ { {0,1,7,6,4,5,3,2} } ,"前" };
Opt opt4{ { {5,4,2,3,1,0,6,7} } ,"后" };
Opt opt5{ { {7,1,2,4,3,5,6,0} } ,"左" };
Opt opt6{ { {0,6,5,3,4,2,1,7}} ,"右" };
CubeOpt op1(opt1);
CubeOpt op2(opt2);
CubeOpt op3(opt3);
CubeOpt op4(opt4);
CubeOpt op5(opt5);
CubeOpt op6(opt6);
vector<CubeOpt>opts = { op1,op2,op3,op4,op5,op6 };
for (int i = 0; i < opts.size(); i++)mans[i] = opts[i].getName();
Cube cube(opts);
cube.bfs(0, 1, 3);
return 0;
}
结果显示不存在只有1-3个角块位置不对的场景。
由此可以推出,只需要随便把下面一层的4个角块中的3个归位,那么第4个角块就一定是归位的。
此时,最多只需要一次旋转操作就可以恢复所有角块的位置。
(2)调整12个棱块的位置
运行:
int main()
{
CubeBlock block1(0, 8);//8角块
CubeBlock block2(1, 12);//12侧棱
vector<CubeBlock>b = vector<CubeBlock>{ block1,block2 };
Opt opt1{ { {2,3,0,1,4,5,6,7},{2,3,0,1,4,5,6,7,8,9,10,11} } ,"上" };
Opt opt2{ { {0,1,2,3,6,7,4,5},{0,1,2,3,4,5,6,7,10,11,8,9} } ,"下" };
Opt opt3{ { {0,1,7,6,4,5,3,2},{0,1,10,3,4,5,7,6,8,9,2,11} } ,"前" };
Opt opt4{ { {5,4,2,3,1,0,6,7},{8,1,2,3,5,4,6,7,0,9,10,11} } ,"后" };
Opt opt5{ { {7,1,2,4,3,5,6,0},{0,1,2,11,7,5,6,4,8,9,10,3} } ,"左" };
Opt opt6{ { {0,6,5,3,4,2,1,7},{0,9,2,3,4,6,5,7,8,1,10,11} } ,"右" };
CubeOpt op1(b, opt1);
CubeOpt op2(b, opt2);
CubeOpt op3(b, opt3);
CubeOpt op4(b, opt4);
CubeOpt op5(b, opt5);
CubeOpt op6(b, opt6);
vector<CubeOpt>opts = { op1,op2,op3,op4,op5,op6 };
for (int i = 0; i < opts.size(); i++)mans[i] = opts[i].getName();
Cube cube(b, opts);
cube.bfs(1, 3, 3);
return 0;
}
从运行结果中随便取一个结果:
0,1,2,3,7,5,4,6,8,9,10,11,
0上 2前 0上 4左 0上 2前 0上 4左
这个公式的效果就是4 6 7号的3个棱块轮换位置,其他棱块位置不变,所有角块位置不变。
然后再运行:
int main()
{
CubeBlock block1(0, 8);//8角块
CubeBlock block2(1, 12);//12侧棱
vector<CubeBlock>b = vector<CubeBlock>{ block1,block2 };
Opt opt1{ { {2,3,0,1,4,5,6,7},{2,3,0,1,4,5,6,7,8,9,10,11} } ,"上" };
Opt opt2{ { {0,1,2,3,6,7,4,5},{0,1,2,3,4,5,6,7,10,11,8,9} } ,"下" };
Opt opt3{ { {0,1,7,6,4,5,3,2},{0,1,10,3,4,5,7,6,8,9,2,11} } ,"前" };
Opt opt4{ { {5,4,2,3,1,0,6,7},{8,1,2,3,5,4,6,7,0,9,10,11} } ,"后" };
Opt opt5{ { {7,1,2,4,3,5,6,0},{0,1,2,11,7,5,6,4,8,9,10,3} } ,"左" };
Opt opt6{ { {0,6,5,3,4,2,1,7},{0,9,2,3,4,6,5,7,8,1,10,11} } ,"右" };
CubeOpt op1(b, opt1);
CubeOpt op2(b, opt2);
CubeOpt op3(b, opt3);
CubeOpt op4(b, opt4);
CubeOpt op5(b, opt5);
CubeOpt op6(b, opt6);
vector<CubeOpt>opts = { op1,op2,op3,op4,op5,op6 };
for (int i = 0; i < opts.size(); i++)mans[i] = opts[i].getName();
Cube cube(b, opts);
cube.bfs(1, 4, 4);
return 0;
}
从运行结果中随便取一个结果:
0,1,2,3,4,5,6,7,
0,3,2,1,4,5,7,6,8,9,10,11,
0上 2前 0上 2前 0上 2前
这个公式的效果就是1号和3号互换,6号和7号互换,其他棱块位置不变,所有角块位置不变。
分析逆序数,很容易证明,不存在最后只有2个棱块需要互换位置的情况。
所以,只需要这2个公式,就可以恢复所有棱块的位置。
(3)调整角块和棱块的朝向
所有角块和棱块的朝向一定是正确的,不用调整。
至此,魔方复原。
3,三阶半转魔方 VS 五阶齿轮魔方
五阶齿轮魔方复原角块和侧边区中棱,和三阶半转魔方复原,就是同一个问题。
4,操作数奇偶性
我推测,从复原状态,经过任意次操作之后回到复原状态,上下2个操作的次数和一定是偶数,左右也是,前后也是。
验证程序:
int main()
{
CubeBlock block1(0, 8);//8角块
CubeBlock block2(1, 12);//12侧棱
CubeBlock block3(2, 6);
vector<CubeBlock>b = vector<CubeBlock>{ block1,block2,block3 };
Opt opt1{ { {2,3,0,1,4,5,6,7},{2,3,0,1,4,5,6,7,8,9,10,11},{1,0,2,3,4,5 } },"上" };
Opt opt2{ { {0,1,2,3,6,7,4,5},{0,1,2,3,4,5,6,7,10,11,8,9},{1,0,2,3,4,5 } } ,"下" };
Opt opt3{ { {0,1,7,6,4,5,3,2},{0,1,10,3,4,5,7,6,8,9,2,11},{0,1,3,2,4,5 } } ,"前" };
Opt opt4{ { {5,4,2,3,1,0,6,7},{8,1,2,3,5,4,6,7,0,9,10,11},{0,1,3,2,4,5 } } ,"后" };
Opt opt5{ { {7,1,2,4,3,5,6,0},{0,1,2,11,7,5,6,4,8,9,10,3},{0,1,2,3,5,4 } } ,"左" };
Opt opt6{ { {0,6,5,3,4,2,1,7},{0,9,2,3,4,6,5,7,8,1,10,11},{0,1,2,3,5,4 } } ,"右" };
CubeOpt op1(b, opt1);
CubeOpt op2(b, opt2);
CubeOpt op3(b, opt3);
CubeOpt op4(b, opt4);
CubeOpt op5(b, opt5);
CubeOpt op6(b, opt6);
vector<CubeOpt>opts = { op1,op2,op3,op4,op5,op6 };
for (int i = 0; i < opts.size(); i++)mans[i] = opts[i].getName();
Cube cube(b, opts);
cube.bfs(2, 1, 6);
return 0;
}
输出仅一行:
k=509007
验证通过。
499



被折叠的 条评论
为什么被折叠?



