Bahasa Wolfram 190 byte
Berikut ini mengembalikan semua tepi grafik dalam hal koordinat aktual (dengan asumsi masing-masing mini-cube adalah 2 unit di tepi dan kubus Rubik memiliki simpul kiri bawah pada titik asal).
t=Table;h[a_,b_,c_]:=t[{x,y,z},{a,1,5,2},{b,1,5,2},{c,0,6,6}];Partition[Sort[a=Cases[DeleteCases[Tuples[Flatten[{h[x,z,y],h[y,z,x],h[x,y,z]},3],{2}],{x_,x_}],x_/;ManhattanDistance@@x==2]],4]
(* output *)
{{{{0,1,1},{0,1,3}},{{0,1,1},{0,3,1}},{{0,1,1},{1,0,1}},{{0,1,1},{1,1,0}}},{{{0,1,3},{0,1,1}},{{0,1,3},{0,1,5}},{{0,1,3},{0,3,3}},{{0,1,3},{1,0,3}}},{{{0,1,5},{0,1,3}},{{0,1,5},{0,3,5}},{{0,1,5},{1,0,5}},{{0,1,5},{1,1,6}}},{{{0,3,1},{0,1,1}},{{0,3,1},{0,3,3}},{{0,3,1},{0,5,1}},{{0,3,1},{1,3,0}}},{{{0,3,3},{0,1,3}},{{0,3,3},{0,3,1}},{{0,3,3},{0,3,5}},{{0,3,3},{0,5,3}}},{{{0,3,5},{0,1,5}},{{0,3,5},{0,3,3}},{{0,3,5},{0,5,5}},{{0,3,5},{1,3,6}}},{{{0,5,1},{0,3,1}},{{0,5,1},{0,5,3}},{{0,5,1},{1,5,0}},{{0,5,1},{1,6,1}}},{{{0,5,3},{0,3,3}},{{0,5,3},{0,5,1}},{{0,5,3},{0,5,5}},{{0,5,3},{1,6,3}}},{{{0,5,5},{0,3,5}},{{0,5,5},{0,5,3}},{{0,5,5},{1,5,6}},{{0,5,5},{1,6,5}}},{{{1,0,1},{0,1,1}},{{1,0,1},{1,0,3}},{{1,0,1},{1,1,0}},{{1,0,1},{3,0,1}}},{{{1,0,3},{0,1,3}},{{1,0,3},{1,0,1}},{{1,0,3},{1,0,5}},{{1,0,3},{3,0,3}}},{{{1,0,5},{0,1,5}},{{1,0,5},{1,0,3}},{{1,0,5},{1,1,6}},{{1,0,5},{3,0,5}}},{{{1,1,0},{0,1,1}},{{1,1,0},{1,0,1}},{{1,1,0},{1,3,0}},{{1,1,0},{3,1,0}}},{{{1,1,6},{0,1,5}},{{1,1,6},{1,0,5}},{{1,1,6},{1,3,6}},{{1,1,6},{3,1,6}}},{{{1,3,0},{0,3,1}},{{1,3,0},{1,1,0}},{{1,3,0},{1,5,0}},{{1,3,0},{3,3,0}}},{{{1,3,6},{0,3,5}},{{1,3,6},{1,1,6}},{{1,3,6},{1,5,6}},{{1,3,6},{3,3,6}}},{{{1,5,0},{0,5,1}},{{1,5,0},{1,3,0}},{{1,5,0},{1,6,1}},{{1,5,0},{3,5,0}}},{{{1,5,6},{0,5,5}},{{1,5,6},{1,3,6}},{{1,5,6},{1,6,5}},{{1,5,6},{3,5,6}}},{{{1,6,1},{0,5,1}},{{1,6,1},{1,5,0}},{{1,6,1},{1,6,3}},{{1,6,1},{3,6,1}}},{{{1,6,3},{0,5,3}},{{1,6,3},{1,6,1}},{{1,6,3},{1,6,5}},{{1,6,3},{3,6,3}}},{{{1,6,5},{0,5,5}},{{1,6,5},{1,5,6}},{{1,6,5},{1,6,3}},{{1,6,5},{3,6,5}}},{{{3,0,1},{1,0,1}},{{3,0,1},{3,0,3}},{{3,0,1},{3,1,0}},{{3,0,1},{5,0,1}}},{{{3,0,3},{1,0,3}},{{3,0,3},{3,0,1}},{{3,0,3},{3,0,5}},{{3,0,3},{5,0,3}}},{{{3,0,5},{1,0,5}},{{3,0,5},{3,0,3}},{{3,0,5},{3,1,6}},{{3,0,5},{5,0,5}}},{{{3,1,0},{1,1,0}},{{3,1,0},{3,0,1}},{{3,1,0},{3,3,0}},{{3,1,0},{5,1,0}}},{{{3,1,6},{1,1,6}},{{3,1,6},{3,0,5}},{{3,1,6},{3,3,6}},{{3,1,6},{5,1,6}}},{{{3,3,0},{1,3,0}},{{3,3,0},{3,1,0}},{{3,3,0},{3,5,0}},{{3,3,0},{5,3,0}}},{{{3,3,6},{1,3,6}},{{3,3,6},{3,1,6}},{{3,3,6},{3,5,6}},{{3,3,6},{5,3,6}}},{{{3,5,0},{1,5,0}},{{3,5,0},{3,3,0}},{{3,5,0},{3,6,1}},{{3,5,0},{5,5,0}}},{{{3,5,6},{1,5,6}},{{3,5,6},{3,3,6}},{{3,5,6},{3,6,5}},{{3,5,6},{5,5,6}}},{{{3,6,1},{1,6,1}},{{3,6,1},{3,5,0}},{{3,6,1},{3,6,3}},{{3,6,1},{5,6,1}}},{{{3,6,3},{1,6,3}},{{3,6,3},{3,6,1}},{{3,6,3},{3,6,5}},{{3,6,3},{5,6,3}}},{{{3,6,5},{1,6,5}},{{3,6,5},{3,5,6}},{{3,6,5},{3,6,3}},{{3,6,5},{5,6,5}}},{{{5,0,1},{3,0,1}},{{5,0,1},{5,0,3}},{{5,0,1},{5,1,0}},{{5,0,1},{6,1,1}}},{{{5,0,3},{3,0,3}},{{5,0,3},{5,0,1}},{{5,0,3},{5,0,5}},{{5,0,3},{6,1,3}}},{{{5,0,5},{3,0,5}},{{5,0,5},{5,0,3}},{{5,0,5},{5,1,6}},{{5,0,5},{6,1,5}}},{{{5,1,0},{3,1,0}},{{5,1,0},{5,0,1}},{{5,1,0},{5,3,0}},{{5,1,0},{6,1,1}}},{{{5,1,6},{3,1,6}},{{5,1,6},{5,0,5}},{{5,1,6},{5,3,6}},{{5,1,6},{6,1,5}}},{{{5,3,0},{3,3,0}},{{5,3,0},{5,1,0}},{{5,3,0},{5,5,0}},{{5,3,0},{6,3,1}}},{{{5,3,6},{3,3,6}},{{5,3,6},{5,1,6}},{{5,3,6},{5,5,6}},{{5,3,6},{6,3,5}}},{{{5,5,0},{3,5,0}},{{5,5,0},{5,3,0}},{{5,5,0},{5,6,1}},{{5,5,0},{6,5,1}}},{{{5,5,6},{3,5,6}},{{5,5,6},{5,3,6}},{{5,5,6},{5,6,5}},{{5,5,6},{6,5,5}}},{{{5,6,1},{3,6,1}},{{5,6,1},{5,5,0}},{{5,6,1},{5,6,3}},{{5,6,1},{6,5,1}}},{{{5,6,3},{3,6,3}},{{5,6,3},{5,6,1}},{{5,6,3},{5,6,5}},{{5,6,3},{6,5,3}}},{{{5,6,5},{3,6,5}},{{5,6,5},{5,5,6}},{{5,6,5},{5,6,3}},{{5,6,5},{6,5,5}}},{{{6,1,1},{5,0,1}},{{6,1,1},{5,1,0}},{{6,1,1},{6,1,3}},{{6,1,1},{6,3,1}}},{{{6,1,3},{5,0,3}},{{6,1,3},{6,1,1}},{{6,1,3},{6,1,5}},{{6,1,3},{6,3,3}}},{{{6,1,5},{5,0,5}},{{6,1,5},{5,1,6}},{{6,1,5},{6,1,3}},{{6,1,5},{6,3,5}}},{{{6,3,1},{5,3,0}},{{6,3,1},{6,1,1}},{{6,3,1},{6,3,3}},{{6,3,1},{6,5,1}}},{{{6,3,3},{6,1,3}},{{6,3,3},{6,3,1}},{{6,3,3},{6,3,5}},{{6,3,3},{6,5,3}}},{{{6,3,5},{5,3,6}},{{6,3,5},{6,1,5}},{{6,3,5},{6,3,3}},{{6,3,5},{6,5,5}}},{{{6,5,1},{5,5,0}},{{6,5,1},{5,6,1}},{{6,5,1},{6,3,1}},{{6,5,1},{6,5,3}}},{{{6,5,3},{5,6,3}},{{6,5,3},{6,3,3}},{{6,5,3},{6,5,1}},{{6,5,3},{6,5,5}}},{{{6,5,5},{5,5,6}},{{6,5,5},{5,6,5}},{{6,5,5},{6,3,5}},{{6,5,5},{6,5,3}}}}
Pekerjaan menghasilkan poin pada setiap sisi eksternal dilakukan oleh fungsi h
,. Itu harus dipanggil 3 kali untuk menghasilkan titik pada x = 0, x = 6; y = 0, y = 6; dan z = 0, z = 6.
Setiap titik segi yang berjarak Manhattan 2 unit dari yang lain akan terhubung ke titik masing-masing.
Kami dapat menampilkan tepi grafik secara visual dengan mengikuti; a
adalah daftar tepi grafik yang direpresentasikan di bawah ini sebagai panah.
Graphics3D[{Arrowheads[.02],Arrow/@a},Boxed->False,Axes-> True]
Berikut ini menunjukkan kubus Rubik, titik-titik pada aspek eksternal, dan 8 tepi grafik.
Titik-titik merah terletak pada aspek di y = 0 dan y = 6; titik-titik biru dan abu-abu berada pada faset pada x = 6 dan x = 0, masing-masing; titik-titik hitam berada pada faset pada z = 6 dan z = 0.