# A Genetic Crow Search Algorithm for Optimization of Operation Sequencing in Process Planning
## 3 Operation Sequencing: Problem Formulation
### Precedence Constraints  
The precedence constraints within operation sequencing are formulated according to relevant geometrical and manufacturing considerations. They indicate the precedence relationships between operations required to generate a feasible machining sequence. [PERSON] et al. [16] classified constraint relationships into the precedence and the clustering constraints. The precedence constraints are obligatory conditions that must be met, while on the other side, the clustering constraints do not need to be met but have effect on machining efficiency and quality. The precedence constraints can be classified into eight types: datum relationships, primary and secondary relationships, face and hole relationships, processing stage relationships, feature priority relationships, thin-wall relationships, fixed order of operations relationships and material-removal relationships. [PERSON] et al. [20] made similar classification on hard and soft constraints, where hard constraints represent obligatory conditions, while soft constraints can be violated if necessary.  
To visualize precedence relationships between operations, we adopted an operation precedence graph model (OPG). The OPG is a directed graph consisting of vertices and edges, OPG = (V, E), where vertices V represent the set of operations, while edges E denote the set of links between operation vertices. Each operation element within the operation vector is mapped to the corresponding vertex of the OPG. On the other hand, each precedence relationship is visualized using edges. Vertices that are not linked with edges have no precedence relationships between them. For easier manipulation of the data concerning precedence relationships, adjacency or precedence matrix has been adopted. Figure 2 shows the main elements of OPGs and their mapping to a matrix form. Using a simple example with five operations and four precedence constraints a precedence matrix PM is designed. The value _pc[i,j]_ is a binary value which represents whether operation \(i\) precedes operation \(j\) or not. As shown, number 1 denotes that there is a precedence relationship between observed operations while 0 shows the lack of any precedences, i.e., no edge between operation \(i\) and operation \(j\). By following the edges of an OPG, all the vertices should be traversed in order to obtain a feasible operation sequence.  
\begin{table}
\begin{tabular}{c c c} \hline \hline
**Data Types** & **Variables** & **Description** \\ \hline double & _Open[n]_ & The ID of the operation as a part of an operation sequence \\ double & _Machines[n]_ & The ID of the machine as a part of a machine vector of n \\  & & machines for performing n operations \\ double & _Tools[n]_ & The ID of the tool as a part of a tool vector of n tools for \\  & & performing n operations \\ double & _TADs[n]_ & The ID of the cutting tool as a part of a TAD vector of n \\  & & TADs for performing n operations \\ cell & _Machines[n]_ & Array of machine candidates list for n cells with each cell \\  & & containing alternative machines for the n-th operation \\ cell & _TADs[n]_ & Array of tool candidates list for n cells where each cell \\  & & contains alternative tools for the n-th operation \\  & & Array of TAD candidates list for n cells where each cell \\  & & contains alternative TADs for the n-th operation \\ \hline \hline \end{tabular}
\end{table}
Table 1: Data types of the operation sequencing variables.