## 2 Materials and Methods
### Combinatorial Optimization Techniques
#### 2.3.2 Gradient-Alike Algorithm  
The opposite of the mentioned above approach would be searching for a local minimum among all combinations with a gradient algorithm [11]. Here, we will compute an analogue of the derivative that is used to define the search direction at each point [12]. 'Derivative' for each competing operation is calculated by trying to shift it by one position to the left. In case the objective function reduces (or increases for maximization problems) we shift the operation to the left with the defined step (the step ratio is measured in a number of position operation skips moving to the left). The formal presentation of the designed gradient-alike algorithm is described by Procedure 2. **Procedure 2: gradient algorithm**  
1. **Find the initial solution** of the **LP problem** (1)-(3) for the combination \(c_{k}\in\{0,1\}\), \(k=1,\ldots,K\) that corresponds to the case when all orders are in a row (first operation of the following order starts only after the last operation of preceding order is completed). 2. **Remember** the solution and keep the value of objective function \(\Phi\) as temporarily best result \(Opt=\Phi\). 3. **Select the last** order \(f=|F|\). 4. **Select the resource \(r=|R|\)** that is used by first operation \(i=1\) of the sequence graph of the manufacturing process. 5. **The current optimization variable for gradient optimization is selected**--position of operation \(i\) of the order \(f\) on the resource \(r<i,r,f>\). 6. **Condition**: Does the selected resource \(r\) have more than one operation in the manufacturing procedure that allocates it? 6.1. **If yes then**  
**Begin** optimizing position \(<i,r,f>\)  
6.1.1. **Set the step of shifting** the operation to maximum (shifting to the leftmost position). \(D(i,r,f)=\) max  
6.1.2. **Find the 'derivative' of shifting** the operation \(i\) to the left  
**Shift** the operation \(i\) one position to the left  
**Find** the solution of the **LP problem** (1)-(3) for current combination and calculate the objective function \(\Phi\)  
**Condition A**: is the solution feasible? **If** feasible **then**  
**Condition B**: Is the objective function value \(\Phi\) better than temporarily best result \(Opt\)? **If yes then**  
We found the optimization direction for position \(<i,r,f>\), proceed to p. 6.1.3  
**If not then**  
Figure 3: Permutations of competing operations in branch-and-bound algorithm. No optimization direction for the current position \(<i,r,f>\) stop optimizing position \(<i,r,f>\) switch to the next operation \(i=i+1\) go to p 6 and repeat search for position \(<i+1,r,f>\) End of condition B If not feasible then  No optimization direction for the current position \(<i,r,f>\) stop optimizing position \(<i,r,f>\) switch to the next operation \(i=i+1\) go to p 6 and repeat search for position \(<i+1,r,f>\) End of condition A ```  
1.3 **Define the maximum possible optimization step** for the current position \(<i,r,f>\), initial step value \(D(i,r,f)=\max\)  
**Shift** the operation \(i\) left using the step \(D(i,r,f)\). **Find** the solution of the **LP problem** (1)-(3) for current combination and calculate the objective function \(\Phi\)  
**Condition C**: Is the solution feasible and objective function value \(\Phi\) better than temporarily best result \(Opt\)? **If yes then**  
**save current solution** as the new best result \(Opt=\Phi\) stop optimizing position \(<i,r,f>\) switch to the next operation \(i=i+1\) go to p 6 and repeat search for position \(<i+1,r,f>\) If not then**  
**reduce the step twice \(D(i,r,f)=\frac{D(i,r,f)}{2}\) and repeat operations starting from p. 6.1.3 End of condition C Switch to the next operation \(i=i+1\), go to p. 6 and optimize position \(<i,r,f>\)  
7. **Switch to the preceding resource \(r=r-1\)**  
8. **Repeat** pp. 5-7 for currently selected resource \(<i,r-1,f>\)  
9. **Switch to the preceding order \(f=f-1\)**  
10. **Repeat** pp. 4-9 for currently selected order \(<i,r,f-1>\). 11. **Repeat** pp.