0% found this document useful (0 votes)
57 views5 pages

Title: Overview:: Ai Lab Mini Project

The document describes a student mini project using Ant Colony Optimization (ACO) to solve the Travelling Salesman Problem (TSP). ACO is a genetic algorithm inspired by how ants find the shortest path between their colony and food sources. The project will model artificial ants that incrementally build solutions to the TSP by moving on a weighted graph representing cities and distances, with paths between cities strengthened by simulated pheromone trails. The ACO algorithm parameters and steps are explained, including initializing ants and pheromone trails, moving ants probabilistically along stronger paths, updating pheromone trails, and finding the optimal shortest path solution.

Uploaded by

MAYURI PAWAR
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
57 views5 pages

Title: Overview:: Ai Lab Mini Project

The document describes a student mini project using Ant Colony Optimization (ACO) to solve the Travelling Salesman Problem (TSP). ACO is a genetic algorithm inspired by how ants find the shortest path between their colony and food sources. The project will model artificial ants that incrementally build solutions to the TSP by moving on a weighted graph representing cities and distances, with paths between cities strengthened by simulated pheromone trails. The ACO algorithm parameters and steps are explained, including initializing ants and pheromone trails, moving ants probabilistically along stronger paths, updating pheromone trails, and finding the optimal shortest path solution.

Uploaded by

MAYURI PAWAR
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

ROLL NO: 201071026

NAME: MAYURI PAWAR

AI LAB
MINI PROJECT
TITLE: Travelling salesman problem using Ant Colony Optimization algorithm.
OVERVIEW: Given a set of cities and distances between every pair of cities,
the problem is to find the shortest possible route that visits every city exactly
once and returns to the starting point. We solve this using ant colony
optimization. In ACO, a set of software agents called artificial ants search for
good solutions to a given optimization problem. To apply ACO, the
optimization problem is transformed into the problem of finding the best path
on a weighted graph. The artificial ants (hereafter ants) incrementally build
solutions by moving on the graph. The solution construction process is
stochastic and is biased by a pheromone model, that is, a set of parameters
associated with graph components (either nodes or edges) whose values are
modified at runtime by the ants.

DESCRIPTION:
ACO is a genetic algorithm inspired by an ant’s natural behavior. To fully
understand the ACO algorithm, we need to get familiar with its basic concepts:
 ants use pheromones to find the shortest path between home and food
source
 pheromones evaporate quickly
 ants prefer to use shorter paths with denser pheromone
Let's show a simple example of ACO used in the Traveling Salesman Problem.
In the following case, we need to find the shortest path between all nodes in
the graph:
Following by natural behaviors, ants will start to explore new paths during the
exploration. Stronger blue color indicates the paths that are used more often
than the others, whereas green color indicates the current shortest path that is
found:
As a result, we'll achieve the shortest path between all nodes:

The nice GUI-based tool for ACO testing can be found here.

ACO Parameters
Let's discuss the main parameters for the ACO algorithm, declared in
the AntColonyOptimization class:
Parameter c indicates the original number of trails, at the start of the
simulation. Furthermore, alpha controls the pheromone importance,
while beta controls the distance priority. In general, the beta parameter
should be greater than alpha for the best results.
Next, the evaporation variable shows the percent how much the pheromone is
evaporating in every iteration, whereas Q  provides information about the total
amount of pheromone left on the trail by each Ant, and antFactor tells us how
many ants we'll use per city.
Finally, we need to have a little bit of randomness in our simulations, and this
is covered by randomFactor.
Create Ants
Each Ant will be able to visit a specific city, remember all visited cities, and
keep track of the trail length.

Setup Ants
At the very beginning, we need to initialize our ACO code implementation by
providing trails and ants matrices.

Move Ants
Let's start with the moveAnts() method. We need to choose the next city for
all ants, remembering that each ant tries to follow other ants' trails
The most important part is to properly select next city to visit. We should
select the next town based on the probability logic. First, we can check
if Ant should visit a random city.
If we didn't select any random city, we need to calculate probabilities to select
the next city, remembering that ants prefer to follow stronger and shorter
trails. We can do this by storing the probability of moving to each city in the
array.
After we calculate probabilities, we can decide to which city to go to by using.

Update Trails
In this step, we should update trails and the left pheromone.

Update the Best Solution


This is the last step of each iteration. We need to update the best solution in
order to keep the reference to it.
EXPECTED OUTCOME:
ACO solves the TSP problem by giving the optimal solution i.e. a shortest path
with minimum cost and shortest time that visits all the nodes once.

You might also like