# An Improved Variable Neighborhood Search for the Reconfigurable Assembly Line Reconfiguring Problem
## 5 Proposed IVNS-RALRP
### Solution Evaluation  
The overall reconfiguration cost \(rc\) is not only related to the types and quantities of three new resources added from the resource library, but also to whether resources in the old assembly line \(OAL\) are moved individually or relocated as a whole within stations. To identify a new solution \(NAL\) using Data Structure 2, a fast method with \(O(z_{1}z_{2})\) (where \(z_{1}\) is the number of resources in the old assembly line and \(z_{2}\) is the number of resources in the new assembly line) can be presented as Algorithm 3. 1. Line 1 initializes variables necessary to compute the reconfiguration cost. Here, \(SRO^{\prime}\) records the number of individual resource movements in the old assembly line, \(SRD\) records the number of newly added dedicated resource, \(SRR\) records the number of newly added reconfigurable resource, and \(SRF\) records the number of newly added flexible resource. Since the cost of relocating entire station in the assembly line is set to 0, there is no need to track the number of resources involved. 2. Line 2 to 28 search each station of the new assembly line. Line 3 initializes \(allOld\gets 1\), indicating that the resources of the entire station in the new assembly line are relocated from the stations in the old assembly line. 3. Line 4 to 19 search each resource of each station. Line 5 checks whether the resource is a new resource. If it is a new resource, Line 7 to 15 determine its type and update the respective counters; otherwise, in Line 17, it is assumed to be an individual resource moved from the old assembly line and counted in \(SRO^{\prime}\). 4. Line 14, judge \(allOld\gets 1\), which means that the resources of the entire station of the new assembly line are the overall relocation of the station of the old assembly line. Further, Line 20 to 27 check if it involves relocating the entire station. If so, the number of resources counted in \(SRO^{\prime}\) in Line 17 is adjusted by subtracting the number of resources involved in relocating the entire station \(SRO^{\prime}\gets SRO^{\prime}-k_{max}\). 5. Line 29 calculates the total reconfiguration cost. ```
Data: Old assembly line \(OAL\), new assembly line \(NAL\). Result:\(rc\). \(SRO^{\prime}\gets 0\), \(SRD\gets 0\), \(SRR\gets 0\), \(SRF\gets 0\); for each station \(j\) in \(NAL\)do allOld\(\gets 1\); for each resource \(k\) in station \(j\)do ifnew\(==1\)then allOld\(\gets 0\); ifresource type is dedicatedthen \(SRD++\);  end if if resource type is reconfigurablethen \(SRR++\);  end if if resource type is flexiblethen \(SRF++\);  end if else \(SRO^{\prime}++\);  end if  end if allOld\(==1\)then for each station \(j^{\prime}\) in \(OAL\)do \(k_{max}\leftarrow\) number of resources; ifthe resources of station \(j^{\prime}\) are the same as those of station \(j\)then \(SRO^{\prime}\gets SRO^{\prime}-k_{max}\);  end if  end for  end for  end for \(rc\gets qSRO^{\prime}+\kappa SRD+\lambda SRR+\mu SRF\);
```  
**Algorithm 3**reCalculate  
```
Data: Old assembly line \(OAL\), new assembly line \(NAL\). Result:\(rc\). \(SRO^{\prime}\gets 0\), \(SRD\gets 0\), \(SRR\gets 0\), \(SRF\gets 0\); for each station \(j\) in \(NAL\)do allOld\(\gets 1\); for each resource \(k\) in station \(j\)do ifnew\(==1\)then allOld\(\gets



### Legal Check

Considering the process precedence constraint in RALRP, each operation in the partial solution \(NALO\) must satisfy it. Therefore, this paper proposes a legal check method for the operation precedence constraint about partial solution \(NALO\), as shown in Algorithm 4. Line 1 to 8 sequentially check whether each operation in the sequence represented by \(NALO\) satisfies the process precedence constraint denoted by \(G\). The indegree table \(inDegree\) records the indegree of each operation node, indicating how many operations precede each operation. Line 2 to 4 use the indegree table \(inDegree\) to determine if the operation has any predecessor nodes.