**3.1 Example: the traveling salesman problem**

Travelling salesman problem (TSP) can be easily applied to the Ant colony optimization. In this problem, there are a set of locations (cities) where the travelling salesman has to visit. The key constraints are to visit each location and visit only once. The distance between cities (locations) are given and the objective is to find the shortest distance between them.

In the example below, there are four cities, c1, c2, c3 and c4. The lengths of the edges between vertices is proportional to the distance between cities i.e. c13 is the distance between city 1 and city 3.

The pheromone is associated with the edges of the graph. Each ant starts from a randomly selected city and then at each construction step it moves along the edges of the graph. An ant chooses probabilistically the edge to follow among the available ones (those that lead to yet unvisited vertices).

## *3.1.1 Sample equation for implementation*

$$p(cij|\mathcal{s}^p) = \frac{\lambda^a{}\_{\vec{\imath}} \cdot \eta \left(c\_{\vec{\imath}j}\right)^\beta}{\sum\_{c\_{\vec{\imath}} \in \mathcal{N}(\mathcal{s}^p)} \lambda^a{}\_{\vec{\imath}j} \cdot \eta \left(c\_{\vec{\imath}j}\right)^\beta c}, \forall c\_{\vec{\imath}j} \in \mathcal{N}(\mathcal{s}^p). \tag{1}$$

*where pheromone value associated with the component cij is λij. Function that assigns at each construction step a heuristic value to each feasible solution component cij*∈ *N(s<sup>p</sup> ) is η(*�*) which is commonly called heuristic information. Positive parameters, whose values determine the relative importance of pheromone versus heuristic information are α and β.*

*The solution is constructed once the ant has visited all the vertices of the graph. When all the ants have constructed the solutions by visiting the vertices of the graph, pheromone levels on the edges are updated positively for good solutions and reduced for the bad solutions. The update function, typically does two things one is to increase the pheromone values for set of good solutions and second is to reduce the pheromone value by implementing an evaporation function. This helps to avoid rapid convergence of the algorithm and helps in the exploration of new areas.*

*3.1.2 Sample equation for pheromone update*

$$\lambda\_{\vec{\imath}\vec{\jmath}} \leftarrow (\mathbf{1} - \rho)\tau\_{\vec{\imath}\vec{\jmath}} + \rho \sum\_{s \in \mathcal{S}\_{\text{uppl}}|\varepsilon\_{\vec{\imath}} \in s} F(s) \tag{2}$$

*where set of solution that are used for update are S*upd *, the parameter that is called for evaporation rate is ρ* ∈ *(0,1], and F : S* ! *R+0 a function such that f(s) < f(s*<sup>0</sup> *) => F(s)* ≥ *F(s*<sup>0</sup> *),*∀*s* 6¼ *s* <sup>0</sup> ∈ *S. F(*�*) is commonly called the fitness function.*

Ant colony optimization has been shown to perform quite well on the TSP [13].

### **3.2 Other applications of ACO: Scheduling problems**

ACO has been used for many applications including scheduling problem, vehicle routing problem, assignment problem, set problem, device sizing problem in nanoelectronics physical design, antennas optimization and synthesis, image processing. In this chapter our focus is on the scheduling problems.

In scheduling problems, jobs have to be processed on one or many machines such that some objective function is optimized. For these problems the following is true (a) the processing time of jobs is known beforehand and (b) processes of jobs cannot be interrupted. Typically the construction graph for scheduling problems is represented by the set of jobs (for single-machine problems). Some of the key research papers published for scheduling problems are:


*An Innovative Maintenance Scheduling Framework for Preventive, Predictive Maintenance… DOI: http://dx.doi.org/10.5772/intechopen.103094*


Out of the above scheduling applications, the SMTWTP has the best application for our maintenance schedule. In the subsequent sections, SMTWTP is described in greater detail for developing the optimal schedule for maintenance of mining equipment's.
