# Evaluation of Disassembling Process Inference Based on Positional Relations Matrix
## 2 Disassembling Process Inference Based on Positional Relations Matrix
### Disassembling Process Inference
#### 2.2.2 Generation of Disassembling Process for Specified Parts  
On the basis of the disassembly-move sets, we can generate a disassembling process for specified part \(J\) by means of the following procedure:  
**Procedure**: Disassembling Process (\(J\))  
Generate a disassembling sequence for specified part \(J\) as follows:  
1. Search for a disassembly move \((J,K)\in\mathcal{A}_{N}\) corresponding to the specified part \(J\). The search of such \(\mathcal{A}_{N}\) is conducted from \(\mathcal{A}_{1}\) to \(\mathcal{A}_{R}\), since a move that is available in earlier stage is expected to have fewer impeding parts. Adopt the first detected \((J,K)\in\mathcal{A}_{N}\).
2. Use **Sub-Procedure A** as Mark Move \((N,(J,K))\) to mark the disassembly moves required to be performed in order to make move \((J,K)\in\mathcal{A}_{N}\) feasible.
3. Use **Sub-Procedure B** as Generate Sequence (\(J\)) to generate the sequence of disassembly moves, finally achieving move \((J,K)\in\mathcal{A}_{N}\).  
**Sub-Procedure A**: Mark Move \((n,(j,k))\)  
Mark the required disassembly moves in \(\mathcal{A}_{1},\ \cdots,\mathcal{A}_{n}\) in order to achieve move \((j,k)\in\mathcal{A}_{n}\); that is, mark the moves corresponding to the impeding parts for move \((j,k)\in\mathcal{A}_{n}\) as well as the move itself.  
1. Mark \((j,k)\in\mathcal{A}_{n}\).
2. If \(n=1\), then the specified move \((j,k)\in\mathcal{A}_{1}\) is immediately feasible. Terminate this sub-procedure.
3. \((n>1)\) There are impeding parts for move \((j,k)\in\mathcal{A}_{n}\). For each part \(i\), such that \(M_{ijk}=1\), search for a disassembly move \((i,l)\in\mathcal{A}_{m}\) corresponding to part \(i\) from \(\mathcal{A}_{1}\) to \(\mathcal{A}_{n-1}\) and use this procedure in a recursive manner as Mark Move \((m,(i,l))\).  
**Sub-Procedure B**: Generate Sequence (\(J\))  
Generate a disassembling sequence for part \(J\) based on the disassembly moves that are marked by above **Sub-Procedure A**.  
Set initial values as \(m=1\) (stage number), \(n=0\) (sequence length), \(S_{0}=[]\) (sequence (empty)), \(\mathcal{D}=\varnothing\) (already disassembled-part set (empty)).  
For all the marked move \((j,k)\in\mathcal{A}_{m}\), if \(j\
otin\mathcal{D}\) then add the move \((j,k)\) at the end of sequence \(S_{n}\) as \((j_{n+1},k_{n+1})\). Increment sequence length as \(n\gets n+1\) and update the disassembled-part set \(\mathcal{D}\leftarrow\mathcal{D}\cup\{j\}\).  
If \(j_{n}=J\), that is, the disassembly of the target part is achieved, then the required sequence of moves is accomplished as \(S_{n}=[(j_{1},k_{1}),\cdots,(j_{n},k_{n})]\) where \(j_{n}=J\) is the target part; terminate this sub-procedure.  
Increment stage number as \(m\gets m+1\) and repeat from step (1).  
The procedure gives a feasible disassembling process as a sequence of disassembly moves; however, the optimality of the generated process is not guaranteed. There are plural possibilities of selection of candidate moves \((J,K)\in\mathcal{A}_{N}\) at step (1) and \((i,l)\in\mathcal{A}_{m}\) at step (3). In the current study, we adopt the corresponding move from the earliest stage; however, any such move can be available for the generation of a feasible disassembling process. In other words, there can be other selections of moves that result in a better disassembling process.  
The recursive use of **Sub-Procedure A**: Mark Move in step (3) can be processed in a parallel manner. It should be noted that the information of marked disassembly moves has to be shared by all the processing units. This possibility of parallel processing is considered to be effective, especially in the case of the search for an optimal disassembling process.