Professional Documents
Culture Documents
Chapter 3 (2) Ant
Chapter 3 (2) Ant
OPTIMIZATION
This chapter gives a brief introduction to meaning of optimization problems and trends in
solving different optimization problems. Further this chapter elaborates on various optimization
techniques and in particular two swarm based meta-heuristic techniques: Ant Colony
Optimization & Particle Swarm Optimization.
1.1 Introduction
Optimization problems are common to almost all domains. Optimization deals with finding the
best solution which is optimal or near-optimal. For large problems it is often difficult to find the
optimal solution. Optimality is defined with respect to some goal or goals. These goals are also
known as objective functions. Problem solving is not a one-step solution but a series of steps
that need to be followed sequentially one after the other. Researchers have also defined the
steps that one must follow to solve a problem like, recognizing and defining problems,
constructing and solving models, and evaluating and implementing solutions [17]. Scheduling
of tasks in cloud is an optimization problem that is concerned with the efficient allocation of
limited resources to meet desired objective. Objective is defined via an objective function.
Generally, there are many possible alternatives to consider and an objective determines which
of these alternatives is best. So, all moves around the objective function. Slightest of change in
the objective function can lead to different solution or alternative.
Developers are confronted with a large number of optimization problems. In such problems,
different decision alternatives exist and developer has to select one of these. Impact of selecting
one of the available alternatives as optimal or near-optimal can be measured by some kind of
evaluation criteria. Generally, the optimization problems deal with either maximizing or
minimizing the evaluation function. For example, increasing the profits and decreasing the cost.
In optimization problems, developers are interested in choosing the alternative that either
maximizes or minimizes an evaluation function which is defined on the selected evaluation
criteria.
Optimization problems have the following characteristics:
• Numbers of decision alternatives are available from which one alternative is selected.
• Selection of the alternate is subject to constraints that limit the number of available
alternatives.
• Evaluation criteria is directly affected by choice of decision alternate.
• An evaluation function defined on the decision alternatives helps to describe the effect of
thedifferent decision alternatives.
Decision alternate for an optimization problem should be based on all available constraints and
the one that maximizes/minimizes the evaluation function.
Formally we can say that optimization problem is to find an x* X for which
f (x*) ≥ f (x) for all x X (maximization problem)
f (x*) ≤ f (x) for all x X (minimization problem)where:
Xis a set of feasible solutions x X f :X →R is an evaluation function that assigns a real value
to every element x of the search [17].
In optimization models, decision variables x∈X indirectly contain the definition of the search
space X. Formally, search space may be defined as set of feasible solutions of an optimization
problem. Search space also define relationships between solutions.
Topological space is also a second name for search space. A topological space describes the
similarities between the solutions using relationships between the set of solutions and not by
defining distances between solutions. A topological space is an ordered pair (X,T), where X is a
set of solutions and T is a collection of subsets of X called open sets. Metric search spaces are a
specialized form of topological spaces where the similarities between solutions are measured by
a distance. Neighborhoodis used to find the solutions that are similar to each other [17].
Optimal Solutions
A globally optimal solution for an optimization problem is defined as the solution x∗∈X, where
f(x∗) ≤ f(x) for all x ∈X (minimization problem). It is important that neighbourhood, a metric or
search space is defined for the solution properly in order to define the globally optimal solution.
Given a problem instance (X, f) and a neighborhood function N, a feasible solution X is
called locally optimal (minimization problem) with respect to N if
f(xI) ≤ f(x) for all x∈N(xI)
A locally optimal solution does not exist if no neighborhood is defined. Furthermore, the
neighbourhood helps to determine the existence of local optima as different local optima
solutions are provided by neighbours at the same time for the same problem [17].
Optimization is used to ensure that near optimal (if not optimal) solutions are provided to the
user. The effort needed to the solve that problem refers to the problem difficulty which can be
expressed in terms of computing time needed and memory space needed to solve it.
Problems that cannot be solved in polynomial time are called intractable problems for which it
is possible to define lower bound on the running time. For example, guessing the correct
number for a digital door lock with n digits is an intractable problem, as the time necessary for
finding the correct key is Ω(10n). For this problem, the size of the problem is n, whereas the size
of the search space is |X| = 10n. The effort to find the correct key depends on n and increases at
the same rate as the size of the search space. Below is the growth rate of some common
functions [17].
Table 3.1:Polynomial (top) and exponential
(bottom) functions [17] Function Growth Rate
Constant O(1)
Logarithmic O(logn)
Linear O(n)
Quasilinear O(nlogn)
Quadratic O(n2)
polynomial (of order c) O(nc), c >1
Exponential O(kn)
Factorial O(n!)
super-exponential O(nn)
We can categories problems into three different types on the basis of the difficulty.
• First type of problems that can be easily solved in P (polynomial time) are called tractable
problems.
• Second category of problem is more difficult as compared to tractable problems and there
does not exist any polynomial time solution for it, called the intractable problems.
• Problems where no polynomial-time algorithm is known but intractability has not yet been
shown. These problems are also difficult.
The second generation of the optimisation methods is meta-heuristicthat gives much better
results than the heuristic algorithms and are used to solve extremely large and complex
problems that cannot be solved in polynomial time. Agents in metaheuristic algorithms tend to
explore the search space at the same time to look for near optimal solutions based on some pre-
defined objective function. Metaheuristic algorithms can be broadly classified into different
categories given in the literature [21,22]. Metaheuristic algorithms can be class into categories
like trajectory-based algorithms or population-based algorithms.
3.6 Nature-Inspired Computing
As the name suggests, it refers to a set of algorithms that are inspired by some natural
phenomena like the environment, science or animals. They tend to provide the guidelines for
solving many difficult computing problems. The heuristic guidelines used are often simple, and
the rules are usually inspired by natural phenomena or laws.
Broad Classification of Nature Inspired Computing: They can be grouped into three broad
classes: Physics-based algorithms (PBA), Chemistry-based algorithms (CBA) and
Biology-based algorithms (BBA) [23].
Fig. 3.2: Classification of nature inspired computing techniques [20]
The ACO solutions are based on a probabilistic state transition rule. Artificial ants can be
considered as stochastic greedy procedures to construct a solution in a probabilistic manner by
adding solution components to partial ones until a complete solution is derived. Pheromone
trails are used to save the characteristics of “good” generated solutions that are used as a guide
to construct new solutions by the ants. Heuristic knowledge gained with each iteration is used to
update the value of the pheromone. Also, problem-specific information is used as hints to ants
in their decisions to construct solutions.
Value of the pheromone is generally assigned as a constant value at the beginning of the
solution. The update of the pheromone is carried out using the generated solutions. Update rule
for the global pheromone is applied in two phases. One at the time of evaporation phase where
the pheromone trail decreases automatically. Each pheromone value is reduced by a fixed
proportion:
where ρ ∈]0,1] represents the reduction rate of the pheromone. Evaporation is key to ensuring
that all ants to not move to premature convergence toward “good” solutions. The second phase
is called the reinforcement phase where the pheromone trail is updated according to the
generated solutions. Three different strategies may be applied [35]:
1. The pheromone trail τijis update immediately after every step of the solution
construction, also known as step-by-step update [36].
2. Updating of the pheromone trail τij is done only after the complete solution has been
generated and is called online delayed updating of pheromones.
3. Updating of the pheromone trail τij is done only after complete solution is generated by
all the ants. It is the most popular of all the methods for updating pheromone:
4. The pheromone trail τij depends on the best solution provided by all the ants that are
involved in generating the solution.
5. Last strategy is based on ranking of k ants. Pheromone value is updated on the basis of
the solution provided by best k ants with an amount depending on the ranking of the
solutions.ACO scores over other optimization algorithms because of its convergence
properties. Theoretical convergence analysis of ACO algorithms is given in. The first
convergence results were presented in. Comprehensive survey of theoretical results for
ant colony optimization are given in.
What are challenges in front of the designer when it comes to implementing ACO for problems
like scheduling or other problems? The key issues in designing an ACO is determining the
following:
Pheromone information:
Central idea of ACO is based on pheromone model. Need to define the vector of model
parameters τ called pheromone trail parameters. The pheromone values τi ∈τ should reflect the
relevant information in the construction of the solution for a given problem.
Solution construction:
Pheromone alone cannot lead to the solution and there is a need to define the local heuristic for
guiding the search.
Pheromone update:
Mainly “the reinforcementlearning strategy for the pheromone information has to be defined.
The ant system (AS) was the first application of ACO in the domain of combinatorial
optimization used for solving the travelling salesman problem. ACO algorithms can also be
used to solve the continuous optimization problems. The main issue in adapting the ACO
metaheuristic for continuous optimization is to model a continuous nest neighborhood by a
discrete structure or change the pheromone model by a continuous one. It is easy to implement
ACO for combinatorial problems. For combinatorial problems, the pheromone trails are
associated with a finite set of values related to the decisions that the ants make. The same is not
possible for continuous optimization problems. ACO was first adapted for continuous
optimization in [37]. A shift from using a discrete probability distribution to a continuous one
has led to the extensive use of ACO for continuous optimization problems as well.
It is important to initialize the parameters of ACO algorithms Table below summarizes the key
parameters of a basic ACO algorithm. It is possible to adjust some of these dynamically. For
instance, α and β can be adjusted in a dynamic or an adaptive manner during the search. The
optimal values for the parameters α and β are very sensitive to the target problem. What is the
number of ants that will be used? It is not critical but depends on the problem in hand. For
instance, in cloud scheduling the number of ants cannot be more than the number of available
resources. In other words, the number of ants for the solution depends on the computational
capacity of the experiments.”
After ACO, Particle swarm optimization is also based on swarm intelligence. It is a popular
stochastic population-based metaheuristic. It mimics the social behaviour of organisms such as
birds and fishes in search of a place with enough food or position themselves against a target.
Coordinated behaviour for such swarms using local movements emerges without any central
control. In a sharp contrast to ACO, PSO was originally designed and implemented for
continuous optimization problems [38].
The first step in using PSO for solving discrete problems is to encode the problem. A particle in
the solution space can be best represented using a vector of size 1 * n, where n refers to the
number of tasks to be scheduled and value of the particle position for the vector represents the
resource index [50-57]. In simple words, this vector represents the mapping of all tasks on
available resources. other than single dimension vector, matrix can be also be used to represent
the encoding scheme, the size of the matrix is m * n, where m represents the available resources
to serve the tasks and n represents the number of tasks to be scheduled. The value for each cell
[ij] is [0,1], i.e, whether the task i has been assigned to the resource j or not. Other than
positions, velocity can also be represented using the matrix. Velocity refers to both the speed
and the direction. At each iteration, a particle moves from one position to another in the
decision space. Each solution is represented using vertex xi. A particle has its own position and
velocity, which means the flying direction and step of the particle (Fig. 3.6). The success of
some particles will influence the behavior of their peers. Each particle successively adjusts its
position xi on the basis of best position visited by itself (pbesti) or the whole swarm (gbest). The
vector (pg− xi) represents the difference between the current position of the particle i and the
best position of its neighbourhood [61].
Fig.3.6:Associated article positions using Particle swarm optimization. [60]
Definition of neighbourhood is must for each particle as it helps in influencing the position of
the peer particles. It is possible to define the neighbourhood of each particle using one the
following two methods:
gbest Method: Whole population of particles is used to define the neighborhood using the
global best method.
lbest Method: Topology is defined for the complete swarm in order to implement local
best method.In this topology, neighbourhood of a particle can be defined as the set of
particles that are in direct connection with it, or it is empty in case the articles are isolated.
Three vectors are used to represent a particle in PSO:
The position (current) for each particle in the search space is represented using x-vector.
The position (best) for each particle found by itself is represented using p-vector.
The direction in which the particle will move is represented using a v-vector.
Fitness for the x-vector is represented using the x-fitness records and fitness for the p-vector is
represented using the p-fitness records
PSO begins which random initialization of the particles and further they are updated in each
iteration by searching for optimal result based on some criteria or objective function. The
movement of each particle during iterations depend on the best solution found by itself or te
best value found by any other particle so far, i.e. pbest or gbest respectively.
When a particle takes part of the population as its topological neighbors, the best value is a local
best and is called lbest [61].After finding the two best values, the particle updates its velocity
and positions with following equation (a) and (b) [38].
Particles' velocities on each dimension are clamped to a maximum velocity Vmax. If the sum of
accelerations would cause the velocity on that dimension to exceed Vmax, which is a parameter
specified by the user. Then the velocity on that dimension is limited to Vmax [38].