## 3 Matrix-Based Establishment of Mathematical Model
### Calculation of Interference Relationship Penalty  
To address the calculation of the interference relationship penalty, this paper utilizes an adjacency matrix and an interference matrix to describe the connections and constraints between components. The complexity of assembly is evaluated based on the number of components connected to the current ones and the degree of freedom for movement. By implementing appropriate amplification coefficients, we can ultimately determine the interference relationship penalty.  
The adjacency matrix and interference matrix are static and not influenced by the assembly sequence of prefabricated components. However, the interference penalty is a dynamic figure that depends on different assembly sequences. There are two decisive factors for the interference penalty: the number \(m\) of components connected with the target component and assembled before the target component and the number \(n\) of free-to-move directions considering the layout interference brought by \(m\) components.  
1. \(m\): the number of components connected with the target component and assembled before the target component  
The value of \(m\) can be easily obtained from the adjacency matrix when an assembly sequence is given. If \(m\) is equal to 0 or 1, then there is no significant difficulty in assembling the target component. When \(m\) is equal to or greater than 2, the interference penalty needs to be calculated, and \(m\) will influence the value of \(n\) by restricting the maximum of \(n\). It is evident from engineering experience that the difficulty of assembly increases as \(m\) increases.  
\(n\): the number of free-to-move directions considering the layout interference brought by \(m\) components  
The number of free-to-move directions \(n\) depends on the value of \(m\), and different circumstances need to be considered for each value of \(n\). Table 3 lists some examples of different combinations of \(m\) and \(n\) with the free-to-move directions of target components. The difficulty of assembly increases with the decrease of \(n\).  
As mentioned above, the interference penalty changes dynamically with different assembly sequences. For a given assembly sequence \(\tau_{k}\), the assembly wedge \(AW(p_{i})\) can be obtained through Equation (9).  
\[AW(p_{i})=\gamma_{j}MW(p_{i},p_{j}) \tag{9}\]  
where \(p_{j}\) is the component assembled before \(p_{i}\) with the given assembly sequence \(\tau_{k}\). The elements in \(AW(p_{i})\) are \(q_{1}\), \(q_{2}\), \(q_{3}\), and \(q_{4}\), which correspond to four directions, and \(n\) is the sum of \(q_{1}\) to \(q_{4}\).  
Calculation formula of interference penalty  
As depicted in Equation (10), the interference relationship penalty of the \(j\)-th component \((P_{layout})_{j}\) is computed by multiplying the amplification factor \(s\) with the previously introduced \(m\). Equation (11) demonstrates that the sum of the \(P_{layout}\) values for all elements in the assembly sequence yields the total value \(\left(\sum P_{layout}\right)\) of that sequence. The optimal assembly sequence is obtained by eliminating the assembly sequences with high assembly difficulty.  
\[\left(P_{layout}\right)_{j}=m\times s \tag{10}\]  
\[\sum P_{layout}=\sum_{j=1}^{n}\left(P_{layout}\right)_{j} \tag{11}\]  
where \(s\) represents the amplification factor to distinguish the assembly difficulty of different values of \(n\). Here, \(n\) is the number of free-to-move directions considering the layout  
\begin{table}
\begin{tabular}{c c c} \hline \hline \(m\) & \(n\) & \(0\) & \(1\) \\ \hline \(2\) & & \(2\) & \(3\) \\ \hline \(3\)  
interference brought by \(m\) components. \(m\) is the number of components connected with the target component and assembled before the target component.  
The parameter \(n\) in Equation (11) represents the total number of the components.