# Multi-Objective Production Scheduling of Perishable Products in Agri-Food Industry
## 4 Proposed Approach
### The Proposed ACO
#### 4.3.2 Pseudo Code of the Proposed ACO  
The pseudo code of the proposed algorithm (see the Algorithm 1) for optimizing the objective function that represents the sum of the expired products is presented below.  
```
1:procedureinitialization
2: Initialize the pheromone matrix \(\tau_{ij}^{k}(0)\leftarrow\tau_{0}\)
3: Initialize taboo list
4: Realisation of a cycle:
5:while\((Nc<Nc_{m})\)do
6:for each job in \(1\ldots n\)\(Type\),\(Type2)\)
7:for each ant in \(1\ldots m\)
8: Choose a job \(J_{i}\), randomly
9: Update all available jobs
10: Insert the \(Sk\) solution in the taboo list
11: Select the following job according to \(P_{ij}^{k}\)
12: Update the pheromone matrix \(\Delta\tau_{ij}^{k}\) according to the \(Sk\) solution
13:Global update of the pheromone trace for each job in \(1\ldots n\) Evaluate the \(Sk\) solution according to the objective function Update the matrix \(\tau_{ij}^{k}\)
14:End For
15:End For
16:End While
17:\(Nc\gets Nc+1\)
```  
**Algorithm 1** pseudo code of the ACO algorithm  
Upon initialization of the algorithm, the intensity of the pheromone trace for all the pairs of jobs (\(i_{j}\)) are set to a small positive value \(\tau_{0}\). The parameter \(\alpha,\beta,\gamma\) are used to determine the relative importance of the intensity of the trace and goals in the construction of a solution.  
In addition, a taboo list is maintained to ensure that a job that has already been assigned to the sequence being built is not selected as in the old days. Each ant \(k\) therefore has its own taboo list, \"\(taboo_{k}\)\", which will keeps the jobs already selected in mind.  
\[P_{ij}^{k}(t)=\left\{\begin{array}{ll}\frac{[\tau_{ij}(t)]^{\alpha}*[\phi_{ ij}]^{\beta}*[\psi_{ij}]^{\gamma}}{\sum_{k\in taboo_{k}}[\tau_{ik}(t)]^{\alpha}*[\phi_{ ij}]^{\beta}*[\psi_{ik}]^{\gamma}}&,\text{ if }\ j\in\Omega\\ 0&,\text{ else.}\end{array}\right. \tag{17}\]  
\(\Omega\) represents the set of available jobs; \(\phi_{ij}=\frac{1}{v_{ijk}}\); \(\psi_{ij}=p_{ij}\); and \(v_{ijk}\) and \(p_{ij}\) represent, respectively, the date of validity of the component \(c_{ijk}\) related to job \(i\) and the duration of execution (standardized), which have direct influences on the objective function. During an iteration of the algorithm, several ants build a role in turn, a solution represented by a sequence of jobs. At the end of each cycle, each of the \(m\) ants deposit a certain quantity ofther than the other one. The pheromones \(\Delta\tau_{ij}^{k}(t)\) defined in the following equation; in its way, this quantity depends on the quality of the solution.  
Let \(P_{p\;min}^{k}(t)\) be the evaluation of the objective to be optimized fpr the solution found by the \(k^{\text{\emph{emc}}}\) ant.  
The contribution to updating the trace of the ant \(k\) is then calculated in the following way:  
\[\Delta\tau_{ij}^{k}(t)=P_{p\;min}^{m}/P_{p\;min}^{k}(t)\]  
where \(P_{p\;min}^{k}(t)\) is the number of perishable products associated with the ant \(k\)\((Sk)\) at the moment \(t\), and \(P_{p\;min}^{m}\) represents the minimum number of perishable products obtained after the \(m\) ants have made their paths.  
The algorithm performs an overall update of the intensity of the pheromone trace \(\tau_{ij}^{k}\) at the end of each cycle to avoid premature convergence of the ACO algorithm. This update is influenced by an evaporation factor \(\rho\), \(0<\rho<1\), which decreases the quantity of pheromone present on all arcs (aij) [33]. This evaporation must not affect the tests: the solutions to the taboo list.  
\[\tau_{ij}^{k}=\rho*\tau_{ij}^{k}+\sum_{i=1}^{m}\Delta\tau_{ij}^{l}\]