## 5 Algorithm
### Pseudocodes  
Algorithm 1 details the search procedure of VLE metaheuristic. ```
1:read input data: \(o.f\), \([decision\ variable\ ranges]\), \(D\), \(E\), \(M\), and \(R\)
2:for\((e=1:E)\)do
3: initialize lists, neighbourhood, accountants \((m=1,\)\(r=1)\), totalizer of variables \((tvar=0)\) and status of variables \((svar(d)=0)\)
4: generate an initial solution randomly
5: evaluate the fitness of the current solution
6: update the list of accepted and best movements with the current solution
7: update the list of rejected movements with
8: update the best solution with the current solution
9: characterise the chemical components
10: create the wide area neighbourhood of solutions for each decision variable
11: while (1) do
12:if or\((m>M,\)\(r>R)\)then
13: break
14:endif
15:if\((tvar<D)\)then
16: search the best change for each decision variable in its corresponding neighbourhood
17: else
18: create a local area neighbourhood for each decision variable with closer neighbours
19:endif
20: evaluate the fitness of the current solution
21: evaluate the fitness change as \(fcha=fit-bfit\)
22:if\((fcha<0)\)then
23:if\((fcha<\delta)\)then
24: make a downhill movement (a new best solution), and update the records
25: else
26: make an uphill movement
27:endif
28:else
29: make an uphill movement
30:endif
31: display\(e,m,r,bfit\)
32:endwhile
33:save\(e,x,bfit,\) convergence graphic
34:endfor
35:sort\(bfit\)
36:save\(box\)\(plot\)
37:save\(statistics\)
```  
**Algorithm 1**Main procedure of the vapour-liquid equilibrium-based metaheuristic. Algorithm 2 describes the search procedure of the best change for each decision variable. This is done by sorting the saved values of the objective function when creating or updating the search neighbourhood. The lower value points out the best location, i.e., \(bsite(d)\), and therefore the new value for decision variable \(d\). This value is compared with \(csite(d)\), the current location for decision variable \(d\). If it is the same location, then it remains until the intensification procedure starts. ```
1:for (\(d=1\):\(D\))do
2: sort the saved values of the objective function when creating or updating the search neighbourhood for \(d\). 3:if (\(bsite(d)==csite(d)\)) then
4: assign \(svar(d)=1\)
5: evaluate \(tvar=tvar+1\)
6:endif
7:endfor
```  
**Algorithm 2**Procedure of search of the best change for each decision variable. Algorithm 3 shows that a _local area neighbourhood_ is created for \(d\) with solutions closer to the best solution found after reducing the range of decision variable \(d\). ```
1:for (\(d=1\):\(D\))do
2: reduce the range of search for decision variable \(d\)
3: generate a new random value for decision variable \(d\) using the new range for \(d\)
4: assign \(svar(d)=0\)
5:endfor
6:initialize \(tvar=0\)
7:create the local area neighbourhood of search of all decision variables
```  
**Algorithm 4**Downhill procedure. Algorithm 5 explains the uphill procedure. When a worse solution is found, the algorithm calculates its acceptance probability assigning a random number between 0 and 1. This probability was defined as \(P(B|A)\), where \(A\) is the event \(find\)\(a\)\(worse\)\(solution\), and \(B\) is the event \(accept\)\(a\)\(worse\)\(solution\). This probability is compared with the \(\beta\) parameter. If \(P(B|A)\) is greater or equal than \(\beta\), then the algorithm accepts the movement and updates the records, otherwise the algorithm rejects the movement and restarts the search with the original search ranges.