{}\quad \text{If}[ \text{Comparew}==\{1\}\&\& \text{Comparer}==\{0\}, \text{Return}[\{1\}]]; \\
{}\quad \text{If}[ \text{Comparez}==\{-1\}\&\& \text{ZX1}[[ ii4, jj4]]==1,
\text{Return}[\{1\}]]; \\
{}\quad \text{Return}[\{1,0,-1\}];) \\  \\
(* \text{ Compare}\ Z{ ij}\ \text{ and} z_k \
*) \\
\text{CompareOrderZ2}[\{ \text{zomatrix4}\_,
\text{womatrix4}\_\},\{ ii4\_, jj4\_\},\{ kk4\_, ll
4\_\}]:=( \\
{}\quad \text{zo4}= \text{zomatrix4}; \text{wo4}= \text{womatrix4};  \text{dis}= \text{Dis3}[\{ \text{zo4}, \text{wo4}\}]; \\
{}\quad \text{If}[ \text{ZX1}[[ ii4, jj4]]==1\&\&  \text{ZX1}[[ kk4, ll4]]==0,  \text{Return}[\{1\}]]; \\
{}\quad \text{If}[ \text{ZX1}[[ ii4, jj4]]==1\&\&  \text{ZX1}[[ kk4, ll4]]==1,  \text{Return}[\{0\}]]; \\
{}\quad \text{If}[ \text{ZX1}[[ ii4, jj4]]==0\&\&  \text{ZX1}[[ kk4, ll4]]==1,  \text{Return}[\{-1\}]]; \\ \\
{}\quad \text{Comparez} = \text{CompareOrderzw}[ \text{zo4}, \{ ii4, jj4\}, \{ kk4, ll4\}]; \\
{} \quad \text{Comparew} = \text{CompareOrderzw}[ \text{wo4}, \{ ii4, jj4\}, \{ kk4, ll4\}]; \\
{}\quad \text{Comparer} = \text{CompareOrderr}[ \text{dis}, \{ ii4, jj4\}, \{ kk4, ll4\}]; \\
\\
{}\quad \text{If}[ \text{Comparez}==\{-1\}\&\& \text{Comparer}==\{1\}, \text{Return}[\{-1\}]]; \\
{}\quad \text{If}[ \text{Comparez}==\{0\}\&\&  \text{Comparer}==\{1\},  \text{Return}[\{-1\}]]; \\
{}\quad \text{If}[ \text{Comparez}==\{-1\}\&\& \text{Comparer}==\{0\}, \text{Return}[\{-1\}]]; \\
{}\quad \text{If}[ \text{Comparez}==\{0\}\&\&  \text{Comparer}==\{0\},  \text{Return}[\{0\}]]; \\
{}\quad \text{If}[ \text{Comparez}==\{1\}\&\&  \text{Comparer}==\{-1\},  \text{Return}[\{1\}]]; \\
{}\quad \text{If}[ \text{Comparez}==\{0\}\&\&  \text{Comparer}==\{-1\},  \text{Return}[\{1\}]]; \\
{}\quad \text{If}[ \text{Comparez}==\{1\}\&\&  \text{Comparer}==\{0\},  \text{Return}[\{1\}]]; \\
{}\quad \text{Return}[\{-1,0,1\}];  ) \\
\\
(* \text{ Compare}\ W{ ij}\ \text{ and} w_k \
*) \\
\text{CompareOrderW2}[\{ \text{zomatrix4}\_,
\text{womatrix4}\_\},\{ ii4\_, jj4\_\},\{ kk4\_, ll
4\_\}]:=( \\
{}\quad \text{zo4}= \text{zomatrix4}; \text{wo4}= \text{womatrix4};  \text{dis}= \text{Dis3}[\{ \text{zo4}, \text{wo4}\}]; \\
{}\quad \text{If}[ \text{WX1}[[ ii4, jj4]]==1\&\&  \text{WX1}[[ kk4, ll4]]==0,  \text{Return}[\{1\}]]; \\
{}\quad \text{If}[ \text{WX1}[[ ii4, jj4]]==1\&\&  \text{WX1}[[ kk4, ll4]]==1,  \text{Return}[\{0\}]]; \\
{}\quad \text{If}[ \text{WX1}[[ ii4, jj4]]==0\&\&  \text{WX1}[[ kk4, ll4]]==1,  \text{Return}[\{-1\}]]; \\ \\
{}\quad \text{Comparez} = \text{CompareOrderzw}[ \text{zo4}, \{ ii4, jj4\}, \{ kk4, ll4\}]; \\
{} \quad \text{Comparew} = \text{CompareOrderzw}[ \text{wo4}, \{ ii4, jj4\}, \{ kk4, ll4\}]; \\
{}\quad \text{Comparer} = \text{CompareOrderr}[ \text{dis}, \{ ii4, jj4\}, \{ kk4, ll4\}]; \\
\\
{}\quad \text{If}[ \text{Comparew}==\{-1\}\&\& \text{Comparer}==\{1\}, \text{Return}[\{-1\}]]; \\
{}\quad \text{If}[ \text{Comparew}==\{0\}\&\&  \text{Comparer}==\{1\},  \text{Return}[\{-1\}]]; \\
{}\quad \text{If}[ \text{Comparew}==\{-1\}\&\& \text{Comparer}==\{0\}, \text{Return}[\{-1\}]]; \\
{}\quad \text{If}[ \text{Comparew}==\{0\}\&\&  \text{Comparer}==\{0\},  \text{Return}[\{0\}]]; \\
{}\quad \text{If}[ \text{Comparew}==\{1\}\&\&  \text{Comparer}==\{-1\},  \text{Return}[\{1\}]]; \\
{}\quad \text{If}[ \text{Comparew}==\{0\}\&\&  \text{Comparer}==\{-1\},  \text{Return}[\{1\}]]; \\
{}\quad \text{If}[ \text{Comparew}==\{1\}\&\&  \text{Comparer}==\{0\},  \text{Return}[\{1\}]]; \\
{}\quad \text{Return}[\{-1,0,1\}];  ) \\
\\
(* \text{ Determine} \text{ possible} \text{ maximal} \text{ terms}
\text{ in}\ z_i-\text{equation}\ *) \\
\text{MaxOrderZ}[\{ \text{zomatrix3}\_, \text{womatrix3}\_\}, kk3\_] := ( \\
{}\quad \text{zo3} = \text{zomatrix3}; \text{wo3} = \text{womatrix3};  \text{max3} = \text{allind}; \\
{}\quad s3 = \text{Complement}[ \text{allind}, \{ kk3\}];  ii3 = 1; \\
{}\quad \text{While}[ ii3 <= n - 1, jj3 = ii3 + 1; \\
{}\quad \quad \text{While}[ jj3 <= n - 1, \\
{}\quad \quad \quad \text{If}[ \text{CompareOrderZ1}[\{ \text{zo3},
\text{wo3}\}, \{ kk3, s3[[ ii3]]\}, \{ kk3, s3[[ jj3]]\}] == \{1\}, \\
{}\quad \quad \quad \quad \text{max3} = \text{Complement}[ \text{max3},
\{ s3[[ jj3]]\}]; ]; \\
{}\quad \quad \quad \text{If}[ \text{CompareOrderZ1}[\{ \text{zo3},
\text{wo3}\}, \{ kk3, s3[[ ii3]]\}, \{ kk3, s3[[ jj3]]\}] == \{-1\}, \\
{}\quad \quad \quad \quad \text{max3} = \text{Complement}[ \text{max3},
\{ s3[[ ii3]]\}];  ];  jj3++ ]; \\
{}\quad \quad \text{If}[ \text{CompareOrderZ2}[\{ \text{zo3},
\text{wo3}\}, \{ kk3, kk3\}, \{ kk3, s3[[ ii3]]\}] == \{1\}, \\
{}\quad \quad \quad \text{max3} = \text{Complement}[ \text{max3}, \{
s3[[ ii3]]\}]]; \\
{}\quad \quad \text{If}[ \text{CompareOrderZ2}[\{ \text{zo3},
\text{wo3}\}, \{ kk3, kk3\}, \{ kk3, s3[[ ii3]]\}] == \{-1\}, \\
{}\quad \quad \quad \text{max3} = \text{Complement}[ \text{max3}, \{
kk3\}];  ];  ii3++];  \text{Return}[ \text{max3}]) \\
\\
(* \text{ Determine} \text{ possible} \text{ maximal} \text{ terms}
\text{ in}\ w_i-\text{equation}\ *) \\
\text{MaxOrderW}[\{ \text{zomatrix3}\_, \text{womatrix3}\_\}, kk3\_] := ( \\
{}\quad \text{zo3} = \text{zomatrix3}; \text{wo3} = \text{womatrix3};  \text{max3} = \text{allind}; \\
{}\quad s3 = \text{Complement}[ \text{allind}, \{ kk3\}];  ii3 = 1; \\
{}\quad \text{While}[ ii3 <= n - 1, jj3 = ii3 + 1; \\
{}\quad \quad \text{While}[ jj3 <= n - 1, \\
{}\quad \quad \quad \text{If}[ \text{CompareOrderW1}[\{ \text{zo3},
\text{wo3}\}, \{ kk3, s3[[ ii3]]\}, \{ kk3, s3[[ jj3]]\}] == \{1\}, \\
{}\quad \quad \quad \quad \text{max3} = \text{Complement}[ \text{max3},
\{ s3[[ jj3]]\}]; ]; \\
{}\quad \quad \quad \text{If}[ \text{CompareOrderW1}[\{ \text{zo3},
\text{wo3}\}, \{ kk3, s3[[ ii3]]\}, \{ kk3, s3[[ jj3]]\}] == \{-1\}, \\
{}\quad \quad \quad \quad \text{max3} = \text{Complement}[ \text{max3},
\{ s3[[ ii3]]\}];  ];  jj3++ ]; \\
{}\quad \quad \text{If}[ \text{CompareOrderW2}[\{ \text{zo3},
\text{wo3}\}, \{ kk3, kk3\}, \{ kk3, s3[[ ii3]]\}] == \{1\}, \\
{}\quad \quad \quad \text{max3} = \text{Complement}[ \text{max3}, \{
s3[[ ii3]]\}]]; \\
{}\quad \quad \text{If}[ \text{CompareOrderW2}[\{ \text{zo3},
\text{wo3}\}, \{ kk3, kk3\}, \{ kk3, s3[[ ii3]]\}] == \{-1\}, \\
{}\quad \quad \quad \text{max3} = \text{Complement}[ \text{max3}, \{
kk3\}];  ];  ii3++];  \text{Return}[ \text{max3}]) \\
\\
(* \text{ Proposition}\ 4.12\ *) \\
\text{Rule1cQ}[\{ \text{zomatrix2}\_, \text{womatrix2}\_\}]:=( \\
{}\quad ii2=1; \\
{}\quad \text{While}[ ii2<= \text{Length}[ \text{zc1}], \\
{}\quad \quad \text{zc2}= \text{Intersection}[ \text{zc1}[[ ii2]],
\text{Flatten}@ \text{Position}[ \text{Diagonal}[ \text{ZX1}],1]];
\\
{}\quad \quad \text{If}[ \text{Length}[ \text{zc2}]>0\&\& \text{Count}[ \text{Flatten}@ \text{zomatrix2}[[
\text{zc2}, \text{zc2}]],5]== \text{Length}[ \text{zc2}], \\
{}\quad \quad \quad \text{Return}[ \text{False}]]; \quad ii2++]; \\
{}\quad ii2=1; \\
{}\quad \text{While}[ ii2<= \text{Length}[ \text{wc1}], \\
{}\quad \quad \text{wc2}= \text{Intersection}[ \text{wc1}[[ ii2]],
\text{Flatten}@ \text{Position}[ \text{Diagonal}[ \text{WX1}],1]];
\\
{}\quad \quad \text{If}[ \text{Length}[ \text{wc2}]>0\&\& \text{Count}[ \text{Flatten}@ \text{womatrix2}[[
\text{wc2}, \text{wc2}]],5]== \text{Length}[ \text{wc2}], \\
{}\quad \quad \quad \text{Return}[ \text{False}]]; \quad ii2++]; \\
{}\quad \text{Return}[ \text{True}]) \\
\\
(* \text{ Proposition}\ 4.13\ *) \\
\text{OrderQ1}[\{ \text{zomatrix2}\_, \text{womatrix2}\_\}]:=( \\
{}\quad kk2=1; \\
{}\quad \text{While}[ kk2<= n, \\
{}\quad \quad \text{If}[ \text{Length}[ \text{MaxOrderZ}[\{
\text{zomatrix2}, \text{womatrix2}\}, kk2]]==1|| \\
{}\quad \quad \quad \text{Length}[ \text{MaxOrderW}[\{
\text{zomatrix2}, \text{womatrix2}\}, kk2]]==1, \\
{}\quad \quad \quad \text{Return}[ \text{False}]]; kk2++;  ];  \text{Return}[ \text{True}]) \\
\\
\quad (* \text{ Proposition}\ 4.14\ *) \\
\text{OrderQ2}[\{ \text{zomatrix2}\_, \text{womatrix2}\_\}]:=( \\
{}\quad \text{dis2}= \text{Dis3}[\{ \text{zomatrix2},
\text{womatrix2}\}]; ii2=1; \\
{}\quad \text{While}[ ii2<= n-1,\ jj2= ii2+1; \\
{}\quad \quad \text{While}[ jj2<= n, \\
{}\quad \quad \quad \text{If}[ \text{MaxOrderZ}[\{ \text{zomatrix2},
\text{womatrix2}\}, ii2]==\{ ii2, jj2\}\&\& \\
{}\quad \quad \quad \quad \text{MaxOrderZ}[\{ \text{zomatrix2},
\text{womatrix2}\}, jj2]==\{ ii2, jj2\}\&\& \\
{}\quad \quad \quad \quad \text{Intersection}[ \text{dis2}[[ ii2,
jj2]],\{3\}]==\{\}, \\
{}\quad \quad \quad \quad \text{Return}[ \text{False}]]; \\
{}\quad \quad \quad \text{If}[ \text{MaxOrderW}[\{ \text{zomatrix2},
\text{womatrix2}\}, ii2]==\{ ii2, jj2\}\&\& \\
{}\quad \quad \quad \quad \text{MaxOrderW}[\{ \text{zomatrix2},
\text{womatrix2}\}, jj2]==\{ ii2, jj2\}\&\& \\
{}\quad \quad \quad \quad \text{Intersection}[ \text{dis2}[[ ii2,
jj2]],\{3\}]==\{\}, \\
{}\quad \quad \quad \quad \text{Return}[ \text{False}]];  jj2++;  ];  ii2++];  \text{Return}[ \text{True}]) \\
\\
\text{(* proposition 4.15 *)}
\text{OrderQ3}[\{ \text{zomatrix2}\_, \text{womatrix2}\_\}]:=( \\
{}\quad \text{maxZ}= \text{Table}[ \text{MaxOrderZ}[\{ \text{zomatrix2},
\text{womatrix2}\}, i2],\{ i2, n\}]; \\
{}\quad \text{maxW}= \text{Table}[ \text{MaxOrderW}[\{ \text{zomatrix2},
\text{womatrix2}\}, i2],\{ i2, n\}]; \\
{}\quad ii2=1; \\
{}\quad \text{While}[ ii2<= n-2,  jj2= ii2+1; \\
{}\quad \quad \text{While}[ jj2<= n-1,  kk2= jj2+1; \\
{}\quad \quad \quad \text{While}[ kk2<= n, \\
{}\quad \quad \quad \quad \text{If}[ \text{ZX1}[[ ii2, jj2]] \text{ZX1}[[
jj2, kk2]]!=0 \&\&  \text{ZX1}[[ kk2, ii2]]==0, \\
{}\quad \quad \quad \quad \quad \text{If}[ \text{maxW}[[ jj2]]==\{ ii2,
kk2\},  \text{Return}[ \text{False}]]; \\
{}\quad \quad \quad \quad \quad \text{If}[ \text{Complement}[ \text{maxW}[[
ii2]]\cup \text{maxW}[[ jj2]]\cup \text{maxW}[[ kk2]],\{ ii2, jj2,
kk2\}]==\{\}, \\
{}\quad \quad \quad \quad \quad \quad \text{Return}[ \text{False}]]; ]; \\
{}\quad \quad \quad \quad \text{If}[ \text{WX1}[[ ii2, jj2]] \text{WX1}[[
jj2, kk2]]!=0 \&\&  \text{WX1}[[ kk2, ii2]]==0, \\
{}\quad \quad \quad \quad \quad \text{If}[ \text{maxZ}[[ jj2]]==\{ ii2,
kk2\},  \text{Return}[ \text{False}]]; \\
{}\quad \quad \quad \quad \quad \text{If}[ \text{Complement}[ \text{maxZ}[[
ii2]]\cup \text{maxZ}[[ jj2]]\cup \text{maxZ}[[ kk2]],\{ ii2, jj2,
kk2\}]==\{\}, \\
{}\quad \quad \quad \quad \quad \quad \text{Return}[ \text{False}]]; ]; \\
{}\quad \quad \quad \quad \text{If}[ \text{ZX1}[[ jj2, kk2]] \text{ZX1}[[
kk2, ii2]]!=0 \&\&  \text{ZX1}[[ ii2, jj2]]==0, \\
{}\quad \quad \quad \quad \quad \text{If}[ \text{maxW}[[ kk2]]==\{ ii2,
jj2\}, \text{Return}[ \text{False}]]; \\
{}\quad \quad \quad \quad \quad \text{If}[ \text{Complement}[ \text{maxW}[[
ii2]]\cup \text{maxW}[[ jj2]]\cup \text{maxW}[[ kk2]],\{ ii2, jj2,
kk2\}]==\{\}, \\
{}\quad \quad \quad \quad \quad \quad \text{Return}[ \text{False}]];  ]; \\
{}\quad \quad \quad \quad \text{If}[ \text{WX1}[[ jj2, kk2]] \text{WX1}[[
kk2, ii2]]!=0 \&\&  \text{WX1}[[ ii2, jj2]]==0, \\
{}\quad \quad \quad \quad \quad \text{If}[ \text{maxZ}[[ kk2]]==\{ ii2,
jj2\},  \text{Return}[ \text{False}]]; \\
{}\quad \quad \quad \quad \quad \text{If}[ \text{Complement}[ \text{maxZ}[[
ii2]]\cup \text{maxZ}[[ jj2]]\cup \text{maxZ}[[ kk2]],\{ ii2, jj2,
kk2\}]==\{\}, \\
{}\quad \quad \quad \quad \quad \quad \text{Return}[ \text{False}]]; ]; \\
{}\quad \quad \quad \quad \text{If}[ \text{ZX1}[[ kk2, ii2]] \text{ZX1}[[
ii2, jj2]]!=0 \&\&  \text{ZX1}[[ jj2, kk2]]==0, \\
{}\quad \quad \quad \quad \quad \text{If}[ \text{maxW}[[ ii2]]==\{ jj2,
kk2\},  \text{Return}[ \text{False}]]; \\
{}\quad \quad \quad \quad \quad \text{If}[ \text{Complement}[ \text{maxW}[[
ii2]]\cup \text{maxW}[[ jj2]]\cup \text{maxW}[[ kk2]],\{ ii2, jj2,
kk2\}]==\{\}, \\
{}\quad \quad \quad \quad \quad \quad \text{Return}[ \text{False}]]; ]; \\
{}\quad \quad \quad \quad \text{If}[ \text{WX1}[[ kk2, ii2]] \text{WX1}[[
ii2, jj2]]!=0 \&\&  \text{WX1}[[ jj2, kk2]]==0, \\
{}\quad \quad \quad \quad \quad \text{If}[ \text{maxZ}[[ ii2]]==\{ jj2,
kk2\},  \text{Return}[ \text{False}]]; \\
{}\quad \quad \quad \quad \quad \text{If}[ \text{Complement}[ \text{maxZ}[[
ii2]]\cup \text{maxZ}[[ jj2]]\cup \text{maxZ}[[ kk2]],\{ ii2, jj2,
kk2\}]==\{\}, \\
{}\quad \quad \quad \quad \quad \quad \text{Return}[ \text{False}]];  ]; \\
{}\quad \quad \quad \quad kk2++]; jj2++];  ii2++];  \text{Return}[ \text{True}]) \\
\\
\text{outputform1}[ \text{ordermatrix2}\_] := ( \\
{}\quad \text{OMA} = \text{ordermatrix2}; \\
{}\quad \text{OMB} = \text{Table}[ \text{If}[ \text{Length}@
\text{OMA}[[ i2, j2]] > 1, \\
{}\quad \quad \{ \text{ToString}[ \text{Min}@ \text{OMA}[[ i2, j2]]] <>
``\sim '' <> \text{ToString}[ \text{Max}@ \text{OMA}[[ i2, j2]]]\},
\\
{}\quad \quad \text{OMA}[[ i2, j2]]], \{ i2, 1, n\}, \{ j2, 1,
n\}]; \text{Return}[ \text{OMB}]) \\
\\
\text{(* MAIN PROGRAM FOR FINDING ORDERS *)} \\
\text{indOrder}[ \text{x}\_]:= \text{FindOrder}[ \text{x},60]; \\
{} \text{FindOrder}[ \text{x}\_, \text{time1}\_]:=( \\
{}\quad t1= \text{AbsoluteTime}[]; N1= \text{x}; \text{X1}= \text{FMX}[[ \text{x}]]; \\
{}\quad \text{Clear}[ \text{zwofamily}, \text{zwotype2},
\text{zwotype3}]; \\
{}\quad \text{constrainttime}= \text{time1}; \text{TF1}=0; \\
{}\quad \text{Print}[ \text{Style}[`` \text{finding } \text{zw}-
\text{order } \text{matrices } \text{covering } '', \text{Bold},16], \text{Style}[`` \text{FMX}[['' <> \\
{}\quad \quad \text{ToString}[ N1]<>``]]'', \text{Bold},16, \text{RGBColor}[0.8,0.4,0]], \text{Style}[``...'', \text{Bold},16]]; \\
{}\quad \text{zo1}= \text{Table}[\{1,2,3,4,5\},\{ i1,1, n\},\{ j1,1, n\}]; \\
{}\quad \text{wo1}= \text{Table}[\{1,2,3,4,5\},\{ i1,1, n\},\{ j1,1, n\}];
\\
{}\quad \text{ZX1}= \text{zpart}[ \text{X1}];  \text{WX1}= \text{wpart}[ \text{X1}];  \text{XX1}= \text{ZX1}+2* \text{WX1}; \\
{}\quad \text{zc1}= \text{componentsZ}[ \text{X1}]; \text{wc1}= \text{componentsW}[ \text{X1}]; \\
{}\quad \text{pmzw}=\{\}; \\
{}\quad \text{Do}[ \text{If}[ \text{ZX1}[[ \text{pm}[[ i1]], \text{pm}[[
i1]]]]== \text{ZX1}\&\& \text{WX1}[[ \text{pm}[[ i1]], \text{pm}[[ i1]]]]==
\text{WX1}, \\
{}\quad \quad \quad \text{pmzw}= \text{pmzw}\sim
\text{Join}\sim \{ \text{pm}[[ i1]]\}], \{ i1,1, \text{Length}[ \text{pm}]\}]; \\ \\
(* \text{ Proposition}\ 4.4( \text{ a})\ *) \\
\text{Do}[ \text{If}[ \text{ZX1}[[ i1, i1]]==1, \text{zo1}[[ i1, i1]]=\{5\},  \text{zo1}[[ i1, i1]]=\{0,1,2,3,4\}]; \\
{}\quad \quad \text{If}[ \text{WX1}[[ i1, i1]]==1, \text{wo1}[[ i1, i1]]=\{5\},  \text{wo1}[[ i1, i1]]=\{0,1,2,3,4\}],  \{ i1,1, n\}]; \\ \\
(* \text{ Proposition}\ 4.8\ *) \\
\text{Do}[ L1= \text{Length}[ \text{zc1}[[ i1]]]; \\
{}\quad \quad \text{Pos1}= \text{Position}[ \text{XX1}[[ \text{zc1}[[ i1]],
\text{zc1}[[ i1]]]],1]; \\
{}\quad \quad \text{Pos1}= \text{Complement}[ \text{Pos1}, \text{Table}[\{
j1, j1\},\{ j1,1, n\}]]; \\
{}\quad \quad \text{If}[ \text{Length}[ \text{Pos1}]==2\&\& \\
{}\quad \quad \quad \text{Total}[ \text{Diagonal}[ \text{ZX1}[[
\text{zc1}[[ i1]], \text{zc1}[[ i1]]]]]]>0, \\
{}\quad \quad \quad \text{Do}[ \text{zo1}[[ \text{zc1}[[ i1]][[
\text{Pos1}[[ j1]][[1]]]], \text{zc1}[[ i1]][[ \text{Pos1}[[
j1]][[2]]]]]]=\{5\}; \\
{}\quad \quad \quad \quad \text{wo1}[[ \text{zc1}[[ i1]][[ \text{Pos1}[[
j1]][[1]]]], \text{zc1}[[ i1]][[ \text{Pos1}[[ j1]][[2]]]]]]=\{1\}, \\
{}\quad \quad \quad \quad \{ j1,1,2\}]], \{ i1,1, \text{Length}[ \text{zc1}]\}]; \\
{}\quad \text{Do}[ L1= \text{Length}[ \text{wc1}[[ i1]]]; \\
{}\quad \quad \text{Pos1}= \text{Position}[ \text{XX1}[[ \text{wc1}[[ i1]],
\text{wc1}[[ i1]]]],2]; \\
{}\quad \quad \text{Pos1}= \text{Complement}[ \text{Pos1}, \text{Table}[\{
j1, j1\},\{ j1,1, n\}]]; \\
{}\quad \quad \text{If}[ \text{Length}[ \text{Pos1}]==2\&\& \\
{}\quad \quad \quad \text{Total}[ \text{Diagonal}[ \text{WX1}[[
\text{wc1}[[ i1]], \text{wc1}[[ i1]]]]]]>0, \\
{}\quad \quad \quad \text{Do}[ \text{wo1}[[ \text{wc1}[[ i1]][[
\text{Pos1}[[ j1]][[1]]]], \text{wc1}[[ i1]][[ \text{Pos1}[[
j1]][[2]]]]]]=\{5\}; \\
{}\quad \quad \quad \quad \text{zo1}[[ \text{wc1}[[ i1]][[ \text{Pos1}[[
j1]][[1]]]], \text{wc1}[[ i1]][[ \text{Pos1}[[ j1]][[2]]]]]]=\{1\}, \\
{}\quad \quad \quad \quad \{ j1,1,2\}]], \{ i1,1, \text{Length}[ \text{wc1}]\}]; \\ \\
(* \text{ Proposition}\ 4.4( b)\ *) \\
\text{Do}[ \text{If}[ i1!= j1, \\
{}\quad \quad \quad \text{If}[ \text{XX1}[[ i1, j1]]==1, \\
{}\quad \quad \quad \quad \text{zo1}[[ i1, j1]]= \text{Intersection}[
\text{zo1}[[ i1, j1]],\{4,5\}]; \\
{}\quad \quad \quad \quad \text{wo1}[[ i1, j1]]= \text{Intersection}[
\text{wo1}[[ i1, j1]],\{1,2\}]]], \\
{}\quad \quad \{ i1,1, n\}, \{ j1,1, n\}]; \\
{}\quad \text{Do}[ \text{If}[ i1!= j1, \\
{}\quad \quad \quad \text{If}[ \text{XX1}[[ i1, j1]]==2, \\
{}\quad \quad \quad \quad \text{wo1}[[ i1, j1]]= \text{Intersection}[
\text{wo1}[[ i1, j1]],\{4,5\}]; \\
{}\quad \quad \quad \quad \text{zo1}[[ i1, j1]]= \text{Intersection}[
\text{zo1}[[ i1, j1]],\{1,2\}]]], \\
{}\quad \quad \{ i1,1, n\},  \{ j1,1, n\}]; \\
{}\quad \text{Do}[ \text{If}[ i1!= j1, \\
{}\quad \quad \quad \text{If}[ \text{XX1}[[ i1, j1]]==3, \\
{}\quad \quad \quad \quad \text{wo1}[[ i1, j1]]= \text{Intersection}[
\text{wo1}[[ i1, j1]],\{3\}]; \\
{}\quad \quad \quad \quad \text{zo1}[[ i1, j1]]= \text{Intersection}[
\text{zo1}[[ i1, j1]],\{3\}]]], \\
{}\quad \quad \{ i1,1, n\}, \{ j1,1, n\}]; \\ \\
(* \text{ Determined} \text{ the} \text{ order} \text{ of}
\text{ z}\_\{ \text{ ij}\} \text{ and} \text{ w}\_\{ \text{ ij}\} \text{ if}
\text{ there} \text{ is} \text{ a}\\
{} \quad \text{ maximal}\ z-\text{ or } w- \text{stroke}\  *) \\
\text{Do}[ \text{If}[ i1!= j1, \\
{}\quad \quad \quad \text{If}[ \text{XX1}[[ i1, j1]]==1\&\& \\
{}\quad \quad \quad \quad ( \text{Total}[ \text{ZX1}[[ i1]]]+ \text{Total}[
\text{ZX1}[[ j1]]]- \text{ZX1}[[ i1, i1]]- \text{ZX1}[[ j1, j1]])==2, \\
{}\quad \quad \quad \quad \text{zo1}[[ i1, j1]]= \text{Intersection}[
\text{zo1}[[ i1, j1]],\{5\}]; \\
{}\quad \quad \quad \quad \text{wo1}[[ i1, j1]]= \text{Intersection}[
\text{wo1}[[ i1, j1]],\{1\}]]], \\
{}\quad \quad \{ i1,1, n\}, \{ j1,1, n\}]; \\
{}\quad \text{Do}[ \text{If}[ i1!= j1, \\
{}\quad \quad \quad \text{If}[ \text{XX1}[[ i1, j1]]==2\&\& \\
{}\quad \quad \quad \quad ( \text{Total}[ \text{WX1}[[ i1]]]+ \text{Total}[
\text{WX1}[[ j1]]]- \text{WX1}[[ i1, i1]]- \text{WX1}[[ j1, j1]])==2, \\
{}\quad \quad \quad \quad \text{zo1}[[ i1, j1]]= \text{Intersection}[
\text{zo1}[[ i1, j1]],\{1\}]; \\
{}\quad \quad \quad \quad \text{wo1}[[ i1, j1]]= \text{Intersection}[
\text{wo1}[[ i1, j1]],\{5\}]]], \\
{}\quad \quad \{ i1,1, n\}, \{ j1,1, n\}]; \\ \\
(* \text{ Proposition}\ 4.4( b)\ *) \\
\text{Do}[ \text{If}[ i1!= j1, \\
{}\quad \quad \quad \text{If}[ \text{ZX1}[[ i1, j1]]==0, \\
{}\quad \quad \quad \quad \text{wo1}[[ i1, j1]]= \text{Intersection}[
\text{wo1}[[ i1, j1]],\{2,3,4,5\}]]], \\
{}\quad \quad \{ i1,1, n\}, \{ j1,1, n\}]; \\
{}\quad \text{Do}[ \text{If}[ i1!= j1, \\
{}\quad \quad \quad \text{If}[ \text{WX1}[[ i1, j1]]==0, \\
{}\quad \quad \quad \quad \text{zo1}[[ i1, j1]]= \text{Intersection}[
\text{zo1}[[ i1, j1]],\{2,3,4,5\}]]], \\
{}\quad \quad \{ i1,1, n\}, \{ j1,1, n\}]; \\ \\
{}\quad (* \text{ Refine } zw- \text{order} \text{ matrices}
\text{ by} \text{ principles} \text{ for} \text{ updating} \text{ orders}\ *)
\\
\{ \text{zo1}, \text{wo1}\}= \text{UpdateOrder}[\{ \text{zo1},
\text{wo1}\}]; \\
{}\quad \text{Print}[ \text{Style}[`` \text{result} \text{of} \text{setp}
1:'', \text{Bold},15]]; \\
{}\quad \text{Print}[`` \text{cumulative} \text{time}: '',
\text{AbsoluteTime}[]- t1, `` \setminus \text{n}'' ]; \\
{}\quad \text{Print}[``\{ \text{z}- \text{order}, \text{w}- \text{order},
r- \text{order}\} \text{matrices} :'']; \\
{}\quad \text{Print}[\{ \text{Style}[ \text{MatrixForm}[
\text{outputform1}@ \text{zo1}], \text{Blue}],\\
{}\quad\quad \text{Style}[\text{MatrixForm}[ \text{outputform1}@ \text{wo1}], \text{Blue}], \\
{}\quad\quad \text{Style}[ \text{MatrixForm}[ \text{outputform1}@ \text{Dis3}[\{
\text{zo1}, \text{wo1}\}]], \text{RGBColor}[0,0.5,0]]\}]; \\
{}\quad \text{Str}=`` \text{There} \text{are} ''<> \text{ToString}[
\text{NumberofType2}[\{ \text{zo1}, \text{wo1}\}]]<> \\
{}\quad\quad \quad\ `` \text{possible}
\text{zw}- \text{order} \text{matrices} \text{of} \text{Type} 2.''; \text{Print}[ \text{Str}, `` \setminus \text{n}\setminus \text{n}'']; \\
{}\quad \text{Str}=`` \text{There} \text{are} ''<> \text{ToString}[
\text{NumberofType3}[\{ \text{zo1}, \text{wo1}\}]]<> \\
{}\quad\quad \quad\ `` \text{possible}
\text{zw}- \text{order} \text{matrices} \text{of} \text{Type} 3.''; \text{Print}[ \text{Str}, `` \setminus \text{n}\setminus \text{n}'']; \\ \\
\text{(* Step 2: Type 2 order matrices *)} \\
\text{zwotype2} = \{\};  \text{zwotype3} = \{\}; \\
{} \text{TimeConstrained}[ \text{zwofamily} = \{\{ \text{zo1},
\text{wo1}\}\}; \\
{} \text{While}[ \text{Length}[ \text{zwofamily}] > 0, \\
{}\quad L1 = \text{Length}[ \text{zwofamily}]; \text{Lz1} = 0; \text{Lw1} = 0; \text{Del} = \{\}; \\
{}\quad \text{Do}[ \text{If}[ \text{NumberofType2}[ \text{zwofamily}[[
i1]]] > 1, \\
{}\quad \quad \quad \text{Del} = \text{Del}\sim \text{Join}\sim
\{\{ i1\}\}; \\
{}\quad \quad \quad \{ \text{Pzi}, \text{Pzj}, \text{Lz1}\} =
\text{PosOffDiag}[ \text{zwofamily}[[ i1]][[1]]]; \\
{}\quad \quad \quad \text{If}[ \text{Lz1} == 0, \\
{}\quad \quad \quad \quad \{ \text{Pwi}, \text{Pwj}, \text{Lw1}\} =
\text{PosOffDiag}[ \text{zwofamily}[[ i1]][[2]]]; \\
{}\quad \quad \quad \quad \text{Do}[ \text{zwofamily} =
\text{zwofamily}\sim \text{Join}\sim \{ \text{zwofamily}[[ i1]]\}; \\
{}\quad \quad \quad \quad \quad \text{zwofamily}[[-1]][[2]][[
\text{Pwi}, \text{Pwj}]] = \{ \text{zwofamily}[[ i1]][[2]][[
\text{Pwi}, \text{Pwj}]][[ j1]]\}; \\
{}\quad \quad \quad \quad \quad \text{zwofamily}[[-1]][[2]][[
\text{Pwj}, \text{Pwi}]] = \{ \text{zwofamily}[[ i1]][[2]][[
\text{Pwi}, \text{Pwj}]][[ j1]]\}; \\
{}\quad \quad \quad \quad \quad \text{zwofamily}[[-1]] =
\text{UniqueZeroOrder}[ \text{zwofamily}[[-1]]]; \\
{}\quad \quad \quad \quad \quad \text{zwofamily}[[-1]] =
\text{UpdateOrder}[ \text{zwofamily}[[-1]]];  \\
{}\quad \quad \quad \quad \quad \{ j1, 1, \text{Lw1}\}] , \\
{}\quad \quad \quad \quad \text{Do}[ \text{zwofamily} =
\text{zwofamily}\sim \text{Join}\sim \{ \text{zwofamily}[[ i1]]\}; \\
{}\quad \quad \quad \quad \quad \text{zwofamily}[[-1]][[1]][[
\text{Pzi}, \text{Pzj}]] = \{ \text{zwofamily}[[ i1]][[1]][[
\text{Pzi}, \text{Pzj}]][[ j1]]\}; \\
{}\quad \quad \quad \quad \quad \text{zwofamily}[[-1]][[1]][[
\text{Pzj}, \text{Pzi}]] = \{ \text{zwofamily}[[ i1]][[1]][[
\text{Pzi}, \text{Pzj}]][[ j1]]\}; \\
{}\quad \quad \quad \quad \quad \text{zwofamily}[[-1]] =
\text{UniqueZeroOrder}[ \text{zwofamily}[[-1]]]; \\
{}\quad \quad \quad \quad \quad \text{zwofamily}[[-1]] =
\text{UpdateOrder}[ \text{zwofamily}[[-1]]]; \\
{}\quad \quad \quad \quad \quad \{ j1, 1, \text{Lz1}\}] ] ],  \{ i1, 1, L1\}]; \\
{}\quad \text{zwofamily} = \text{Delete}[ \text{zwofamily},
\text{Del}]; \\
{}\quad \text{zwotype2} = \text{zwotype2}\sim
\text{Join}\sim \text{Select}[ \text{zwofamily}, \text{NumberofType2}[\#] ==
1 \&]; \\
{}\quad \text{zwofamily} = \text{Select}[ \text{zwofamily},
\text{NumberofType2}[\#] > 1 \& ];  ]; \\
{} (* \text{ End } \text{of } \text{While } \text{loop } *) \\ \\
\text{zwotype2} = \text{Select}[ \text{zwotype2},
\text{Rule2hQ}]; \\
{} \text{zwotype2} = \text{Select}[ \text{zwotype2},
\text{OrderQ1}]; \\
{} \text{zwotype2} = \text{Select}[ \text{zwotype2},
\text{OrderQ2}]; \\
{} \text{zwotype2} = \text{Select}[ \text{zwotype2},
\text{OrderQ3}]; \\
{} \text{zwotype2} = \text{Select}[ \text{zwotype2},
\text{Rule1cQ}]; \\ \\
{} \text{del} = \{\}; ii1 = 2; \\
{} \text{While}[ ii1 <= \text{Length}[ \text{zwotype2}], jj1 = 1;  \text{tf1} = 0; \\
{}\quad \text{While}[ jj1 < ii1 \&\&  \text{tf1} == 0,  kk1 = 1; \\
{}\quad \quad \text{While}[ kk1 <= \text{Length}[ \text{pmzw}], \\
{}\quad \quad \quad \text{If}[ \text{zwotype2}[[ ii1]][[1]] ==
\text{zwotype2}[[ jj1]][[1]][[ \text{pmzw}[[ kk1]],
\text{pmzw}[[ kk1]]]] \&\& \\
{}\quad \quad \quad \quad \text{zwotype2}[[ ii1]][[2]] ==
\text{zwotype2}[[ jj1]][[2]][[ \text{pmzw}[[ kk1]],
\text{pmzw}[[ kk1]]]], \\
{}\quad \quad \quad \quad \text{del} = \text{del}\sim
\text{Join}\sim \{\{ ii1\}\}; \\
{}\quad \quad \quad \quad \text{tf1} = 1];  kk1++]; jj1++]; ii1++]; \\
{} \text{zwotype2} = \text{Delete}[ \text{zwotype2},
\text{del}]; \\
{} \text{Print}[ ``\setminus \text{n} '' , \text{Style}[`` \text{result} \text{of} \text{setp}
2:'', \text{Bold}, 15]]; \\
{} \text{Print}[`` \text{cumulative} \text{time}: '',
\text{AbsoluteTime}[] - t1, \ ``\setminus \text{n} '' ]; \\
{} \text{Print}[`` \text{There } \text{are } '', \text{Style}[
\text{Length}[ \text{zwotype2}], \text{Bold},
\text{RGBColor}[0, 0, 0.7], 14],\\
{} \quad `` zw-\text{order } \text{matrices } \text{of } \text{Type } 2.'']; \\
{} \text{Print}[``\{ z-\text{order},\ w-\text{order}, r-
\text{order }\}\ \text{matrices} :'']; \\
{} \text{Print}[ \text{Table}[\{ \text{Style}[ \text{MatrixForm}[
\text{outputform1}@ \text{zwotype2}[[ j1, 1]]], \text{Blue}], \\
{} \quad
\text{Style}[ \text{MatrixForm}[ \text{outputform1}@
\text{zwotype2}[[ j1, 2]]], \text{Blue}], \\
{} \quad \text{Style}[ \text{MatrixForm}[ \text{outputform1}@ \text{Dis3}[
\text{zwotype2}[[ j1]]]],\\
{} \quad  \text{RGBColor}[0, 0.5, 0]]\}, \{ j1,
1, \text{Length}[ \text{zwotype2}]\}]]; \\
{} \text{Str} = `` \text{There } \text{are } '' <> \text{ToString}[
\text{Sum}[ \text{NumberofType3}[ \text{zwotype2}[[ i1]]],\\
{}\quad\quad \{ i1, 1, \text{Length}[ \text{zwotype2}]\}]] <> ``
\text{ possible } \text{zw }- \text{order } \text{matrices } \text{of }
\text{Type } 3.''; \\
{} \text{Print}[ \text{Str},\ ``\setminus \text{n} '']; \\
\\
\text{(* Step 3: Type 3 order matrices *)} \\
{} \text{zwofamily}= \text{zwotype2}; \\
{} \text{While}[ \text{Length}[ \text{zwofamily}]>0, \\
{}\quad L1= \text{Length}[ \text{zwofamily}]; \text{Lz1}=0; \text{Lw1}=0;  \text{Del}=\{\}; \\
{}\quad \text{Do}[ \text{If}[ \text{NumberofType3}[ \text{zwofamily}[[
i1]]]>1, \\
{}\quad \quad \quad \text{Del}= \text{Del}\sim \text{Join}\sim \{\{
i1\}\}; \\
{}\quad \quad \quad \{ \text{Pzd}, \text{Lz1}\}= \text{PosDiag}[
\text{zwofamily}[[ i1]][[1]]]; \\
{}\quad \quad \quad \text{If}[ \text{Lz1}==0, \\
{}\quad \quad \quad \quad \{ \text{Pwd}, \text{Lw1}\}= \text{PosDiag}[
\text{zwofamily}[[ i1]][[2]]]; \\
{}\quad \quad \quad \quad \text{Do}[ \text{zwofamily}= \text{zwofamily}\sim
\text{Join}\sim \{ \text{zwofamily}[[ i1]]\}; \\
{}\quad \quad \quad \quad \quad \text{zwofamily}[[-1]][[2]][[ \text{Pwd},
\text{Pwd}]]=\{ \text{zwofamily}[[ i1]][[2]][[ \text{Pwd}, \text{Pwd}]][[
j1]]\}; \\
{}\quad \quad \quad \quad \quad \text{zwofamily}[[-1]]=
\text{UpdateOrderPart}[ \text{zwofamily}[[-1]]]; , \\
{}\quad \quad \quad \quad \quad \{ j1,1, \text{Lw1}\}], \\
{}\quad \quad \quad \quad \text{Do}[ \text{zwofamily}= \text{zwofamily}\sim
\text{Join}\sim \{ \text{zwofamily}[[ i1]]\}; \\
{}\quad \quad \quad \quad \quad \text{zwofamily}[[-1]][[1]][[ \text{Pzd},
\text{Pzd}]]=\{ \text{zwofamily}[[ i1]][[1]][[ \text{Pzd}, \text{Pzd}]][[
j1]]\}; \\
{}\quad \quad \quad \quad \quad \text{zwofamily}[[-1]]=
\text{UpdateOrderPart}[ \text{zwofamily}[[-1]]]; , \\
{}\quad \quad \quad \quad \quad \{ j1,1, \text{Lz1}\}]]], \\
{}\quad \quad \{ i1,1, L1\}]; \\
{}\quad \text{zwofamily}= \text{Delete}[ \text{zwofamily}, \text{Del}]; \\
{}\quad \text{zwotype3}= \text{zwotype3}\sim \text{Join}\sim
\text{Select}[ \text{zwofamily}, \text{NumberofType3}[\#]==1\&]; \\
{}\quad \text{zwofamily}= \text{Select}[ \text{zwofamily},
\text{NumberofType3}[\#]>1\&]; \\
{}\quad ]; \text{del}=\{\}; ii1=2; \\
{} \text{While}[ ii1<= \text{Length}[ \text{zwotype3}],  jj1=1;  \text{tf1}=0; \\
{}\quad \text{While}[ jj1< ii1\&\&  \text{tf1}==0,  kk1=1; \\
{}\quad \quad \text{While}[ kk1<= \text{Length}[ \text{pmzw}], \\
{}\quad \quad \quad \text{If}[ \text{zwotype3}[[ ii1]][[1]]==
\text{zwotype3}[[ jj1]][[1]][[ \text{pmzw}[[ kk1]], \text{pmzw}[[ kk1]]]]\&\&
\\
{}\quad \quad \quad \quad \text{zwotype3}[[ ii1]][[2]]== \text{zwotype3}[[
jj1]][[2]][[ \text{pmzw}[[ kk1]], \text{pmzw}[[ kk1]]]], \\
{}\quad \quad \quad \quad \text{del}= \text{del}\sim \text{Join}\sim \{\{
ii1\}\}; \text{tf1}=1];  kk1++];  jj1++]; ii1++]; \\
\\
{} \text{zwotype3}= \text{Delete}[ \text{zwotype3}, \text{del}]; \\
{} \text{zwotype3}= \text{Select}[ \text{zwotype3}, \text{OrderQ1}]; \\
{} \text{zwotype3}= \text{Select}[ \text{zwotype3}, \text{OrderQ2}]; \\
{} \text{zwotype3}= \text{Select}[ \text{zwotype3}, \text{Rule1cQ}]; \\ \\
{} l1= \text{Length}[ \text{zwotype3}]; \\
{} \text{Print}[ \text{Style}[`` \text{result} \text{of} \text{setp} 3:'',
\text{Bold},15]]; \\
{} \text{Print}[`` \text{cumulative} \text{time}: '',
\text{AbsoluteTime}[]- t1 , \ ``\setminus \text{n} '']; \\
{} \text{Print}[`` \text{There } \text{are } '', \text{Style}[ l1,
\text{Bold}, \text{RGBColor}[0,0,0.7],14],  `` \text{zw}- \text{order } \text{matrices } \text{of } \text{Type } 3.'']; \\
\\
\text{(* Output results of FindOrder *)} \\
{} \quad \text{If}[ l1<=10,  \text{Print}[``\{ \text{z}- \text{order}, \text{w}- \text{order}, r- \text{order}\} \text{ matrices} :'']; \\
{}\quad \text{Print}[ \text{Table}[\{ \text{Style}[ \text{MatrixForm}[
\text{outputform1}@ \text{zwotype3}[[ j1,1]]], \text{Blue}], \\
{} \quad \quad \text{Style}[ \text{MatrixForm}[ \text{outputform1}@ \text{zwotype3}[[ j1,2]]], \text{Blue}],\\
{}\quad \quad \text{Style}[ \text{MatrixForm}[ \text{outputform1}@
\text{Dis3}[ \text{zwotype3}[[ j1]]]],\\
{}\quad \quad\quad\  \text{RGBColor}[0,0.5,0]]\},\{ j1,1,
\text{Length}[ \text{zwotype3}]\}]]]; \\
{} \text{If}[ \text{Length}[ \text{zwotype3}]==0,  \text{Str}=`` \text{matrix} \text{FMX}[[''<> \text{ToString}[ N1]<>``]] \text{is} \text{impossible}''; \\
{}\quad \text{Print}[\ ``\setminus \text{n} '', \text{Str} ,\ ``\setminus \text{n} '']];  \text{TF1}=1; , \text{constrainttime}]; \\
{} \text{If}[ \text{TF1}==0,  \text{Str}=`` \text{stop} \text{running} \text{FMX}[[''<> \text{ToString}[ N1]<>``]]''; \\
{}\quad \text{Print}[ \text{Str},\ ``\setminus \text{n} '']; ]) \\
\text{(* End of FindOrder *)}
\)

§ APPENDIX III: PROGRAM FOR ALGORITHM III BY MATHEMATICA

\(
\text{(* Set variables *)}  \\
\text{Z}= \text{Table}[ \text{ToExpression}[`` \text{Z}''<>
\text{ToString}[ j1]<> \text{ToString}[ k1]],\{ j1,1, n\},\{ k1,1, n\}]; \\
{} \text{W}= \text{Table}[ \text{ToExpression}[`` \text{W}''<>
\text{ToString}[ j1]<> \text{ToString}[ k1]],\{ j1,1, n\},\{ k1,1, n\}]; \\
{} u= \text{Table}[ \text{ToExpression}[`` u''<> \text{ToString}[ j1]<>
\text{ToString}[ k1]],\{ j1,1, n\},\{ k1,1, n\}]; \\
{} v= \text{Table}[ \text{ToExpression}[`` v''<> \text{ToString}[ j1]<>
\text{ToString}[ k1]],\{ j1,1, n\},\{ k1,1, n\}]; \\
{} \text{zz}= \text{Table}[ \text{ToExpression}[`` \text{z}''<>
\text{ToString}[ j1]<> \text{ToString}[ k1]],\{ j1,1, n\},\{ k1,1, n
\}]; \\
{} \text{ww}= \text{Table}[ \text{ToExpression}[`` \text{w}''<>
\text{ToString}[ j1]<> \text{ToString}[ k1]],\{ j1,1, n\},\{ k1,1, n
\}]; \\
{} rr= \text{Table}[ \text{ToExpression}[`` r''<> \text{ToString}[ j1]<>
\text{ToString}[ k1]],\{ j1,1, n\},\{ k1,1, n
\}]; \\
{} \text{delta}= \text{Table}[ \text{ToExpression}[``\delta ''<>
\text{ToString}[ j1]<> \text{ToString}[ k1]],\{ j1,1, n\},\{ k1,1, n\}];
\\
{} \text{z}= \text{Table}[ \text{ToExpression}[`` \text{z}''<>
\text{ToString}[ j1]],\{ j1,1, n\}]; \\
{} \text{w}= \text{Table}[ \text{ToExpression}[`` \text{w}''<>
\text{ToString}[ j1]],\{ j1,1, n\}]; \\
{} \text{zeta}= \text{Table}[ \text{ToExpression}[``\zeta ''<>
\text{ToString}[ j1]],\{ j1,1, n\}]; \\
{} \text{omega}= \text{Table}[ \text{ToExpression}[``\omega ''<>
\text{ToString}[ j1]],\{ j1,1, n\}]; \\
{} M= \text{Table}[ \text{ToExpression}[`` m''<> \text{ToString}[ j1]],\{
j1,1, n\}]; \\
{} \text{mu}= \text{Table}[ \text{ToExpression}[``\mu ''<> \text{ToString}[
j1]],\{ j1,1, n\}]; \\
{} \text{Vardis}= \text{Flatten}[ \text{Join}[ \text{zz}, \text{ww},
\text{delta}]]; \\
{} \text{Var}= \text{Flatten}[ \text{Join}[ \text{zz}, \text{ww},
\text{delta}, \text{z}, \text{w}, M]]; \\
{} \text{zpart}[\{ \text{zmx4}\_, \text{wmx4}\_\}]:= \text{zmx4}; \\
{} \text{wpart}[\{ \text{zmx4}\_, \text{wmx4}\_\}]:= \text{wmx4}; \\
\\
\text{(* Determine whether the possible max order terms in a $z_i$- or $w_i$-equation }\\
\text{are indeed maximal *)}  \\
\text{CertainMaxOrderZQ}[\{ \text{zomatrix3}\_,
\text{womatrix3}\_\}, k3\_]:=( \\
{}\quad \text{zo3}= \text{zomatrix3}; \text{wo3}= \text{womatrix3};  \text{max3}= \text{MaxOrderZ}[\{ \text{zo3}, \text{wo3}\}, k3]; \\
{}\quad \text{If}[ \text{Length}[ \text{max3}]==2, \text{Return}[ \text{True}]]; \\
{}\quad \text{If}[ \text{Length}[ \text{max3}]>2,  \text{Max3}=\{\}; \\
{}\quad \quad \text{Do}[ \text{Do}[ \text{If}[ \text{max3}[[ i3]]== k3\&\&  \text{max3}[[ i3]]!= \text{max3}[[ j3]], \\
{}\quad \quad \quad \quad \quad \text{If}[ \text{CompareOrderZ2}[\{
\text{zo3}, \text{wo3}\},\{ k3, \text{max3}[[ i3]]\},\{ k3, \text{max3}[[
j3]]\}]==\{0\}, \\
{}\quad \quad \quad \quad \quad \quad \text{Max3}= \text{Max3}\sim
\text{Join}\sim \{\{ \text{max3}[[ i3]],
\text{max3}[[ j3]]\}\}]; ]; \\
{}\quad \quad \quad \quad \text{If}[ \text{max3}[[ j3]]== k3\&\& \text{max3}[[ i3]]!= \text{max3}[[ j3]], \\
{}\quad \quad \quad \quad \quad \text{If}[ \text{CompareOrderZ2}[\{
\text{zo3}, \text{wo3}\},\{ k3, \text{max3}[[ j3]]\},\{ k3, \text{max3}[[
i3]]\}]==\{0\}, \\
{}\quad \quad \quad \quad \quad \quad \text{Max3}= \text{Max3}\sim
\text{Join}\sim \{\{ \text{max3}[[ i3]],
\text{max3}[[ j3]]\}\}];  ]; \\
{}\quad \quad \quad \quad \text{If}[ \text{max3}[[ i3]]!= k3\&\& \text{max3}[[ j3]]!= k3\&\& \text{max3}[[ i3]]!= \text{max3}[[ j3]], \\
{}\quad \quad \quad \quad \quad \text{If}[ \text{CompareOrderZ1}[\{
\text{zo3}, \text{wo3}\},\{ k3, \text{max3}[[ j3]]\},\{ k3, \text{max3}[[
i3]]\}]==\{0\}, \\
{}\quad \quad \quad \quad \quad \quad \text{Max3}= \text{Max3}\sim
\text{Join}\sim \{\{ \text{max3}[[ i3]],
\text{max3}[[ j3]]\}\}];  ];  , \\
{}\quad \quad \quad \quad \{ j3, i3+1, \text{Length}[ \text{max3}]\}]; , \{ i3,1, \text{Length}[ \text{max3}]-1\}]; \\
{}\quad \quad \text{If}[ \text{Length}[ \text{Max3}]>1, \\
{}\quad \quad \quad \text{Do}[ \text{Do}[ \text{Do}[ \text{If}[
\text{Intersection}[ \text{Max3}[[ i3]], \text{Max3}[[ j3]]]!=\{\}, \\
{}\quad \quad \quad \quad \quad \quad \quad \text{Max3}[[ i3]]=
\text{Max3}[[ i3]]\cup \text{Max3}[[ j3]];  \text{Max3}[[ j3]]=\{\}; ];  , \\
{}\quad \quad \quad \quad \quad \quad \{ j3, i3+1, \text{Length}[
\text{Max3}]\}], \{ i3,1, \text{Length}[ \text{Max3}]\}],  \{ ii3,1, \text{Length}[ \text{Max3}]\}]; ]; \\
{}\quad \quad \text{Max3}= \text{Complement}[ \text{Max3},\{\{\}\}]; \\
{}\quad \quad \text{If}[ \text{Length}[ \text{Max3}]==1\&\& \text{Flatten}[ \text{Max3}]== \text{max3},  \text{Return}[ \text{True}],  \text{Return}[ \text{False}]];  ]) \\
\\
\text{CertainMaxOrderWQ}[\{ \text{zomatrix3}\_,
\text{womatrix3}\_\}, k3\_]:=( \\
{}\quad \text{zo3}= \text{zomatrix3}; \text{wo3}= \text{womatrix3};  \text{max3}= \text{MaxOrderW}[\{ \text{zo3}, \text{wo3}\}, k3]; \\
{}\quad \text{If}[ \text{Length}[ \text{max3}]==2, \text{Return}[ \text{True}]]; \\
{}\quad \text{If}[ \text{Length}[ \text{max3}]>2,  \text{Max3}=\{\}; \\
{}\quad \quad \text{Do}[ \text{Do}[ \text{If}[ \text{max3}[[ i3]]== k3\&\&  \text{max3}[[ i3]]!= \text{max3}[[ j3]], \\
{}\quad \quad \quad \quad \quad \text{If}[ \text{CompareOrderW2}[\{
\text{zo3}, \text{wo3}\},\{ k3, \text{max3}[[ i3]]\},\{ k3, \text{max3}[[
j3]]\}]==\{0\}, \\
{}\quad \quad \quad \quad \quad \quad \text{Max3}= \text{Max3}\sim
\text{Join}\sim \{\{ \text{max3}[[ i3]],
\text{max3}[[ j3]]\}\}]; ]; \\
{}\quad \quad \quad \quad \text{If}[ \text{max3}[[ j3]]== k3\&\& \text{max3}[[ i3]]!= \text{max3}[[ j3]], \\
{}\quad \quad \quad \quad \quad \text{If}[ \text{CompareOrderW2}[\{
\text{zo3}, \text{wo3}\},\{ k3, \text{max3}[[ j3]]\},\{ k3, \text{max3}[[
i3]]\}]==\{0\}, \\
{}\quad \quad \quad \quad \quad \quad \text{Max3}= \text{Max3}\sim
\text{Join}\sim \{\{ \text{max3}[[ i3]],
\text{max3}[[ j3]]\}\}];  ]; \\
{}\quad \quad \quad \quad \text{If}[ \text{max3}[[ i3]]!= k3\&\& \text{max3}[[ j3]]!= k3\&\& \text{max3}[[ i3]]!= \text{max3}[[ j3]], \\
{}\quad \quad \quad \quad \quad \text{If}[ \text{CompareOrderW1}[\{
\text{zo3}, \text{wo3}\},\{ k3, \text{max3}[[ j3]]\},\{ k3, \text{max3}[[
i3]]\}]==\{0\}, \\
{}\quad \quad \quad \quad \quad \quad \text{Max3}= \text{Max3}\sim
\text{Join}\sim \{\{ \text{max3}[[ i3]],
\text{max3}[[ j3]]\}\}];  ];  , \\
{}\quad \quad \quad \quad \{ j3, i3+1, \text{Length}[ \text{max3}]\}]; , \{ i3,1, \text{Length}[ \text{max3}]-1\}]; \\
{}\quad \quad \text{If}[ \text{Length}[ \text{Max3}]>1, \\
{}\quad \quad \quad \text{Do}[ \text{Do}[ \text{Do}[ \text{If}[
\text{Intersection}[ \text{Max3}[[ i3]], \text{Max3}[[ j3]]]!=\{\}, \\
{}\quad \quad \quad \quad \quad \quad \quad \text{Max3}[[ i3]]=
\text{Max3}[[ i3]]\cup \text{Max3}[[ j3]];\text{Max3}[[ j3]]=\{\}; ];  , \\
{}\quad \quad \quad \quad \quad \quad \{ j3, i3+1, \text{Length}[
\text{Max3}]\}], \{ i3,1, \text{Length}[ \text{Max3}]\}],  \{ ii3,1, \text{Length}[ \text{Max3}]\}]; ]; \\
{}\quad \quad \text{Max3}= \text{Complement}[ \text{Max3},\{\{\}\}]; \\
{}\quad \quad \text{If}[ \text{Length}[ \text{Max3}]==1\&\& \text{Flatten}[ \text{Max3}]== \text{max3},  \text{Return}[ \text{True}],  \text{Return}[ \text{False}]];  ]) \\ \\
\text{(* Determine the $z_i$-equations corresponding to $zw$-order matrices for each $i$} \\
\text{in the given set of bodies *)}  \\
\text{EqnMZO}[\{ \text{zomatrix2}\_, \text{womatrix2}\_\},
\text{VertexSet2}\_] := ( \\
{}\quad \text{zo2} = \text{zomatrix2}; \text{wo2} = \text{womatrix2}; \text{eqnset2} = \{\}; \\
{}\quad \text{Do}[ \text{If}[ \text{CertainMaxOrderZQ}[\{ \text{zo2},
\text{wo2}\}, i2] == \text{True}, \\
{}\quad \quad \quad \text{eqn2} = 0; \text{max2} = \text{MaxOrderZ}[\{ \text{zo2},
\text{wo2}\}, i2]; \\
{}\quad \quad \quad \text{Do}[ \text{If}[ \text{MemberQ}[ \text{max2},
j2] == \text{True}, \text{eqn2} = \text{eqn2} + M[[
j2]]* \text{Z}[[ i2, j2]]], \{ j2, 1, n\}]; \\
{}\quad \quad \quad \text{eqnset2} = \text{eqnset2} \cup \{
\text{eqn2}\}; ] , \{ i2, \text{VertexSet2}\}]; \\
{}\quad \text{Return}[ \text{eqnset2}]; ) \\
\\
\text{(* Determine the $w_i$-equations corresponding to $zw$-order matrices for each $i$} \\
\text{in the given set of bodies *)}  \\
\text{EqnMWO}[\{ \text{zomatrix2}\_, \text{womatrix2}\_\},
\text{VertexSet2}\_] := ( \\
{}\quad \text{zo2} = \text{zomatrix2}; \text{wo2} = \text{womatrix2}; \text{eqnset2} = \{\}; \\
{}\quad \text{Do}[ \text{If}[ \text{CertainMaxOrderWQ}[\{ \text{zo2},
\text{wo2}\}, i2] == \text{True}, \\
{}\quad \quad \quad \text{eqn2} = 0; \text{max2} = \text{MaxOrderW}[\{ \text{zo2},
\text{wo2}\}, i2]; \\
{}\quad \quad \quad \text{Do}[ \text{If}[ \text{MemberQ}[ \text{max2},
j2] == \text{True}, \text{eqn2} = \text{eqn2} + M[[
j2]]* \text{W}[[ i2, j2]]], \{ j2, 1, n\}]; \\
{}\quad \quad \quad \text{eqnset2} = \text{eqnset2} \cup \{
\text{eqn2}\}; ] , \{ i2, \text{VertexSet2}\}]; \\
{}\quad \text{Return}[ \text{eqnset2}]; ) \\
\\
\text{(* define functions for searching mass relations *)}  \\
\\
\text{(* Replace } m_iZ_{{ii}}\text{'s} ,\ m_iW_{{ii}}\text{'s} \text{ by } z_i, w_i \text{ resp}.\text{  }\text{*)}  \\
\text{Relation1}[ \text{x2}\_] := ( \\
{}\quad \text{y2} = \text{x2}; \\
{}\quad \text{Do}[ \text{Do}[ \text{y2}[[ j2]] = \text{y2}[[ j2]]
/. \{ M[[ i2]]* \text{Z}[[ i2, i2]] \to \text{z}[[
i2]], M[[ i2]]* \text{W}[[ i2, i2]] \to \text{w}[[ i2]]\}, \\
{}\quad \quad \quad \{ i2, 1, n\}], \{ j2, 1, \text{Length}[ \text{y2}]\}]; \text{Return}[ \text{y2}]) \\
\\
\text{(* For each pair of } (i,j) \text{ with } i>j, \text{ replace } Z_{ij} , W_{ij} \text{ by } -Z_{{ji}} ,\ -W_{{ji}} \text{ resp}.\text{  }\text{*)}  \\
\text{Relation2}[ \text{x2}\_]:=( \\
{}\quad \text{y2}= \text{x2}; \\
{}\quad \text{Do}[ \text{Do}[ \text{Do}[ \text{y2}[[ k2]]= \text{y2}[[
k2]]/.\{ \text{Z}[[ i2, j2]]\to- \text{Z}[[ j2, i2]], \text{W}[[ i2, j2]]\to-
\text{W}[[ j2, i2]]\}, \\
{}\quad \quad \quad \quad \{ i2, j2+1, n\}], \{ j2,1, n-1\}],  \{ k2,1, \text{Length}[ \text{y2}]\}]; \text{Return}[ \text{y2}]) \\
\\
\text{(* For each pair of } (i,j) , \text{ replace } Z_{ij} , W_{ij} \text{ by } -z_{{ji}}^{-1/2}w_{ij}^{-3/2} ,\ w_{{ji}}^{-1/2}z_{ij}^{-3/2} \text{ resp}.\text{  }\text{*)}  \\
\text{Relation3ver1}[ \text{x2}\_]:=( \\
{}\quad \text{y2}= \text{x2}; \\
{}\quad \text{Do}[ \text{Do}[ \text{Do}[ \text{y2}[[ k2]]= \text{y2}[[
k2]]/.\{ \text{Z}[[ i2, j2]]\to \text{zz}[[ i2, j2]]\wedge (-1/2)*
\text{ww}[[ i2, j2]]\wedge (-3/2),\\
{}\quad\quad\quad\quad \text{W}[[ i2, j2]]\to \text{zz}[[ i2, j2]]\wedge (-1/2)* \text{ww}[[ i2, j2]]\wedge (-3/2)\}, \\
{}\quad \quad \quad \quad \{ j2, i2+1, n\}],  \{ i2,1, n-1\}],  \{ k2,1,\text{Length}[ \text{y2}]\}]; \text{Return}[ \text{y2}]) \\
\\
\text{(* For every  $i,j$, replace  $Z_{ij}$, $W_{ij}$ by $u_{ij}v_{ij}^3$, $v_{ij}u_{ij}^3$ resp. *)}  \\
\text{Relation3ver2}[ \text{x2}\_] := ( \\
{}\quad \text{y2} = \text{x2}; \\
{}\quad \text{Do}[ \text{Do}[ \text{Do}[ \text{y2}[[ k2]] =
\text{y2}[[ k2]] /. \{ \text{Z}[[ i2, j2]] \to u[[ i2, j2]]\wedge
(1)* v[[ i2, j2]]\wedge (3),\\
{}\quad\quad\quad\quad \text{W}[[ i2, j2]] \to v[[ i2, j2]]\wedge (1)* u[[ i2, j2]]\wedge (3)\}, \\
{}\quad \quad \quad \quad \{ j2, i2 + 1, n\}],  \{ i2, 1, n - 1\}], \{ k2, 1, \text{Length}[ \text{y2}]\}];  \text{Return}[ \text{y2}]) \\
\\
\text{(* change variable according to the setting  } z_i=\zeta _i^2, w_i=\omega _i^2\text{  }\text{*)}  \\
\text{ChangeVar1}[ \text{x2}\_]:=( \\
{}\quad \text{y2}= \text{x2}; \\
{}\quad \text{Do}[ \text{Do}[ \text{y2}[[ j2]]= \text{y2}[[ j2]]/.\{
\text{z}[[ i2]]\to \text{zeta}[[ i2]]\wedge (2),\\
{}\quad\quad\quad\quad \text{w}[[ i2]]\to \text{omega}[[ i2]]\wedge (2)\}, \\
{}\quad \quad \quad \{ i2,1, n\}], \{ j2,1, \text{Length}[ \text{y2}]\}];  \text{Return}[ \text{y2}]) \\
\\
\quad \text{ChangeVar1Inv}[ \text{x2}\_]:=( \\
{}\quad \text{y2}= \text{x2}; \\
{}\quad \text{Do}[ \text{Do}[ \text{y2}[[ j2]]= \text{y2}[[ j2]]/.\{
\text{zeta}[[ i2]]\to \text{z}[[ i2]]\wedge (1/2),\\
{}\quad\quad\quad\quad \text{omega}[[ i2]]\to \text{w}[[ i2]]\wedge (1/2)\}, \\
{}\quad \quad \quad \{ i2,1, n\}], \{ j2,1, \text{Length}[ \text{y2}]\}];  \text{Return}[ \text{y2}]) \\
\\
\text{(* change variable according to the setting } m_i=\mu _i^4\text{  }\text{*)}  \\
\text{ChangeVar2}[ \text{x2}\_] := ( \\
{}\quad \text{y2} = \text{x2}; \\
{}\quad \text{Do}[ \text{Do}[ \text{y2}[[ j2]] = \text{y2}[[ j2]] /. \{
M[[ i2]] \to \text{mu}[[ i2]]\wedge 4\}, \\
{}\quad \quad \quad \{ i2, 1, n\}],  \{ j2, 1, \text{Length}[ \text{y2}]\}];  \text{Return}[ \text{y2}]) \\
\\
\text{ChangeVar2Inv}[ \text{x2}\_] := ( \\
{}\quad \text{y2} = \text{x2}; \\
{}\quad \text{Do}[ \text{Do}[ \text{y2}[[ j2]] = \text{y2}[[ j2]] /. \{
\text{mu}[[ i2]] \to M[[ i2]]\wedge (1/4)\}, \\
{}\quad \quad \quad \{ i2, 1, n\}], \{ j2, 1, \text{Length}[ \text{y2}]\}];  \text{Return}[ \text{y2}]) \\
\\
\text{(* change variable according to the setting } u_{ij}=z_{ij}^{-1/2},\ v_{ij}=w_{ij}^{-1/2}
\text{*)}  \\
\text{ChangeVar3}[ \text{x2}\_]:=( \\
{}\quad \text{y2}= \text{x2}; \\
{}\quad \text{Do}[ \text{Do}[ \text{Do}[ \text{y2}[[ k2]]= \text{Simplify}@
\text{Expand}[ \text{y2}[[ k2]]/.\{ \text{zz}[[ i2, j2]]\to u[[ i2,
j2]]\wedge (-2), \\
{}\quad\quad\quad\quad \text{ww}[[ i2, j2]]\to v[[ i2, j2]]\wedge (-2)\}], \\
{}\quad \quad \quad \quad \{ j2, i2+1, n\}], \{ i2,1, n-1\}],  \{ k2,1, \text{Length}[ \text{y2}]\}]; \text{Return}[ \text{y2}]) \\
\\
\quad \text{ChangeVar3Inv}[ \text{x2}\_]:=( \\
{}\quad \text{y2}= \text{x2}; \\
{}\quad \text{Do}[ \text{Do}[ \text{Do}[ \text{y2}[[ k2]]= \text{Simplify}@
\text{Expand}[ \text{y2}[[ k2]]/.\{ u[[ i2, j2]]\to \text{zz}[[ i2,
j2]]\wedge (-1/2), \\
{}\quad\quad\quad\quad v[[ i2, j2]]\to \text{ww}[[ i2, j2]]\wedge (-1/2)\}], \\
{}\quad \quad \quad \quad \{ j2, i2+1, n\}],  \{ i2,1, n-1\}],  \{ k2,1, \text{Length}[ \text{y2}]\}];  \text{Return}[ \text{y2}]) \\
\\
\text{(* If } z_i\succ z_{ij}\text{  }\text{and}\text{  }z_j\succ z_{ij}, \text{ then } z_i\sim z_j,
\text{ so replace } z_j \text{ by } z_i, \text{ similar for } w_i\text{'s } \text{*)}  \\
\text{ClusterReplace}[\{ \text{zomatrix2}\_, \text{womatrix2}\_\},
\text{x2}\_]:=( \\
{}\quad \text{y2}= \text{x2}; \\
{}\quad \text{Do}[ \text{Do}[ \text{Do}[ \text{If}[ \text{Min}[
\text{zomatrix2}[[ i2, i2]]\sim \text{Join}\sim
\text{zomatrix2}[[ j2, j2]]] \\
{}\quad \quad \quad \quad \quad > \text{Max}[ \text{zomatrix2}[[ i2
, j2]]], \\
{}\quad \quad \quad \quad \quad \text{y2}[[ k2]]= \text{Simplify}[
\text{y2}[[ k2]]/.\{ \text{z}[[ i2]]\to \text{z}[[ j2]]\}]]; \\
{}\quad \quad \quad \quad \text{If}[ \text{Min}[ \text{womatrix2}[[ i2,
i2]]\sim \text{Join}\sim \text{womatrix2}[[ j2, j2]]]\\
{}\quad \quad \quad \quad \quad > \text{Max}[
\text{womatrix2}[[ i2, j2]]], \\
{}\quad \quad \quad \quad \quad \text{y2}[[ k2]]= \text{y2}[[ k2]]/.\{
\text{w}[[ i2]]\to \text{w}[[ j2]]\}], \\
{}\quad \quad \quad \quad \{ i2, j2+1, n\}], \{ j2,1, n-1\}], \{ k2,1, \text{Length}[ \text{y2}]\}];  \text{Return}[ \text{y2}]) \\
\\
\text{(* If a polynomial } p \text{ has factor var}_i^k \text{ for some variable} \text{var}_i ,
\text{then we change}  \\
{}\quad p \text{ to } p\left/\text{var}_i^k\right. \text{*)}  \\
\text{CancelFactor}[ \text{x4}\_] := ( \\
{}\quad \text{y4} = \text{x4}; \\
{}\quad \text{Do}[ \text{varset4} = \text{Variables}[ \text{y4}[[ k4]]];
\\
{}\quad \quad \text{Do}[ \text{Ex4} = \text{Exponent}[ \text{y4}[[
k4]], \text{varset4}[[ j4]]\wedge (-1)]; \\
{}\quad \quad \quad \text{If}[ \text{Ex4} < 0,  \text{y4}[[ k4]] = \text{Simplify}[
\text{Expand}[ \text{y4}[[ k4]]* \text{varset4}[[ j4]]\wedge ( \text{Ex4})]]
], \\
{}\quad \quad \quad \{ j4, 1, \text{Length}[ \text{varset4}]\}],  \{ k4, 1, \text{Length}[ \text{y4}]\}]; \text{Return}[ \text{y4}]) \\
\\
\text{(* If a rational function $f=q/p$ and $p$ has a factor var}_i^k \text{ for some } \text{variable var}_i ,\\
{}\quad \text{then we change } g \text{ to} g*\text{var}_i^k \text{*)}  \\
\text{CancelDenominator}[ \text{x3}\_] := ( \\
{}\quad \text{y3} = \text{x3}; \\
{}\quad \text{Do}[ \text{varset3} = \text{Variables}[ \text{y3}[[ k3]]];
\\
{}\quad \quad \text{Do}[ \text{Ex3} = \text{Exponent}[ \text{y3}[[
k3]], \text{varset3}[[ j3]]\wedge (-1)]; \\
{}\quad \quad \quad \text{If}[ \text{Ex3} > 0,  {}\quad \quad \quad \quad \text{y3}[[ k3]] = \text{Simplify}[ \text{Expand}[ \text{y3}[[ k3]]* \text{varset3}[[ j3]]\wedge ( \text{Ex3})]] ], \\
{}\quad \quad \quad \{ j3, 1, \text{Length}[ \text{varset3}]\}],  \{ k3, 1, \text{Length}[ \text{y3}]\}];  \text{Return}[ \text{y3}]) \\
\\
\text{(* Determine whether the polynomial gives a mass relation. If it does, then} \\
{}\quad \text{then we collect this mass relation}. \text{*)}  \\
\text{MassRelationQ}[ \text{x2}\_]:=( \\
{}\quad \text{If}[ \text{Count}[ \text{Table}[ \text{Complement}[
\text{Variables}[ \text{x2}[[ k2]]], M\sim \text{Join}\sim \text{mu}],\{
k2,1, \text{Length}[ \text{x2}]\}],\{\}] \\
{}\quad \quad >0, \text{Return}[ \text{True}], \text{Return}[ \text{False}]]) \\
\\
\quad \text{TakeMassRela}[ \text{x2}\_]:=(  \text{y2}= \text{x2}; \\
{}\quad \text{y2}= \text{Select}[ \text{y2}, \text{Complement}[
\text{Variables}[\#], M\sim \text{Join}\sim \text{mu}]==\{\}\&];  \text{Return}[ \text{y2}]) \\
\\
\text{(* Determine whether the $zw$-order matrix gives any wedge equations}. \\
{} \quad \text{If it does then we collect  these wedge equations *)}  \\
\\
\text{FindWedgeV}[\{ I2\_, J2\_\}]:=( \\
{}\quad SS2= \text{Select}[ \text{Table}[ k,\{ k,1, n\}], \text{Max}[
\text{Diagonal}[ I2][[\#]], \text{Diagonal}[ J2][[\#]]]==5\&]; \\
{}\quad S2= \text{Select}[ \text{Subsets}[ SS2], \text{Length}[\#]>0\&\&  \text{Length}[\#]< n\&];  jj2=1; \\
{}\quad \text{While}[ jj2<= \text{Length}[ S2],  \text{V2}= S2[[ jj2]];  \text{\text{V2}C}= \text{Complement}[ SS2, \text{V2}];\\
{} \quad U2= \text{Complement}[ \text{allind}, \text{V2}\sim \text{Join}\sim
\text{\text{V2}C}]; \\
{}\quad \quad \text{If}[ \text{Complement}[ \text{Flatten}[ I2[[ \text{V2},
\text{V2}]]],\{5\}]==\{\}\&\& \\
{}\quad \quad \quad \text{Max}[ \text{Flatten}[ I2[[ \text{\text{V2}C},
\text{\text{V2}C}]]]]<5\&\& \\
{}\quad \quad \quad \text{Complement}[ \text{Flatten}[ I2[[ \text{V2},
\text{\text{V2}C}]]],\{5\}]==\{\}\&\& \\
{}\quad \quad \quad \text{Max}[ \text{Flatten}[ J2[[ \text{V2}, \text{V2}]]]]<5\&\& \\
{}\quad \quad \quad \text{Complement}[ \text{Flatten}[ J2[[ \text{\text{V2}C},
\text{\text{V2}C}]]],\{5\}]==\{\}\&\& \\
{}\quad \quad \quad \text{Complement}[ \text{Flatten}[ J2[[ \text{V2},
\text{\text{V2}C}]]],\{5\}]==\{\}\&\& \\
{}\quad \quad \quad \text{Length}@ U2<=1\&\& \\
{}\quad \quad \quad \text{Max}@( \text{Flatten}@( I2[[ U2, U2]])\sim
\text{Join}\sim \text{Flatten}@( J2[[ U2, U2]]))<=1, \\
{}\quad \quad \quad \text{Return}[\{ \text{V2}, \text{\text{V2}C}\}]];  jj2++]; \\
{}\quad \text{Return}[\{\{\},\{\}\}]) \\
\\
\text{(* Determine how many terms are there in the polynomial}.\ \text{*)}  \\
\text{NumberofInv}[ S4\_, \text{var4}\_]:=( \\
{}\quad ii4=0; \\
{}\quad \text{Do}[ \text{If}[ \text{Intersection}[ \text{Variables}[ S4[[
j4]]],\{ \text{var4}\}]!=\{\}, \\
{}\quad \quad \quad ii4++],  \{ j4,1, \text{Length}[ S4]\}]; \text{Return}[ ii4])\\
\\
\text{(* For collection } \left\{f_i\right\} \text{ of polynomials, if there is some } f_i=g*\text{var}, \text{where } \\
{}\quad \text{var is variable and } g \text{ is polynomial independent of var},
\text{then we make} \\
{}\quad \text{substitution }  f/g \text{ for var to each } f_j \text {in the collection}.\text{  }\text{*)}  \\
\text{simpleSubstitution}[ S3\_, \text{varset3a}\_]:=( \\
{}\quad s3= S3; \text{varset3b}= \text{Select}[ \text{varset3a}, \text{NumberofInv}[ s3,\#]>1\& ]; \\
{}\quad ii3=1; \text{tf2}=0; \\
{}\quad \text{While}[ ii3<= \text{Length}[ s3]\&\& \text{tf2}==0, \\
{}\quad \quad \text{If}[ \text{Length}[ \text{ExpandAll}@( s3[[ ii3]])]==2,
\\
{}\quad \quad \quad \text{varset3c}= \text{Intersection}[ \text{Variables}[
s3[[ ii3]]], \text{varset3b}];  jj3=1; \\
{}\quad \quad \quad \text{While}[ jj3<= \text{Length}[ \text{varset3c}]\&\&
\text{tf2}==0, \\
{}\quad \quad \quad \quad \text{If}[ \text{Exponent}[ s3[[ ii3]],
\text{varset3c}[[ jj3]]]==1, \\
{}\quad \quad \quad \quad \quad \text{substi3}= \text{Solve}[ s3[[
ii3]]==0, \text{varset3c}[[ jj3]]][[1]]; \\
{}\quad \quad \quad \quad \quad \text{Do}[ s3[[ k3]]= \text{Simplify}@
\text{Expand}[ s3[[ k3]]/. \text{substi3}], \\
{}\quad \quad \quad \quad \quad \quad \{ k3,1, \text{Length}[ s3]\}]; \\
{}\quad \quad \quad \quad \quad \text{tf2}=1];  jj3++]];  ii3++];  \text{Return}[ s3];  ) \\
\\
\text{(* Delete duplicates from a collection of polynomials of some
variables *)}  \\
\text{DelDupPoly}[ \text{polyset3a}\_, \text{varset3}\_] := ( \\
{}\quad \text{polyset3b} = \text{polyset3a}; \text{del} = \{\}; \\
{}\quad \text{Do}[ \text{If}[ \text{Intersection}[ \text{Variables}[
\text{polyset3b}[[ i3]]], \text{varset3}] != \{\}, \\
{}\quad \quad \quad \text{var3} = \text{Intersection}[
\text{Variables}[ \text{polyset3b}[[ i3]]], \text{varset3}][[1]]; \\
{}\quad \quad \quad \text{exp3} = \text{Exponent}[ \text{polyset3b}[[
i3]], \text{var3}]; \\
{}\quad \quad \quad \text{Do}[ \text{If}[ \text{Simplify}[
\text{polyset3b}[[ i3]]* \text{Coefficient}[ \text{polyset3b}[[
j3]], \text{var3}\wedge \text{exp3}] \\
{}\quad \quad \quad \quad \quad - \text{polyset3b}[[ j3]]* \text{Coefficient}[ \text{polyset3b}[[ i3]], \text{var3}\wedge \text{exp3}]]
== 0, \\
{}\quad \quad \quad \quad \quad \text{del} = \text{del}\sim
\text{Join}\sim \{\{ j3\}\}], \\
{}\quad \quad \quad \quad \{ j3, i3 + 1, \text{Length}[
\text{polyset3b}]\}]],  \{ i3, 1, \text{Length}[ \text{polyset3b}] - 1\}]; \\
{}\quad \text{polyset3b} = \text{Delete}[ \text{polyset3b},
\text{del}];  \text{Return}[ \text{polyset3b}];  ) \\
\\
\text{(* For collection $\left\{f_i\right\}$ of polynomials and set $V$ of variables, }  \\ \text{if } f_i=f_j*g,\ i<j,
\text{where } g \text{ is independent of variables in } V,\\ \text{ then delete } f_j \text{ from the }
\text{collection}\ \text{*)}  \\
\text{DelDupPoly2}[ \text{polyset3a}\_, \text{varset3}\_]:=( \\
{}\quad \text{polyset3b}= \text{polyset3a}; \text{del}=\{\}; \\
{}\quad \text{Do}[ \text{Do}[ \text{If}[ \text{PolynomialQ}[
\text{Simplify}@( \text{Expand}@( \text{polyset3b}[[ i3]]/ \text{polyset3b}[[
j3]])), \\
{}\quad \quad \quad \quad \text{varset3}]== \text{True}\&\&  \text{PolynomialQ}[ \text{Simplify}@( \text{Expand}@( \text{polyset3b}[[ j3]]/ \text{polyset3b}[[ i3]])), \\
{}\quad \quad \quad \quad \text{varset3}]== \text{True} , \\
{}\quad \quad \quad \quad \text{del}= \text{del}\sim \text{Join}\sim \{\{
j3\}\}], \\
{}\quad \quad \quad \{ j3, i3+1, \text{Length}[ \text{polyset3b}]\}],  \{ i3,1, \text{Length}[ \text{polyset3b}]-1\}]; \\
{}\quad \text{polyset3b}= \text{Delete}[ \text{polyset3b}, \text{del}];  \text{Return}[ \text{polyset3b}]; ) \\
\\
\text{(* If $g$ is a multiple of $f$, then we delete $g$. *)} \\
\text{DelDupPoly3}[ \text{polyset3a}\_, \text{varset3}\_] := ( \\
{}\quad \text{polyset3b} = \text{polyset3a};  \text{del} = \{\}; \\
{}\quad \text{Do}[ \text{Do}[ \text{tf3} = 0; \\
{}\quad \quad \quad \text{If}[ \text{PolynomialQ}[
\text{Simplify}@( \text{Expand}@( \text{polyset3b}[[ i3]]/
\text{polyset3b}[[ j3]])),\\
{}\quad \quad \quad \quad \text{varset3}] == \text{True}, \\
{}\quad \quad \quad \quad \text{del} = \text{del}\sim
\text{Join}\sim \{\{ i3\}\};  \text{tf3} = 1]; \\
{}\quad \quad \quad \text{If}[ \text{tf3} == 0 \&\& \text{PolynomialQ}[ \text{Simplify}@( \text{Expand}@( \text{polyset3b}[[ j3]]/ \text{polyset3b}[[ i3]])),\\
{}\quad \quad \quad \quad \text{varset3}] == \text{True}, \\
{}\quad \quad \quad \quad \text{del} = \text{del}\sim \text{Join}\sim
\{\{ j3\}\}], \\
{}\quad \quad \quad  \{ j3, i3 + 1, \text{Length}[\text{polyset3b}]\}], \{ i3, 1, \text{Length}[ \text{polyset3b}] - 1\}]; \\
{}\quad \text{polyset3b} = \text{Delete}[ \text{polyset3b},
\text{del}];  \text{Return}[ \text{polyset3b}]; ) \\
\\
\text{(*} \text{ apply above ``simplesubstitution'', change each member} \text{ to polynomial},
\\
{}\quad \text{ and delete constant polynomials and duplicates}.\text{*)}  \\
\text{SimpleSubstitution}[ S2\_, \text{varset2}\_] := ( \\
{}\quad s2 = S2; \text{tf2} = 1; \\
{}\quad \text{While}[ \text{tf2} == 1, \\
{}\quad \quad s2 = \text{simpleSubstitution}[ s2, \text{varset2}]; \\
{}\quad \quad s2 = \text{CancelDenominator}[ s2]; \\
{}\quad \quad s2 = \text{CancelFactor}[ s2]; \\
{}\quad \quad s2 = \text{Complement}[ s2, \{1, 0, -1\}]; \\
{}\quad \quad s2 = \text{DelDupPoly}[ s2, \text{varset2}];  ]; \\
{}\quad \text{Return}[ s2]) \\
\\
\text{(*} \text{if } f=g_1^{k_1}g_2^{k_2}\cdot \cdot \cdot g_n^{k_n} , \text{ then replace } f \text{ by } g_1g_2\cdot \cdot \cdot g_n\text{*)}  \\
\text{MinimizeExpofFac}[ S4\_]:=( \\
{}\quad s4= S4;  L4= \text{Length}[ s4]; \\
{}\quad \text{If}[ L4>0, \\
{}\quad \quad \text{Do}[ \text{list4}= \text{FactorList}[ s4[[ k4]]]; \\
{}\quad \quad \quad \text{If}[ \text{Length}[ \text{list4}]>1,  s4[[ k4]]=1; \\
{}\quad \quad \quad \quad \text{Do}[ \text{poly4}= \text{list4}[[ j4,1]];
\\
{}\quad \quad \quad \quad \quad \text{If}[ \text{Length}@ \text{poly4}>1,
\\
{}\quad \quad \quad \quad \quad \quad s4[[ k4]]= \text{ExpandAll}@( s4[[
k4]]* \text{poly4})], \\
{}\quad \quad \quad \quad \quad \{ j4,2, \text{Length}[ \text{list4}]\}]],
\{ k4,1, L4\}]];  \text{Return}[ s4]; ) \\
\\
\text{(* if } f=g_1^{k_1}g_2^{k_2}\cdot \cdot \cdot g_n^{k_n}h_1^{l_1}h_2^{l_2}\cdot \cdot \cdot h_m^{l_m} \text{ and all }
\text{terms } \text{in } h_i's \text{ are } \text{of} \text{ the } \text{same} \text{ sign}, \text{then } \\
{}\quad \text{replace } f \text{ by }
g_1g_2\cdots g_n\text{*)} \\
\text{MinimizeExpofFacP}[ S3\_]:=( \\
{}\quad s3= S3;  L3= \text{Length}[ s3]; \\
{}\quad \text{If}[ L3>0,  \text{Do}[ \text{list3}= \text{FactorList}[ s3[[ k3]]]; \\
{}\quad \quad \quad \text{If}[ \text{Length}[ \text{list3}]>1,  s3[[ k3]]=1; \\
{}\quad \quad \quad \quad \text{Do}[ \text{If}[ \text{Length}@
\text{StringPosition}[ \text{ToString}@(
\text{list3}[[ j3,1]]),``-'']>0\&\& \\
{}\quad \quad \quad \quad \quad \quad \text{Length}@ \text{StringPosition}[
\text{ToString}@(- \text{list3}[[ j3,1]]),``-'']>0, \\
{}\quad \quad \quad \quad \quad \quad s3[[ k3]]= s3[[ k3]]* \text{list3}[[
j3,1]]], \\
{}\quad \quad \quad \quad \quad \{ j3,2, \text{Length}[ \text{list3}]\}]],
\{ k3,1, L3\}]]; \text{Return}[ s3]; ) \\
\\
\text{(*} \text{Elimination process: apply some} \text{ algorithms} \text{ on collection} \text{ of} \text{ polynomials} \\
{}\quad \text{ to} \text{ eliminate given} \text{ variable}.\text{*)}  \\
\text{Elimi}[ S2\_, \text{var2}\_]:=( \\
{}\quad s2= \text{Select}[ S2, \text{Intersection}[ \text{Variables}[\#],\{
\text{var2}\}]!=\{\}\& ]; \\
{}\quad \text{s2b}= \text{Complement}[ S2, s2]; \\
{}\quad \text{exp2c}=2* \text{Max}[ \text{Table}[ \text{Exponent}[ s2[[
k2]], \text{var2}],\{ k2,1, \text{Length}[ s2]\}]]; \\
{}\quad kk2=0; \text{possfac2}=1; \\
{}\quad \text{While}[( \text{Length}@ s2>1)\&\& ( kk2< \text{exp2c}+2), \\
{}\quad \quad s2= \text{SortBy}[ s2, \text{Length}[\#]\& ]; \\
{}\quad \quad s2= \text{SortBy}[ s2, \text{Exponent}[\#, \text{var2}]\& ];
\\
{}\quad \quad \text{exp2a}= \text{Exponent}[ s2[[1]], \text{var2}]; \text{TF2}=1; \\
{}\quad \quad \text{CoeList2}= \text{CoefficientList}[ s2[[1]],
\text{var2}];  \\
{}\quad \quad \text{CoeFactor2}= \text{Replace}[ \text{CoeList2},
\text{List}\to \text{PolynomialGCD},1, \text{Heads}\to \text{True}];  \\
{}\quad \quad \text{Do}[ \text{If}[ \text{Exponent}[ \text{CoeFactor2},
\text{var2b}]>0, \text{TF2}=0];  ,  \{ \text{var2b}, \text{VarSet1b}\}]; \\
{}\quad \quad \text{If}[ \text{TF2}==1, \\
{}\quad \quad \quad s2[[1]]= \text{ExpandAll}@ \text{Simplify}[ s2[[1]]/
\text{CoeFactor2}]; \\
{}\quad \quad \quad \text{possfac2}= \text{possfac2}* \text{CoeFactor2};]; \\
{}\quad \quad \text{Do}[ \text{exp2b}= \text{Exponent}[ s2[[ j2]],
\text{var2}]; \\
{}\quad \quad \quad \text{If}[ \text{exp2b}>= \text{exp2a}, \\
{}\quad \quad \quad \quad \text{poly2}= \text{Expand}[ s2[[1]]*
\text{var2}\wedge ( \text{exp2b}- \text{exp2a})]; \\
{}\quad \quad \quad \quad \text{Coe2a}= \text{Coefficient}[ \text{poly2},
\text{var2}\wedge \text{exp2b}]; \\
{}\quad \quad \quad \quad \text{Coe2b}= \text{Coefficient}[ s2[[ j2]],
\text{var2}\wedge \text{exp2b}]; \\
{}\quad \quad \quad \quad s2[[ j2]]= \text{ExpandAll}@( s2[[ j2]]*
\text{Coe2a}- \text{poly2}* \text{Coe2b});  ], \{ j2,2, \text{Length}[ s2]\}]; \\
{}\quad \quad s2= \text{CancelFactor}[ s2]; \\
{}\quad \quad s2= \text{MinimizeExpofFac}[ s2]; \\
{}\quad \quad \text{s2b}= \text{s2b}\sim \text{Join}\sim \text{Select}[
s2, \text{Intersection}[ \text{Variables}[\#],\{ \text{var2}\}]==\{\}\&]; \\
{}\quad \quad s2= \text{Select}[ s2, \text{Intersection}[
\text{Variables}[\#],\{ \text{var2}\}]!=\{\}\&];  kk2++;  ]; \\
{}\quad s2= \text{SortBy}[ s2, \text{Exponent}[\#, \text{var2}]\& ]; \text{Return}[\{ \text{s2b}, \text{possfac2}\}]; ) \\
\\
\text{(* for each variable $v$ in the varset, delete the polynomial (if it exists)} \\ {} \quad \text{ in $S5$ that is the unique polynomial involving variable $v$ *)}\\
\text{DeleteVar}[ S2\_, \text{varset2}\_] := ( \\
{}\quad s2 = S2; \\
{}\quad \text{If}[ \text{Length}[ s2] > 1, \\
{}\quad \quad \text{Do}[ \text{If}[ \text{Length}[ \text{Select}[
s2, ( \text{Variables}[\#] \cap \{ \text{varset2}[[ k2]]\}) !=
\{\} \& ]] == 1, \text{del} = \{\}; \\
{}\quad \quad \quad \quad \text{Do}[ \text{If}[( \text{Variables}[
s2[[ j2]]] \cap \{ \text{varset2}[[ k2]]\}) != \{\}, \\
{}\quad \quad \quad \quad \quad \quad \text{del} = \text{del}\sim
\text{Join}\sim \{\{ j2\}\}], \\
{}\quad \quad \quad \quad \quad \{ j2, 1, \text{Length}[ s2]\}]; s2 = \text{Delete}[ s2, \text{del}]],  \{ k2, 1, \text{Length}[ \text{varset2}]\}]]; \\
{}\quad \text{Return}[ s2];  ) \\
\\
\text{(* First algorithm for finding mass relations *)}  \\
\text{FindMassRel1}[]:=( \\
{}\quad t1= \text{AbsoluteTime}[]; \\
{}\quad \text{Str}=`` \text{finding} \text{the} \text{mass}
\text{relation} \text{of} \text{FMX}[[''<> \text{ToString}[ N1]<>``]]''; \\
{}\quad \text{Print}[ \text{Str}];  \text{Print}[];  \text{TF1}=0; \\
{}\quad \text{EqnZ}=( \text{ZX1}* \text{Z}). M;  \text{EqnZ}= \text{Relation1}@ \text{Complement}[
\text{EqnZ},\{0\}]; \\
{}\quad \text{EqnW}=( \text{WX1}* \text{W}). M;  \text{EqnW}= \text{Relation1}@ \text{Complement}[
\text{EqnW},\{0\}]; \\
{}\quad \text{Polyset1}= \text{Union}[ \text{EqnW}, \text{EqnZ}]; \\
{}\quad \text{Print}[ \text{Style}[`` \text{Collected} \text{equations}:
'', \text{Bold},15, \text{Blue}]]; \\
{}\quad \text{If}[ \text{Length}@ \text{EqnZ}+ \text{Length}@
\text{EqnW}>0, \\
{}\quad \quad \text{Print}[ \text{Style}[`` \text{Main} \text{equations}:
'', \text{Bold},13, \text{RGBColor}[0.8,0.4,0]]]; \\
{}\quad \quad \text{Do}[ \text{Print}[0,`` = '', \text{EqnZ}[[ k1]]], \{ k1,1, \text{Length}@ \text{EqnZ}\}]; \\
{}\quad \quad \text{Do}[ \text{Print}[0,`` = '', \text{EqnW}[[ k1]]], \{ k1,1, \text{Length}@ \text{EqnW}\}];  ]; \\
{}\quad \text{If}[ \text{Length}@ \text{ClusterZ}[\{ \text{zo1},
\text{wo1}\}]+ \text{Length}@ \text{ClusterW}[\{ \text{zo1}, \text{wo1}\}]>0,
\\
{}\quad \quad \text{Print}[ \text{Style}[`` \text{Cluster}
\text{equations}: '', \text{Bold},13, \text{RGBColor}[0.8,0.4,0]]]; \\
{}\quad \quad \text{Do}[ \text{Print}[0,`` = '', \text{ClusterZ}[\{
\text{zo1}, \text{wo1}\}][[ k1]]], \{ k1,1, \text{Length}@ \text{ClusterZ}[\{ \text{zo1},
\text{wo1}\}]\}]; \\
{}\quad \quad \text{Do}[ \text{Print}[0,`` = '', \text{ClusterW}[\{
\text{zo1}, \text{wo1}\}][[ k1]]], \{ k1,1, \text{Length}@ \text{ClusterW}[\{ \text{zo1},
\text{wo1}\}]\}]; ]; \\
{}\quad \text{Polyset1}= \text{Relation1}[ \text{Polyset1}]; \\
{}\quad \text{Polyset1}= \text{Relation2}[ \text{Polyset1}]; \\
{}\quad \text{Polyset1}= \text{ClusterReplace}[\{ \text{zo1}, \text{wo1}\},
\text{Polyset1}]; \\
{}\quad \text{Polyset1}= \text{Complement}[ \text{Polyset1},\{1,0,-1\}]; \\
{}\quad \text{Polyset1b}= \text{GroebnerBasis}[ \text{Polyset1}, M\sim
\text{Join}\sim \text{mu}]; \\
{}\quad \text{Polyset1}= \text{Polyset1b}; \\
{}\quad \text{Polyset1}= \text{CancelFactor}[ \text{Polyset1}]; \\
{}\quad \text{Polyset1}= \text{Complement}[ \text{Polyset1},\{1,0,-1\}]; \\
{}\quad \text{If}[ \text{MassRelationQ}[ \text{Polyset1}]== \text{True}, \\
{}\quad \quad \text{TF1}=1;  \text{Polyset1}= \text{TakeMassRela}[ \text{Polyset1}]; \\
{}\quad \quad \text{Print}[`` \text{Finished }, \text{we } \text{have }
\text{mass } \text{relation } '', \text{Style}[ \text{Polyset1},
\text{Blue}],\\
{}\quad `` \text{for } \text{this } \text{diagram}.'']]; \\
{}\quad \text{If}[ \text{TF1}==0,  \text{Print}[`` \text{We } \text{don't } \text{find } \text{mass } \text{relation. } \text{We } \text{have } \text{the } \text{relations}:'']; \\
{}\quad \quad \text{Print}[ \text{Polyset1},\ ``\setminus \text{n} '' ]]; \\
{}\quad \text{Print}[`` \text{spending} \text{time}: '',
\text{AbsoluteTime}[]- t1]; ) \\
\\
\text{(* Second algorithm for finding mass relations *)}  \\
\text{indMassRel2}[]:=( \\
{}\quad \text{TF1}=0; t1= \text{AbsoluteTime}[]; \\
{}\quad \text{Str}=`` \text{finding } \text{mass }
\text{relation } \text{of } \text{FMX}[[''<> \text{ToString}[ N1]<>``]]...'';
\\
{}\quad \text{Print}[ \text{Str}, ``\setminus \text{n} '']; \\
{}\quad \text{If}[ \text{Length}[ \text{zwotype3}]>0, \text{TF1}=1;  jj1=1; \\
{}\quad \quad \text{While}[ jj1<= \text{Length}[ \text{zwotype3}]\&\& \text{TF1}==1, \\
{}\quad \quad \quad \{ \text{S1a}, \text{S1b}\}= \text{FindWedgeV}[
\text{zwotype3}[[ jj1]]]; \\
{}\quad \quad \quad \text{If}[ \text{S1a}==\{\}, \text{TF1}=0;  ]; jj1++]; \\
{}\quad \quad \text{If}[ \text{TF1}==1, \\
{}\quad \quad \quad \text{massrellcm}=1; \text{PossFaclcm}=1; jj1=1; \\
{}\quad \quad \quad \text{While}[ jj1<= \text{Length}[ \text{zwotype3}],  \{ \text{S1a}, \text{S1b}\}= \text{FindWedgeV}[
\text{zwotype3}[[ jj1]]]; \\
{}\quad \quad \quad \quad \text{WedgeV1a}= \text{Flatten}@ \text{Table}[
M[[ j1]] M[[ i1]]( \text{zeta}[[ i1]] \text{omega}[[ j1]])\wedge (-1),\\
{}\quad \quad \quad \quad \quad \quad \quad \quad \quad \{ i1,
\text{S1a}\},\{ j1, \text{S1b}\}]; \\
{}\quad \quad \quad \quad \text{sign1}= \text{Tuples}[\{1,-1\},\{
\text{Length}[ \text{S1a}], \text{Length}[ \text{S1b}]\}];
\\
{}\quad \quad \quad \quad \text{WedgeV1b}= \text{Table}[ \text{Dot}[
\text{WedgeV1a}, \text{Flatten}[ \text{sign1}[[ j1]],1]],\\
{}\quad \quad \quad \quad \quad \quad \quad \quad \quad \{ j1,1, \text{Length}[ \text{sign1}]\}]; \\
{}\quad \quad \quad \quad \text{VarSet1a}= \text{Variables}[
\text{WedgeV1a}]; \\
{}\quad \quad \quad \quad \text{WedgeV1b}= \text{WedgeV1b}[[1; ;  2\wedge ( \text{Length}[ \text{S1b}]*
\text{Length}[ \text{S1a}]-1)]]; \\
{}\quad \quad \quad \quad \text{Do}[ \text{WedgeV1b}[[ j1]]=
\text{ExpandAll}@ \text{WedgeV1b}[[ j1]],
\\
{}\quad \quad \quad \quad \quad \{ j1,1, \text{Length}@ \text{WedgeV1b}\}];
\\
{}\quad \quad \quad \quad \text{index1}=1; \\
{}\quad \quad \quad \quad \text{Circledzc}= \text{Table}[
\text{Intersection}[ \text{zc1}[[ i1]], \text{Flatten}[ \text{Position}[ \\
{}\quad \quad \quad \quad \quad \quad \quad \quad \quad \quad
\text{Diagonal}[ \text{ZX1}],1]]],\{ i1,1,
\text{Length}[ \text{zc1}]\}]; \\
{}\quad \quad \quad \quad \text{Circledwc}= \text{Table}[
\text{Intersection}[ \text{wc1}[[ i1]], \text{Flatten}[ \text{Position}[ \\
{}\quad \quad \quad \quad \quad \quad \quad \quad \quad \quad
\text{Diagonal}[ \text{WX1}],1]]],\{ i1,1,
\text{Length}[ \text{wc1}]\}]; \\
{}\quad \quad \quad \quad \text{MassCenRela}= \text{Flatten}[ \text{Table}[
\text{Sum}[ M[[ \text{Circledzc}[[ i1, j1]] ]]*\\
{}\quad \quad \quad \quad \quad \quad \quad \quad \quad \quad  \text{z}[[
\text{Circledzc}[[ i1, j1]] ]], \{ j1,1, \text{Length}[ \text{Circledzc}[[
i1]]]\} ] , \\
{}\quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \{ i1,1, \text{Length}[ \text{Circledzc}]\}]]\sim \text{Join}\sim
\text{Flatten}[ \text{Table}[ \text{Sum}[\\
{}\quad \quad \quad \quad \quad \quad \quad \quad \quad \quad  M[[ \text{Circledwc}[[ i1, j1]]
]]*  \text{w}[[ \text{Circledwc}[[ i1, j1]] ]],\\
{}\quad \quad \quad \quad \quad \quad \quad \quad \quad \quad  \{ j1,1, \text{Length}[ \text{Circledwc}[[ i1]]]\} ] ,\{ i1,1, \text{Length}[ \text{Circledwc}]\}]]; \\
{}\quad \quad \quad \quad \text{Str}=`` \text{Finding} \text{mass}
\text{relation} \text{with} \text{zwotype3}[[''<> \text{ToString}[ jj1]<>``]]
''; \\
{}\quad \quad \quad \quad \text{Print}[ \text{Str}, ``\setminus \text{n} '']; \\
{}\quad \quad \quad \quad \text{Print}[`` \text{The } \text{order }
\text{matrices } \text{are } '']; \\
{}\quad \quad \quad \quad \text{Print}[\{ \text{MatrixForm}[
\text{zwotype3}[[ jj1,1]]], \text{MatrixForm}[ \text{zwotype3}[[ jj1,2]]]\}];
\\
{}\quad \quad \quad \quad \text{Print}[ \text{Style}[`` \text{Wedge }
\text{equations }: '', \text{Bold},13, \text{RGBColor}[0.8,0.4,0]]]; \\
{}\quad \quad \quad \quad \text{Replace}[ \text{Prepend}[ \text{Insert}[
\text{WedgeV1a},`` \pm '', \text{Table}[\{ k1\},\{ k1,2, \text{Length}@
\text{WedgeV1a}\}]],\\
{}\quad \quad \quad \quad \quad \quad \quad `` \text{ one } \text{of } 0 = ''], \text{List}\to \text{Print},1, \text{Heads}\to \text{True}]; \\
{}\quad \quad \quad \quad \text{While}[ \text{index1}<= \text{Length}[
\text{WedgeV1b}], \\
{}\quad \quad \quad \quad \quad \text{Polyset1}= \text{MassCenRela}; \\
{}\quad \quad \quad \quad \quad \text{Polyset1}= \text{Complement}[
\text{Polyset1},\{1,0,-1\}]; \\
{}\quad \quad \quad \quad \quad \text{Polyset1}= \text{Polyset1}\sim
\text{Join}\sim \{ \text{WedgeV1b}[[ \text{index1}]]\}; \\
{}\quad \quad \quad \quad \quad \text{Str}=`` \text{running } \text{wedge }
\text{equation } ''<> \text{ToString}[ \text{index1}]<>``...''; \\
{}\quad \quad \quad \quad \quad \text{Print}[ \text{Str}, ``\setminus \text{n} '',  ``\setminus \text{n} '',`` \text{polynomials}: '',  ``\setminus \text{n} '',\text{Polyset1}]; \\
{}\quad \quad \quad \quad \quad \text{PossFac}=1; \\
{}\quad \quad \quad \quad \quad \text{Polyset1}= \text{Relation1}[
\text{Polyset1}]; \\
{}\quad \quad \quad \quad \quad \text{Polyset1}= \text{Relation2}[
\text{Polyset1}]; \\
{}\quad \quad \quad \quad \quad \text{Polyset1}= \text{ChangeVar1}[
\text{Polyset1}]; \\
{}\quad \quad \quad \quad \quad \text{Polyset1}= \text{ChangeVar2}[
\text{Polyset1}]; \\
{}\quad \quad \quad \quad \quad \text{Polyset1}= \text{CancelDenominator}[
\text{Polyset1}]; \\
{}\quad \quad \quad \quad \quad \text{Polyset1}= \text{ClusterReplace}[
\text{zwotype3}[[ jj1]], \text{Polyset1}]; \\
{}\quad \quad \quad \quad \quad \text{Polyset1}= \text{Table}[
\text{Simplify}[ \text{Polyset1}[[ j1]]],\{
j1,1, \text{Length}[ \text{Polyset1}]\}]; \\
{}\quad \quad \quad \quad \quad \text{Polyset1}= \text{Complement}[
\text{Polyset1},\{1,0,-1\}]; \\
{}\quad \quad \quad \quad \quad \text{VarSet1a}=\{\}; \\
{}\quad \quad \quad \quad \quad \text{VarSet1a}= \text{Variables}[
\text{Polyset1}]; \\
{}\quad \quad \quad \quad \quad \text{VarSet1b}= \text{Complement}[
\text{VarSet1a}, \text{Union}[ M, \text{mu}]]; \\
{}\quad \quad \quad \quad \quad \text{VarSet1b}= \text{SortBy}[
\text{VarSet1b}, \text{Max}[ \text{Table}[
\text{Exponent}[ \text{Polyset1}[[ k1]],\#],\\
{}\quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \{ k1,1, \text{Length}[ P
\text{olyset1}]\}]]\&]; \\
{}\quad \quad \quad \quad \quad \text{Polyset1}= \text{MinimizeExpofFac}[
\text{Polyset1}]; \\
{}\quad \quad \quad \quad \quad \text{While}[ \text{Length}[
\text{VarSet1b}]>0\&\& \text{Length}[ \text{Polyset1}]>1\&\&
\\
{}\quad \quad \quad \quad \quad \quad \text{MassRelationQ}[
\text{Polyset1}]== \text{False}, \\
{}\quad \quad \quad \quad \quad \quad \text{VA1}= \text{Elimi}[
\text{Polyset1}, \text{VarSet1b}[[1]]]; \\
{}\quad \quad \quad \quad \quad \quad \text{Polyset1}= \text{VA1}[[1]]; \\
{}\quad \quad \quad \quad \quad \quad \text{PossFac}= \text{PossFac}*
\text{VA1}[[2]]; \\
{}\quad \quad \quad \quad \quad \quad \text{Polyset1}= \text{Complement}[
\text{Polyset1},\{0\}]; \\
{}\quad \quad \quad \quad \quad \quad \text{Polyset1}= \text{CancelFactor}[
\text{Polyset1}]; \\
{}\quad \quad \quad \quad \quad \quad \text{If}[ \text{Length}[
\text{Polyset1}]>1, \\
{}\quad \quad \quad \quad \quad \quad \quad \text{Polyset1}=
\text{DeleteVar}[ \text{Polyset1}, \text{VarSet1b}]; \\
{}\quad \quad \quad \quad \quad \quad \quad \text{Polyset1}=
\text{DelDupPoly2}[ \text{Polyset1}, \text{VarSet1b}];  ]; \\
{}\quad \quad \quad \quad \quad \quad \text{VarSet1a}=\{\}; \\
{}\quad \quad \quad \quad \quad \quad \text{Do}[ \text{VarSet1a}=
\text{VarSet1a}\text{cup} \text{Variables}[ \text{Polyset1}[[ k1]]], \\
{}\quad \quad \quad \quad \quad \quad \quad \{ k1,1, \text{Length}[
\text{Polyset1}]\}]; \\
{}\quad \quad \quad \quad \quad \quad \text{VarSet1b}= \text{Complement}[
\text{VarSet1a}, \text{Union}[ M, \text{mu}]]; \\
{}\quad \quad \quad \quad \quad \quad \text{VarSet1b}= \text{SortBy}[
\text{VarSet1b}, \text{Max}[ \text{Table}[
\text{Exponent}[ \text{Polyset1}[[ k1]],\#], \\
{}\quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \{ k1,1, \text{Length}[  \text{Polyset1}]\}]]\&]; ]; \\
{}\quad \quad \quad \quad \quad \text{Polyset1}= \text{CancelFactor}[
\text{Polyset1}]; \\
{}\quad \quad \quad \quad \quad \text{Polyset1}= \text{Complement}[
\text{Polyset1},\{1,0,-1\}]; \\
{}\quad \quad \quad \quad \quad \text{If}[ \text{MassRelationQ}[
\text{Polyset1}]== \text{True}, \\
{}\quad \quad \quad \quad \quad \quad \text{Polyset1}= \text{Simplify}[
\text{TakeMassRela}[ \text{Polyset1}]]; \\
{}\quad \quad \quad \quad \quad \quad \text{Polyset1}=
\text{MinimizeExpofFacP}[ \text{Polyset1}]; \\
{}\quad \quad \quad \quad \quad \quad \text{Polyset1}=
\text{ChangeVar2Inv}[ \text{Polyset1}]; \\
{}\quad \quad \quad \quad \quad \quad \text{PossFac}=
\text{ChangeVar2Inv}[\{ \text{PossFac}\}][[1]]; \\
{}\quad \quad \quad \quad \quad \quad \text{PossFac}=
\text{MinimizeExpofFacP}[\{ \text{PossFac}\}][[1]]; \\
{}\quad \quad \quad \quad \quad \quad \text{Str}=`` \text{for }
\text{zwotype3 }[['' <> \text{ToString}[ jj1]<>``]] \text{and} \text{WedgeV}[[''  <> \\
{}\quad \quad \quad \quad \quad \quad \quad \quad \quad  \text{ToString}[ \text{index1}]<>``]], \text{we } \text{have } \text{mass } \text{relations }''; \\
{}\quad \quad \quad \quad \quad \quad \text{Print}[ \text{Str}]; \text{Print}[ \text{Style}[
\text{Polyset1}, \text{Blue}]]; \\
{}\quad \quad \quad \quad \quad \quad \text{Do}[ \text{massrellcm}=
\text{PolynomialLCM}[ \text{massrellcm},
\text{poly1}]; , \\
{}\quad \quad \quad \quad \quad \quad \quad \{ \text{poly1},
\text{Polyset1}\}]; \\
{}\quad \quad \quad \quad \quad \quad \text{PossFaclcm}=
\text{PolynomialLCM}[ \text{PossFaclcm}, \text{PossFac}];
\\
{}\quad \quad \quad \quad \quad \quad \text{Print}[`` \text{or } '',
\text{Style}[ \text{PossFac}, \text{RGBColor}[0,0.5,0]],`` ( \text{the }
\text{part } \text{obtained }\\
{}\quad \quad \quad \quad \quad \quad \quad\quad\quad \text{by } \text{factors } \text{of }
\text{coefficients } )'', ``\setminus \text{n}\setminus \text{n} ''];  ]; \\
{}\quad \quad \quad \quad \quad \text{If}[ \text{MassRelationQ}[
\text{Polyset1}]== \text{False}, \\
{}\quad \quad \quad \quad \quad \quad \text{TF1}=0; \\
{}\quad \quad \quad \quad \quad \quad \text{Str}=`` \text{We } \text{don't } \text{obtain } \text{any } \text{mass } \text{relation } \text{for }
\text{zwotype3 }[['' \\
{}\quad \quad \quad \quad \quad \quad \quad \quad <> \text{ToString}[ jj1] <>``]] \text{ and }
\text{WedgeV}[[''<> \text{ToString}[ \text{index1}] \\
{}\quad \quad \quad \quad \quad \quad \quad \quad <>``]], \text{we } \text{have } \text{relations}''; \\
{}\quad \quad \quad \quad \quad \quad \text{Print}[ \text{Str}]; \text{Print}[ \text{Polyset1}];  ]; \\
{}\quad \quad \quad \quad \quad \text{index1}++;  ];  jj1++];  ]; \\
{}\quad \quad \text{If}[ \text{TF1}==1, \\
{}\quad \quad \quad \text{Print}[`` \text{Finished}, \text{for }
\text{this } \text{diagram }, \text{we } \text{have } \text{mass }
\text{relations }'', \\
{}\quad \quad \quad \quad \quad \quad \text{Style}[ \text{massrellcm}, \text{Blue}], ``
\text{ or } '', \text{Style}[ \text{PossFaclcm}, \text{RGBColor}[0,0.5,0]], \\
{}\quad \quad \quad \quad \quad \quad`` (\text{the } \text{part } \text{obtained } \text{by } \text{factors } \text{of } \text{coefficients} )'' ], \\
{}\quad \quad \quad \text{Print}[`` \text{Finished}, \text{ we }
\text{don't } \text{obtain } \text{any } \text{mass } \text{relations }
\text{for } \text{this } \text{diagram}.'']]; ]; \\
{}\quad \text{Print}[`` \text{spending} \text{time}: '',
\text{AbsoluteTime}[]- t1,\ ``\setminus \text{n}\setminus \text{n}\setminus \text{n} '']; \\
\\
\text{(* Third algorithm for finding mass relations *)}  \\
{} \text{FindMassRel3}[\{ \text{zomatrix1}\_, \text{womatrix1}\_\},
\text{VertexSet1a}\_, \text{VertexSet1b}\_] := \\
\text{FindMassRel3}[\{ \text{zomatrix1}, \text{womatrix1}\},
\text{VertexSet1a}, \text{VertexSet1b}, \text{False}, \{\}]; \\
{} \text{FindMassRel3}[\{ \text{zomatrix1}\_, \text{womatrix1}\_\},
\text{VertexSet1a}\_, \text{VertexSet1b}\_,\\
{}\quad\quad\quad\quad\quad\quad\quad \text{RandomTF}\_,
\text{additionaleqnset}\_] := ( \\
{}\quad t1 = \text{AbsoluteTime}[]; \\
{}\quad \text{ODind1} = \text{Flatten}[ \text{Table}[
\text{Table}[\{ j1, i1\}, \{ i1, j1 + 1,
n\}], \{ j1, 1, n - 1\}], 1]; \\
{}\quad \text{EdgePos1} = \text{Select}[ \text{ODind1},
\text{XX1}[[\#[[1]], \#[[2]]]] > 0 \&]; \\
{}\quad \text{TriangleSet} = \{\}; \\
{}\quad \text{Do}[ \text{Do}[ \text{Do}[ \text{If}[
\text{Complement}[\{ \{ i1, j1\}, \{ j1, k1\}, \{ i1,
k1\}\}, \text{EdgePos1}] == \{\}, \\
{}\quad \quad \quad \quad \quad \text{AppendTo}[
\text{TriangleSet}, \{ i1, j1, k1\}];  ]; , \\
{}\quad \quad \quad \quad \{ i1, 1, j1 - 1\}]; , \{ j1, 2, k1 - 1\}];  ,  \{ k1, 3, n\}]; \\
{}\quad  \text{Idenu} = \text{Table}[ u[[\ s1[[1]], s1[[2]]\ ]]\wedge (-2) +
u[[\ s1[[2]], s1[[3]]\ ]]\wedge (-2)\\
{}\quad\quad\quad\quad - u[[\ s1[[1]], s1[[3]]\ ]]\wedge (-2), \{ s1, \text{TriangleSet}\}]; \\
{}\quad  {} \text{Idenv} = \text{Table}[ v[[\ s1[[1]], s1[[2]]\ ]]\wedge
(-2) + v[[\ s1[[2]], s1[[3]]\ ]]\wedge (-2) \\
{}\quad\quad\quad\quad - v[[\ s1[[1]], s1[[3]]\ ]]\wedge (-2), \{ s1, \text{TriangleSet}\}]; \\
{}\quad \text{Print}[ `` \text{finding }  \text{mass }
\text{relation } \text{of } \text{FMX}[['' <> \text{ToString}[ N1] <> ``]]
\text{with} '']; \\
{}\quad \text{Print}[\{ \text{MatrixForm}[ \text{outputform1}@
\text{zomatrix1}], \text{MatrixForm}[ \text{outputform1}@
\text{womatrix1}]\}]; \\
{}\quad \text{TF1} = 0; \text{PossFac} = 1; \\
{}\quad \text{EqnZ} = \text{Relation1}@ \text{EqnMZO}[\{
\text{zomatrix1}, \text{womatrix1}\},
\text{VertexSet1a}]; \\
{}\quad \text{EqnW} = \text{Relation1}@ \text{EqnMWO}[\{
\text{zomatrix1}, \text{womatrix1}\},
\text{VertexSet1b}]; \\
{}\quad \text{Polyset1} = \text{EqnZ} \cup \text{EqnW} \cup
\text{additionaleqnset}; \text{Polyset1b} = \{\}; \\
{}\quad \text{Polyset1} = \text{Relation1}[ \text{Polyset1}]; \\
{}\quad \text{Polyset1} = \text{Relation2}[ \text{Polyset1}]; \\
{}\quad \text{Polyset1} = \text{Relation3ver2}[ \text{Polyset1}]; \\
{}\quad \text{VarSet1a} = \text{Variables}[ \text{Polyset1}]; \\
{}\quad \text{VarSet1b} = \text{Complement}[ \text{VarSet1a},
\text{Union}[ M, \text{mu}]]; \\
{}\quad \text{Do}[ \text{If}[ \text{Complement}[ \text{Variables}[
\text{Idenu}[[ k1]]], \text{VarSet1a}] == \{\}, \\
{}\quad \quad \quad \text{Polyset1} = \text{Polyset1}\sim
\text{Join}\sim \{ \text{Idenu}[[ k1]]\}],  \{ k1, 1, \text{Length}[ \text{Idenu}]\}]; \\
{}\quad \text{Do}[ \text{If}[ \text{Complement}[ \text{Variables}[
\text{Idenv}[[ k1]]], \text{VarSet1a}] == \{\}, \\
{}\quad \quad \quad \text{Polyset1} = \text{Polyset1}\sim
\text{Join}\sim \{ \text{Idenv}[[ k1]]\}], \{ k1, 1, \text{Length}[ \text{Idenv}]\}]; \\
{}\quad \text{Polyset1} = \text{ClusterReplace}[\{ \text{zomatrix1},
\text{womatrix1}\}, \text{Polyset1}]; \\
{}\quad \text{Polyset1} = \text{CancelDenominator}[ \text{Polyset1}]; \\
{}\quad \text{Polyset1} = \text{CancelFactor}[ \text{Polyset1}]; \\
{}\quad \text{Polyset1} = \text{Complement}[ \text{Polyset1}, \{1, 0,
-1\}]; \\
{}\quad \text{Polyset1} = \text{ChangeVar3}[ \text{Polyset1}]; \\
{}\quad \text{Polyset1} = \text{CancelDenominator}[ \text{Polyset1}]; \\
{}\quad \text{Polyset1} = \text{CancelFactor}[ \text{Polyset1}]; \\
{}\quad \text{Polyset1} = \text{Complement}[ \text{Polyset1}, \{1, 0,
-1\}]; \\
{}\quad \text{VarSet1a} = \{\}; \\
{}\quad \text{Do}[ \text{VarSet1a} = \text{VarSet1a} \cup
\text{Variables}[ \text{Polyset1}[[ k1]]], \{ k1, 1, \text{Length}[ \text{Polyset1}]\}]; \\
{}\quad \text{VarSet1b} = \text{Complement}[ \text{VarSet1a},
\text{Union}[ M, \text{mu}]]; \\
{}\quad \text{VarSet1b} = \text{SortBy}[ \text{VarSet1b},
\text{Max}[ \text{Table}[ \text{Exponent}[ \text{Polyset1}[[ k1]],
\#],\\
{}\quad \quad\quad\quad\quad\quad \{ k1, 1, \text{Length}[ \text{Polyset1}]\}]] \&]; \\
{}\quad \text{Print}[ `` \text{Change } \text{of } \text{variables } '' , ``\setminus \text{n} '' , \text{Polyset1}]; \\
{}\quad \text{Print}[ \text{ToString}[ \text{Length}[ \text{Polyset1}]]
<> `` \text{polynomials}, '' <> \text{ToString}[ \text{Length}[
\text{VarSet1b}]] <> \\
{}\quad \quad \quad \quad `` \text{variables} '' <> \text{ToString}[
\text{VarSet1b}], `` \setminus \text{n}  \text{Simple} \text{Substitutions} '']; \\
{}\quad \text{Polyset1} = \text{SimpleSubstitution}[ \text{Polyset1},
\text{VarSet1b}]; \\
{}\quad \text{Polyset1} = \text{CancelFactor}[ \text{Polyset1}]; \\
{}\quad \text{Polyset1} = \text{Complement}[ \text{Polyset1}, \{1, 0,
-1\}]; \\
{}\quad \text{Polyset1} = \text{DelDupPoly2}[ \text{Polyset1},
\text{VarSet1b}]; \\
{}\quad \text{Polyset1b}=\text{Polyset1b}\cup \text{TakeMassRela}(\text{Polyset1});\\
{}\quad \text{Polyset1}=\text{Complement}[\text{Polyset1},\text{Polyset1b}];
{}\quad \text{VarSet1a} = \{\}; \\
{}\quad \text{Do}[ \text{VarSet1a} = \text{VarSet1a} \cup
\text{Variables}[ \text{Polyset1}[[ k1]]], \{ k1, 1, \text{Length}[ \text{Polyset1}]\}]; \\
{}\quad \text{VarSet1b} = \text{Complement}[ \text{VarSet1a},
\text{Union}[ M, \text{mu}]]; \\
{}\quad \text{VarSet1b} = \text{SortBy}[ \text{VarSet1b},
\text{Max}[ \text{Table}[ \text{Exponent}[ \text{Polyset1}[[ k1]],
\#],\\
{}\quad \quad \quad \quad \{ k1, 1, \text{Length}[ \text{Polyset1}]\}]] \&]; \\
{}\quad \text{Print}[ \text{Polyset1}, ``\setminus \text{n} '', \text{ToString}[ \text{Length}[ \text{Polyset1}]] <> `` \text{polynomials}, '' <>  \\
{}\quad \quad \quad \quad \text{ToString}[ \text{Length}[
\text{VarSet1b}]] <> `` \text{variables} '' <> \text{ToString}[ \text{VarSet1b}]];  \\
{}\quad \text{Polyset1} = \text{MinimizeExpofFac}[ \text{Polyset1}]; \\
{}\quad \text{While}[ \text{Length}[ \text{VarSet1b}] > 0 \&\&  \text{Length}[ \text{Polyset1}] > 1 \&\& \\
{}\quad \quad \text{MassRelationQ}[ \text{Polyset1}] == \text{False},
\\
{}\quad \quad \text{If}[ \text{RandomTF} == \text{True}, \\
{}\quad \quad \quad \text{Var1} = \text{RandomChoice}[ \text{VarSet1b}],
\\
{}\quad \quad \quad \text{Var1} = \text{VarSet1b}[[1]]]; \\
{}\quad \quad \text{str} = `` \text{Eliminating} \text{variable} '' <>
\text{ToString}[ \text{Var1}] <> ``...''; \\
{}\quad \quad \text{Print}[ \text{str}, ``\setminus \text{n} ''];
{}\quad \quad \text{VA1} = \text{Elimi}[ \text{Polyset1},
\text{Var1}]; \\
{}\quad \quad \text{Polyset1} = \text{VA1}[[1]]; \\
{}\quad \quad \text{PossFac} = \text{PossFac}* \text{VA1}[[2]]; \\
{}\quad \quad \text{Polyset1} = \text{Complement}[ \text{Polyset1},
\{0\}]; \\
{}\quad \quad \text{Polyset1} = \text{CancelFactor}[ \text{Polyset1}];
\\
{}\quad \quad \text{Polyset1b} = \text{Polyset1b} \cup
\text{TakeMassRela}[ \text{Polyset1}]; \\
{}\quad \quad \text{Polyset1} = \text{Complement}[ \text{Polyset1},
\text{Polyset1b}]; \\
{}\quad \quad \text{If}[ \text{Length}[ \text{Polyset1}] > 1, \\
{}\quad \quad \quad \text{Polyset1} = \text{DeleteVar}[
\text{Polyset1}, \text{VarSet1b}]; \\
{}\quad \quad \quad \text{Polyset1} = \text{DelDupPoly2}[
\text{Polyset1}, \text{VarSet1b}]; ]; \\
{}\quad \quad \text{VarSet1a} = \{\}; \\
{}\quad \quad \text{Do}[ \text{VarSet1a} = \text{VarSet1a} \cup
\text{Variables}[ \text{Polyset1}[[ k1]]], \{ k1, 1, \text{Length}[ \text{Polyset1}]\}]; \\
{}\quad \quad \text{VarSet1b} = \text{Complement}[ \text{VarSet1a},
\text{Union}[ M, \text{mu}]]; \\
{}\quad \quad \text{VarSet1b} = \text{SortBy}[ \text{VarSet1b},
\text{Max}[ \text{Table}[ \text{Exponent}[ \text{Polyset1}[[ k1]],
\#], \\
{}\quad \quad \quad \quad \quad \quad \quad \{ k1, 1, \text{Length}[ \text{Polyset1}]\}]] \&]; \\
{}\quad \quad \text{str} = `` \text{after } \text{eliminating } '' <>
\text{ToString}[ \text{Var1}]; \text{Print}[ \text{str}]; \\
{}\quad \quad \text{NV1} = \text{Table}[ \text{Length}[ f1], \{ f1,
\text{Polyset1b}\}]\sim \text{Join}\sim
\text{Table}[ \text{Length}[ f1], \{ f1, \text{Polyset1}\}]; \\
{}\quad \quad \text{If}[ \text{Max}[ \text{NV1}] <= 100, \text{Print}[ \text{Polyset1b}\sim \text{Join}\sim
\text{Polyset1}]]; \\
{}\quad \quad \text{Print}[ \text{ToString}[ \text{Length}[
\text{Polyset1b}\sim \text{Join}\sim \text{Polyset1}]] <> ``
\text{polynomials},\\
{}\quad \quad\quad\quad \quad '' <> \text{ToString}[ \text{Length}[ \text{VarSet1b}]] <> `` \text{variables} '' <> \text{ToString}[ \text{VarSet1b}]]; \\
{}\quad \quad \text{Print}[`` \text{numbers} \text{of} \text{terms} :
'', \text{NV1},``\setminus \text{n} \setminus \text{n} '',]; \\
{}\quad \text{If}[ \text{Polyset1b} != \{\}, \\
{}\quad \quad \text{Polyset1b} = \text{DelDupPoly3}[ \text{Polyset1b},
\text{VarSet1b}]; \\
{}\quad \quad \text{Polyset1b} = \text{Complement}[ \text{Polyset1b},
\{1, -1\}]; \\
{}\quad \quad \text{Polyset1b} = \text{Simplify}[ \text{Polyset1b}]; \\
{}\quad \quad \text{Polyset1b} = \text{MinimizeExpofFacP}[
\text{Polyset1b}]; \\
{}\quad \quad \text{Str} = `` \text{we } \text{have } \text{mass }
\text{relations }''; \\
{}\quad \quad \text{Print}[ \text{Str}, ``\setminus \text{n} '', \text{Style}[ \text{Polyset1b}, \text{Blue}]]; \\
{}\quad \quad \text{If}[ \text{PossFac} =!= 1,  \text{Print}[`` \text{or } '', \text{Style}[ \text{PossFac}, \text{RGBColor}[0, 0.5, 0]], `` ( \text{ the } \text{part } \\
{}\quad \quad \quad \quad \quad \quad \text{obtained } \text{by } \text{factors }
\text{of } \text{coefficients} )'', ``\setminus \text{n} \setminus \text{n} '']]; \\
{}\quad \quad \text{Polyset1b} = \text{ChangeVar2}[
\text{Polyset1b}]; \\
{}\quad \quad \text{Polyset1b} = \text{MinimizeExpofFacP}[
\text{Polyset1b}]; \\
{}\quad \quad \text{Polyset1b} = \text{ChangeVar2Inv}[
\text{Polyset1b}]; \\
{}\quad \quad \text{PossFac} = \text{ChangeVar2}[\{
\text{PossFac}\}][[1]]; \\
{}\quad \quad \text{PossFac} = \text{MinimizeExpofFacP}[\{
\text{PossFac}\}][[1]]; \\
{}\quad \quad \text{PossFac} = \text{ChangeVar2Inv}[\{
\text{PossFac}\}][[1]]; \\
{}\quad \quad \text{Print}[`` \text{another } \text{expression }:'', ``\setminus \text{n} '',  \text{Style}[ \text{Polyset1b}, \text{Blue}]]; \\
{}\quad \quad \text{If}[ \text{PossFac} =!= 1, \text{Print}[`` \text{or } '', \text{Style}[
\text{PossFac}, \text{RGBColor}[0, 0.5, 0]], ``\ ( \text{the } \text{part }
\\
{}\quad \quad \quad \quad \quad \quad \text{obtained } \text{by } \text{factors }
\text{of } \text{coefficients} )'']];  , \\
{}\quad \quad \text{If}[ \text{Length}[ \text{Polyset1}] > 1, \\
{}\quad \quad \quad \text{FacFamilyV1} = \text{Table}[\{\}, \{ k1, 1,
\text{Length}[ \text{Polyset1}]\}]; \\
{}\quad \quad \quad \text{Print}[ \text{FacFamilyV1}, ``\setminus \text{n} '',]; \\
{}\quad \quad \quad \text{Do}[ \text{FacFamilyV1}[[ k1]] =
\text{Table}[ \text{FactorList}[ \text{Polyset1}[[ k1]]][[ j1, 1]],\\
{}\quad \quad \quad \quad \{ j1, 1, \text{Length}@ \text{FactorList}[ \text{Polyset1}[[ k1]]]\}],
\\
{}\quad \quad \quad \quad \{ k1, 1, \text{Length}@
\text{FacFamilyV1}\}]; \\
{}\quad \quad \quad \text{Print}[ \text{FacFamilyV1}]; \\
{}\quad \quad \quad \text{Print}[]; \\
{}\quad \quad \quad \text{Do}[ \text{Polyset1}[[ k1]] = 1; \\
{}\quad \quad \quad \quad \text{Do}[ \text{Do}[ \text{TF1b} = 1; \\
{}\quad \quad \quad \quad \quad \quad \text{If}[
\text{PolynomialQ}[ \text{Simplify}@( \text{Expand}[
\text{Polyset1}[[ j1]]/ \text{FacFamilyV1}[[ k1]][[ i1]]]), \\
{}\quad \quad \quad \quad \quad \quad \quad \text{Variables}[ \text{Polyset1}[[ j1]]]] == \text{True}, \\
{}\quad \quad \quad \quad \quad \quad \quad \text{TF1b} = \text{TF1b}, \text{TF1b} = \text{TF1b}*0]; , \{ j1, 1, \text{Length}[
\text{Polyset1}]\}]; \\
{}\quad \quad \quad \quad \quad \text{If}[ \text{TF1b} == 1, \\
{}\quad \quad \quad \quad \quad \quad \text{Polyset1}[[ k1]] =
\text{Polyset1}[[ k1]]* \text{FacFamilyV1}[[ k1, i1]]];  , \\
{}\quad \quad \quad \quad \quad \{ i1, 1, \text{Length}[
\text{FacFamilyV1}[[ k1]]]\}]; , \\
{}\quad \quad \quad \quad \{ k1, 1, \text{Length}[ \text{Polyset1}]\}]; \\
{}\quad \quad \quad \text{Polyset1} = \text{CancelDenominator}[
\text{Polyset1}]; \\
{}\quad \quad \quad \text{Polyset1} = \text{CancelFactor}[
\text{Polyset1}]; \\
{}\quad \quad \quad \text{Polyset1} = \text{DeleteVar}[
\text{Polyset1}, \text{VarSet1b}]; \\
{}\quad \quad \quad \text{Polyset1} = \text{DelDupPoly2}[
\text{Polyset1}, \text{VarSet1b}];  ]; \\
{}\quad \quad \text{If}[ \text{Length}[ \text{Polyset1}] == 1, \\
{}\quad \quad \quad \text{Polyset1b} = \text{FactorList}[
\text{Polyset1}[[1]]]; \\
{}\quad \quad \quad \text{Polyset1}[[1]] = 1; \\
{}\quad \quad \quad \text{Do}[ \text{Polyset1}[[1]] =
\text{Polyset1}[[1]]* \text{Polyset1b}[[ i1]][[1]], \{ i1, 1, \text{Length}[
\text{Polyset1b}]\}]]; \\
{}\quad \quad \text{Print}[ \text{Polyset1}," ``\setminus \text{n} '' ", \text{ToString}[ \text{Length}[
\text{Polyset1}]] <> `` \text{polynomials}'', ``\setminus \text{n} '' ]; ]; \\
{}\quad \text{Print}[`` \text{time} \text{spent}: '',
\text{AbsoluteTime}[] - t1]; ) \\
\\
\)

§ APPENDIX IV: SOME FREQUENTLY APPEARED FACTORS IN MASS RELATIONS

Here we show details of some frequently appeared
long factors in mass relations, ordered according to their lengths.

The subscript of $\mu$ is the number of terms it contains.

m_i^6 m_j^6 -2 m_i^7 m_j^3 m_k^2 +m_i^6 m_j^4 m_k^2 +6 m_i^5 m_j^5 m_k^2 +m_i^4 m_j^6 m_k^2
-2 m_i^3 m_j^7 m_k^2 +m_i^8 m_k^4   - m_i^7 m_j m_k^4

+m_i^6 m_j^2 m_k^4 +2 m_i^5 m_j^3 m_k^4 -2 m_i^4 m_j^4 m_k^4+2 m_i^3 m_j^5 m_k^4
+m_i^2 m_j^6 m_k^4
-m_i m_j^7 m_k^4  +m_j^8 m_k^4,

=    -m_i^11 m_j^2+m_i^11 m_k^2+4 m_i^9 m_j^2 m_k^2+3 m_i^8 m_j^3 m_k^2+31 m_i^9 m_k^4
+31 m_i^8 m_j m_k^4   - 6 m_i^7 m_j^2 m_k^4

-9 m_i^6 m_j^3 m_k^4 -3 m_i^5 m_j^4 m_k^4 +31 m_i^7 m_k^6 +62 m_i^6 m_j m_k^6
+35 m_i^5 m_j^2 m_k^6   + 9 m_i^4 m_j^3 m_k^6 +6 m_i^3 m_j^4 m_k^6

+m_i^2 m_j^5 m_k^6 +m_i^5 m_k^8 +3 m_i^4 m_j m_k^8
+2 m_i^3 m_j^2 m_k^8      -2 m_i^2 m_j^3 m_k^8  -3 m_i m_j^4 m_k^8 -m_j^5 m_k^8,

=     3 m_i^12 m_j^4+9 m_i^11 m_j^5-24 m_i^12 m_j^2 m_k^2-30 m_i^11 m_j^3  m_k^2
-12 m_i^10 m_j^4 m_k^2-30 m_i^9 m_j^5 m_k^2  -28 m_i^8 m_j^6 m_k^2

+21 m_i^12 m_k^4  +21 m_i^11 m_j m_k^4-360 m_i^10 m_j^2 m_k^4
-670 m_i^9 m_j^3 m_k^4  -292 m_i^8 m_j^4 m_k^4  +36 m_i^7 m_j^5 m_k^4

+47 m_i^6 m_j^6 m_k^4  +29 m_i^5 m_j^7 m_k^4-154 m_i^10 m_k^6 -308 m_i^9 m_j m_k^6
-514 m_i^8 m_j^2 m_k^6-770 m_i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_l^5 m_n^3 + 21 m_i^4 m_k^12 m_n^4 +  63 m_i^3 m_j m_k^12 m_n^4
+ 63 m_i^2 m_j^2 m_k^12 m_n^4

+  21 m_i m_j^3 m_k^12 m_n^4 + 21 m_i^4 m_k^11 m_l m_n^4 +  63 m_i^3 m_j m_k^11 m_l m_n^4 + 63 m_i^2 m_j^2 m_k^11 m_l m_n^4

+  21 m_i m_j^3 m_k^11 m_l m_n^4 - 360 m_i^4 m_k^10 m_l^2 m_n^4 -  770 m_i^3 m_j m_k^10 m_l^2 m_n^4
- 460 m_i^2 m_j^2 m_k^10 m_l^2 m_n^4

-  50 m_i m_j^3 m_k^10 m_l^2 m_n^4 - 670 m_i^4 m_k^9 m_l^3 m_n^4 -  1390 m_i^3 m_j m_k^9 m_l^3 m_n^4
- 770 m_i^2 m_j^2 m_k^9 m_l^3 m_n^4

-  50 m_i m_j^3 m_k^9 m_l^3 m_n^4 - 292 m_i^4 m_k^8 m_l^4 m_n^4 -  584 m_i^3 m_j m_k^8 m_l^4 m_n^4 - 291 m_i^2 m_j^2 m_k^8 m_l^4 m_n^4

-  27 m_i m_j^3 m_k^8 m_l^4 m_n^4  - 28 m_j^4 m_k^8 m_l^4 m_n^4 +  36 m_i^4 m_k^7 m_l^5 m_n^4 + 14 m_i^3 m_j m_k^7 m_l^5 m_n^4
+  7 m_i^2 m_j^2 m_k^7 m_l^5 m_n^4

+ 29 m_i m_j^3 m_k^7 m_l^5 m_n^4 +  47 m_i^4 m_k^6 m_l^6 m_n^4 + 7 m_i^3 m_j m_k^6 m_l^6 m_n^4 -  40 m_i^2 m_j^2 m_k^6 m_l^6 m_n^4

+ 29 m_i^4 m_k^5 m_l^7 m_n^4 +  29 m_i^3 m_j m_k^5 m_l^7 m_n^4 - 21 m_i^3 m_j m_k^11 m_n^5 -  63 m_i^2 m_j^2 m_k^11 m_n^5
- 63 m_i m_j^3 m_k^11 m_n^5

-  21 m_j^4 m_k^11 m_n^5 + 670 m_i^3 m_j m_k^9 m_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m_n^9

+  3 m_i^2 m_j^4 m_k^6 m_l^2 m_n^10 + 6 m_i m_j^5 m_k^6 m_l^2 m_n^10 +
3 m_j^6 m_k^6 m_l^2 m_n^10 + 9 m_i^2 m_j^4 m_k^4 m_l^4 m_n^10
3 m_i m_j^5 m_k^4 m_l^4 m_n^10 - 6 m_j^6 m_k^4 m_l^4 m_n^10 +
15 m_i^2 m_j^4 m_k^3 m_l^5 m_n^10 + 15 m_i m_j^5 m_k^3 m_l^5 m_n^10
3 m_i^2 m_j^4 m_k^2 m_l^6 m_n^10 - 9 m_i m_j^5 m_k^2 m_l^6 m_n^10 +
3 m_j^6 m_k^2 m_l^6 m_n^10 + 15 m_i^2 m_j^4 m_k m_l^7 m_n^10
15 m_i m_j^5 m_k m_l^7 m_n^10 + 15 m_i^2 m_j^4 m_l^8 m_n^10 -
3 m_i m_j^5 m_k^3 m_l^4 m_n^11 - 3 m_j^6 m_k^3 m_l^4 m_n^11
3 m_i m_j^5 m_k m_l^6 m_n^11 + 3 m_j^6 m_k m_l^6 m_n^11 -
6 m_i m_j^5 m_l^7 m_n^11 + m_j^6 m_l^6 m_n^12

[1] Albouy, A., On a paper of Moeckel on central configurations.
Regul. Chaotic Dyn. 8, 133–142  (2003).

[2] Albouy, A., Cabral, H. E., Santos, A.A.,
Some problems on the classical n-body problem.
Celest. Mech. Dyn. Astron.  113, 369–375 (2012)

[3] Albouy, A., Chenciner, A.: Le problème des n corps et les distances mutuelles.
Invent. Math. 131, 151–184  (1998).

[4] Albouy, A., Kaloshin, V.,
Finiteness of central configurations for five bodies in the plane.
Ann. Math. 176, 535–588 (2012).

[5] Chazy, J.,
Sur certaines trajectoires du problème des n corps,
Bull. Astronom. 35, 321–389 (1918).

[7] Dias, T., Pan, BY.,
Generic finiteness for a class of symmetric planar central configurations of the six-body problem and the
six-vortex problem.
J. Dyn. Diff. Equations 32, 1579–1602 (2020).

[8] Dziobek, O., Über einen merkwürdigen Fall des Vielkörperproblems,
Astron. Nach. 152, 33–46  (2003).

[9] Euler. L., Considerationes de motu corporum coelestium.
Novi commentarii academiae scientiarum Petropolitanae. V. 10. 1764. P. 544–558.
Berlin acad.. april 1762. Also in Opera Omnia. V. 25, S. 2. P. 246–257. with corrections
and comments by M. Schürer.

[15] Hampton, M.,
Finiteness of kite relative equilibria in the five-vortex and five- body problems,
Qual. Theory Dyn. Syst. 8   349–356 (2009).

[16] Hampton, M., Jensen, A.,
Finiteness of spatial central configurations in the five-body problem,
Celest. Mech. Dyn. Astr. 109:321–332 (2011)

[17] Hampton, M., Moeckel, R.,
Finiteness of relative equilibria of the four-body problem,
Invent. Math. 163, 289–312  (2006).

[18] Jensen, A., Leykin, A.,
Smale's 6th problem for generic masses. Preprint 2023, arXiv:2301.02305.

[19] Lagrange, J. L., Essai sur le probléme des trois corps.
Œuvres. V. 6. 1772. pp.229–324.

[20] Leandro, E.,
Finiteness and bifurcations of some symmetrical classes of central configurations.
Arch. Rational Mech. Anal. 167, 147–177 (2003).

[21] Moczurad, M., Zgliczyński, P.,
Central configurations in planar n-body problem with equal masses for $n=5,6,7$.
Celest. Mech. Dyn. Astr. 131, 46 (2019).

[22] Moczurad, M., Zgliczyński, P.,
Central configurations in the spatial n-body problem for $n=5,6$ with equal masses
Celest. Mech. Dyn. Astr. 132, 56 (2020).

[23] Moeckel, R., On central configurations.
Math. Zeit., 205, 499–517. (1990).

[25] Moeckel, R., Generic finiteness for Dziobek configurations.
Trans. Amer. Math. Soc. 353, 4673–4686.

[26]  Moeckel, R.,  Lectures on central configurations, 2014.

[27] Moulton, F. R.,
The straight line solutions of the problem of N bodies. Ann. of Math. (2) 12, 1–17  (1910).

[28] Roberts, G. E.,
A continuum of relative equilibria in the five-body problem
Physica D 127, 141–145 (1999).

[30] Smale, S., Mathematical problems for the next century,
Math. Intelligencer 20, no. 2, 7–15  (1998).

[31] Yu, X.; Zhu, S.,
Finiteness of central configurations of  the Coulomb four-body problem. Preprint 2021.

[33] Wintner, A.,
The Analytical Foundations of Celestial Mechanics,
Princeton Math. Ser. 5, Princeton Univ. Press, Princeton, NJ, 1941.

[34] Xia, Z.,
Central configurations with many small masses,
J. Differential Equations 91,  168–179 (1991).