SlideShare a Scribd company logo
1 of 17
SENIOR PROJECT
SRS ON
VEHICLE ROUTING PROBLEM
using Particle Swarm Optimization
Description: Capacitated VRP
• Objectives: Minimize the distance travelled by vehicles.
• We have in this problem, a depot and set of customers.
Conditions:
 Vehicles with limited and equal capacity.
 Each customer is to be visited exactly once.
 Each vehicle must start from depot and must return back to depot
Sample example of Problem: A Complete
Graph
Depot
1
4
5
6
2
3
Sample example of Solution:
The main focus of the project is to solve the capacitated VRP using
particle swarm optimization, and find an optimal route which is the
minimized distance.
Considering 2 vehicles:
Depot
1
6
2
5
3
4
Particle Swarm Optimization
• PSO is a population- based search method proposed by Kennedy
and Eberhart in 1995.
• The main motivation or focus here is on a group of birds. This
group of birds is termed as “Swarm”. Here each particle is
considered like a bird in the swarm.
• These particles are allowed to move around and explore the
search space
Finding Particles (Solution):
Particles(Swarm) move in a direction which is
guided by-
1. The particle’s own position and velocity
2. Distance from the individual particle’s best
known position. (Pbest)
3. Distance from the swarms best known
position. (Gbest).
Flowchart of PSO:
START
Initialize the population, Particles.
Find the personal best
Find the Global best
Update Velocity, Particle position
Evaluate Fitness
STOPPING
CONDITION
END
FALSE
TRUE
Equations and formulas
• Position matrix:
Initially:𝑷 𝒊, 𝒋 = 𝑿 𝒎𝒂𝒙 − 𝑿 𝒎𝒊𝒏 ∗ 𝒓𝒂𝒏𝒅 𝟏 + 𝑿 𝒎𝒊𝒏
For updating: 𝑷 𝒊, 𝒋 = 𝑷 𝒊, 𝒋 + 𝑽 𝒊, 𝒋
• Velocity matrix:
Initially:𝑽 𝒊, 𝒋 = 𝑽 𝒎𝒂𝒙 − 𝑽 𝒎𝒊𝒏 ∗ 𝒓𝒂𝒏𝒅 𝟐 + 𝑿 𝒎𝒊𝒏
For updating: 𝑽 𝒊, 𝒋 = 𝒘 ∗ 𝑽 𝒊, 𝒋 + 𝑪 𝟏 ∗ 𝒓 ∗ 𝑷𝒃(𝒊, 𝒋) – 𝒑(𝒊, 𝒋) + 𝑪 𝟐 ∗ 𝒓 ∗ (𝑮𝒃(𝒊) – 𝑷(𝒊, 𝒋))
Where, i:particle,j:population;
Xmax=1,Xmin=-1; rand is random number between 0 and 1
Vmax=1,Vmin=-1,
pb: the best position values for each particle searched so far,
gb:the best particle’s searched among pb;
W =inertia constant
C1=Cognitive acceleration constant
C2=Social acceleration constant
Proposed Solution of VRP using PSO
Let us consider that there are 10 customers, with some demand and their distance from
depot and from each other is given, we have ‘4’ identical vehicles with capacity 200.
CUSTOMER DEMAND Coordinates( Distance
from depot)
Depot -
1 20 1
2 70 3
3 50 5
4 80 7
5 100 3
6 30 4
7 10 2
8 40 10
9 20 6
10 60 3
Distance Matrix: distance between customers
and from depot.
0 1 2 3 4 5 6 7 8 9 10
0 0 1 3 5 7 3 4 2 10 6 3
1 1 0 6 4 3 6 5 4 3 2 5
2 3 6 0 5 10 8 6 2 1 4 3
3 5 4 5 0 4 6 1 3 8 4 7
4 7 3 10 4 0 2 4 6 8 4 5
5 3 6 8 6 2 0 5 9 2 8 6
6 4 5 6 1 4 5 0 4 3 7 8
7 2 4 2 3 6 9 4 0 2 4 9
8 10 3 1 8 8 2 3 2 0 8 3
9 6 2 4 4 4 8 7 4 8 0 7
10 3 5 7 7 5 6 8 9 3 7 0
Calculation of position matrix:
• For particle 1-
• P[1,1] represent the initial position value of 1st
customer
• P[1,2] represent the initial position value of 2st
customer and so on till the last customer i.e. 10th
customer.
• 𝑷 𝟏, 𝟏 = 𝑿 𝒎𝒂𝒙 − 𝑿 𝒎𝒊𝒏 ∗ 𝒓𝒂𝒏𝒅 𝟏 +
𝑿 𝒎𝒊𝒏
• 𝑷 𝟏, 𝟏 = 𝟏 − −𝟏 ∗ 𝟎. 𝟓𝟐 + −𝟏 =
𝟎. 𝟎𝟒
• Similarly,
• 𝑷 𝟏, 𝟐 = 𝟏 − −𝟏 ∗ 𝟎. 𝟑𝟏 + −𝟏 = −𝟎. 𝟑𝟖
• 𝑷 𝟏, 𝟑 = 𝟏 − −𝟏 ∗ 𝟎. 𝟖𝟒 + −𝟏 = 𝟎. 𝟔𝟖
• 𝑷 𝟏, 𝟒 = 𝟏 − −𝟏 ∗ 𝟎. 𝟒𝟐 + −𝟏 = −𝟎. 𝟏𝟔
• 𝑷 𝟏, 𝟓 = 𝟏 − −𝟏 ∗ 𝟎. 𝟗𝟏 + −𝟏 = 𝟎. 𝟖𝟐
• 𝑷 𝟏, 𝟔 = 𝟏 − −𝟏 ∗ 𝟎. 𝟓𝟎 + −𝟏 = 𝟎. 𝟎𝟎
• 𝑷 𝟏, 𝟕 = 𝟏 − −𝟏 ∗ 𝟎. 𝟑𝟕 + −𝟏 = −𝟎. 𝟐𝟔
• 𝑷 𝟏, 𝟖 = 𝟏 − −𝟏 ∗ 𝟎. 𝟔𝟒 + −𝟏 = 𝟎. 𝟐𝟖
• 𝑷 𝟏, 𝟗 = 𝟏 − −𝟏 ∗ 𝟎. 𝟗𝟕 + −𝟏 = 𝟎. 𝟗𝟒
• 𝑷 𝟏, 𝟏𝟎 = 𝟏 − −𝟏 ∗ 𝟎. 𝟖𝟖 + −𝟏 = 𝟎. 𝟕𝟔
Calculation of Velocity matrix:
• 𝑽 𝒊, 𝒋 = 𝑽 𝒎𝒂𝒙 − 𝑽 𝒎𝒊𝒏 ∗ 𝒓𝒂𝒏𝒅 𝟐 + 𝑽 𝒎𝒊𝒏
• Velocity vector is used for updating position vector as it is rate of change of the position.
• 𝑽 𝟏, 𝟏 = 𝟏 − (−𝟏) ∗ 𝟎. 𝟐𝟒 + −𝟏 = −𝟎. 𝟓𝟐
• 𝑽 𝟏, 𝟐 = 𝟏 − (−𝟏) ∗ 𝟎. 𝟓𝟗 + −𝟏 = 𝟎. 𝟏𝟖
• 𝑽 𝟏, 𝟑 = 𝟏 − (−𝟏) ∗ 𝟎. 𝟒𝟐 + −𝟏 = −𝟎. 𝟏𝟔
• 𝑽 𝟏, 𝟒 = 𝟏 − (−𝟏) ∗ 𝟎. 𝟏𝟏 + −𝟏 = −𝟎. 𝟕𝟖
• 𝑽 𝟏, 𝟓 = 𝟏 − (−𝟏) ∗ 𝟎. 𝟗𝟗 + −𝟏 = 𝟎. 𝟗𝟖
• 𝑽 𝟏, 𝟔 = 𝟏 − (−𝟏) ∗ 𝟎. 𝟕𝟒 + −𝟏 = 𝟎. 𝟒𝟖
• 𝑽 𝟏, 𝟕 = 𝟏 − (−𝟏) ∗ 𝟎. 𝟔𝟎 + −𝟏 = 𝟎. 𝟐
• 𝑽 𝟏, 𝟖 = 𝟏 − (−𝟏) ∗ 𝟎. 𝟒𝟗 + −𝟏 = −𝟎. 𝟎𝟐
• 𝑽 𝟏, 𝟗 = 𝟏 − (−𝟏) ∗ 𝟎. 𝟎𝟖 + −𝟏 = −𝟎. 𝟖𝟒
• 𝑽 𝟏, 𝟏𝟎 = 𝟏 − (−𝟏) ∗ 𝟎. 𝟐𝟒 + −𝟏 = −𝟎. 𝟓𝟐
Position matrix: here, P[min]=-0.38 & P[max]=0.94
0.04 -0.38 0.68 -0.16 0.82 0.00 -0.26 0.28 0.94 0.76
-0.52 0.18 -0.16 -0.78 0.98 0.48 0.20 -0.02 -0.84 -0.52
Velocity matrix:
Encoding Scheme:
Particle-Vehicle Mapping
 Calculation of γ : For dividing the Range into equal interval we will use γ, and it is calculated using the below
formula:
γ = (Pmax - Pmin)/ no. of vehicles
γ = (0.94+0.38/4)
γ = 0.33
 Calculation of Interval Ranges: Since we are considering 4 vehicles , interval ranges are 4.
[Pmin,Pmin+γ],[Pmin+γ,Pmin+2γ),[Pmin+2γ,Pmin+3γ),[Pmin+4γ]
[-0.38,-0.05),[-0.05,0.28),[0.28,0.61),(0.61,0.94]
Mapping
-0.38 -0.05 0.28 0.61 0.94
2 7 4 6 1
3 10 5 98
 1st Vehicle will serve Customers 2,7,4.
 2nd Vehicle will serve Customers 6,1.
 3rd Vehicle will Customer 8.
 4th Vehicle will serve Customers 3,10,5,9.
Calculation of fitness value (Distance)
2 7 4 6 1 8 3 10 5 9
Vehicle 1 Vehicle 2 Vehicle 4Vehicle 3
1. Distance travelled by vehicle 1= d(0,2)+d(2,7)+d(7,4)+d(4,0)=3+2+6+7=18
2. Distance travelled by vehicle 2= d(0,6)+d(6,1)+d(1,0)=4+5+1=10
3. Distance travelled by vehicle 3= d(0,6)+d(8,0)=4+10=14
4. Distance travelled by vehicle 4=
d(0,3)+d(3,10)+d(10,5)+d(5,9)+d(9,0)=5+7+6+8+6=32
• FitnessValue1=D1=18+10+14+32=74
• This way we will evaluate fitness value every time till the
condition is false and loop terminates.
• Fitness value (minimized distance ) calculated in the end is the
potential solution to the problem .
Thank you.

More Related Content

What's hot

Particle swarm optimization
Particle swarm optimization Particle swarm optimization
Particle swarm optimization Ahmed Fouad Ali
 
Ant colony optimization
Ant colony optimizationAnt colony optimization
Ant colony optimizationUnnitaDas
 
Ant colony optimization
Ant colony optimizationAnt colony optimization
Ant colony optimizationAbdul Rahman
 
Ant Colony Optimization - ACO
Ant Colony Optimization - ACOAnt Colony Optimization - ACO
Ant Colony Optimization - ACOMohamed Talaat
 
Classification with ant colony optimization
Classification with ant colony optimizationClassification with ant colony optimization
Classification with ant colony optimizationkamalikanath89
 
Introducing Zap Q-Learning
Introducing Zap Q-Learning   Introducing Zap Q-Learning
Introducing Zap Q-Learning Sean Meyn
 
Particle Swarm optimization
Particle Swarm optimizationParticle Swarm optimization
Particle Swarm optimizationmidhulavijayan
 
Optimization by Ant Colony Method
Optimization by Ant Colony MethodOptimization by Ant Colony Method
Optimization by Ant Colony MethodUday Wankar
 
Travelling salesman problem
Travelling salesman problemTravelling salesman problem
Travelling salesman problemhamza haseeb
 
Particle swarm optimization
Particle swarm optimizationParticle swarm optimization
Particle swarm optimizationanurag singh
 
Ant Colony Optimization
Ant Colony OptimizationAnt Colony Optimization
Ant Colony OptimizationOmid Edriss
 
Travelling and salesman problem using ant colony optimization
Travelling and salesman problem using ant colony optimizationTravelling and salesman problem using ant colony optimization
Travelling and salesman problem using ant colony optimizationAkash Sethiya
 
Particle Swarm Optimization: The Algorithm and Its Applications
Particle Swarm Optimization: The Algorithm and Its ApplicationsParticle Swarm Optimization: The Algorithm and Its Applications
Particle Swarm Optimization: The Algorithm and Its Applicationsadil raja
 
6 games
6 games6 games
6 gamesMhd Sb
 

What's hot (20)

Particle swarm optimization
Particle swarm optimization Particle swarm optimization
Particle swarm optimization
 
Ant colony optimization
Ant colony optimizationAnt colony optimization
Ant colony optimization
 
Traveling Salesman Problem
Traveling Salesman Problem Traveling Salesman Problem
Traveling Salesman Problem
 
Ant colony optimization
Ant colony optimizationAnt colony optimization
Ant colony optimization
 
Ant Colony Optimization - ACO
Ant Colony Optimization - ACOAnt Colony Optimization - ACO
Ant Colony Optimization - ACO
 
Classification with ant colony optimization
Classification with ant colony optimizationClassification with ant colony optimization
Classification with ant colony optimization
 
Ant colony optimization
Ant colony optimizationAnt colony optimization
Ant colony optimization
 
Introducing Zap Q-Learning
Introducing Zap Q-Learning   Introducing Zap Q-Learning
Introducing Zap Q-Learning
 
Particle Swarm optimization
Particle Swarm optimizationParticle Swarm optimization
Particle Swarm optimization
 
Optimization by Ant Colony Method
Optimization by Ant Colony MethodOptimization by Ant Colony Method
Optimization by Ant Colony Method
 
Travelling salesman problem
Travelling salesman problemTravelling salesman problem
Travelling salesman problem
 
Ant colony Optimization
Ant colony OptimizationAnt colony Optimization
Ant colony Optimization
 
Ant colony optimization
Ant colony optimizationAnt colony optimization
Ant colony optimization
 
Particle swarm optimization
Particle swarm optimizationParticle swarm optimization
Particle swarm optimization
 
Ant Colony Optimization
Ant Colony OptimizationAnt Colony Optimization
Ant Colony Optimization
 
Travelling and salesman problem using ant colony optimization
Travelling and salesman problem using ant colony optimizationTravelling and salesman problem using ant colony optimization
Travelling and salesman problem using ant colony optimization
 
A* Algorithm
A* AlgorithmA* Algorithm
A* Algorithm
 
Greedy algorithm
Greedy algorithmGreedy algorithm
Greedy algorithm
 
Particle Swarm Optimization: The Algorithm and Its Applications
Particle Swarm Optimization: The Algorithm and Its ApplicationsParticle Swarm Optimization: The Algorithm and Its Applications
Particle Swarm Optimization: The Algorithm and Its Applications
 
6 games
6 games6 games
6 games
 

Similar to VRP PSO

Optimum engineering design - Day 5. Clasical optimization methods
Optimum engineering design - Day 5. Clasical optimization methodsOptimum engineering design - Day 5. Clasical optimization methods
Optimum engineering design - Day 5. Clasical optimization methodsSantiagoGarridoBulln
 
Kalman filter for Beginners
Kalman filter for BeginnersKalman filter for Beginners
Kalman filter for Beginnerswinfred lu
 
Paper study: Attention, learn to solve routing problems!
Paper study: Attention, learn to solve routing problems!Paper study: Attention, learn to solve routing problems!
Paper study: Attention, learn to solve routing problems!ChenYiHuang5
 
Unit-1 Basic Concept of Algorithm.pptx
Unit-1 Basic Concept of Algorithm.pptxUnit-1 Basic Concept of Algorithm.pptx
Unit-1 Basic Concept of Algorithm.pptxssuser01e301
 
Paper Study: Melding the data decision pipeline
Paper Study: Melding the data decision pipelinePaper Study: Melding the data decision pipeline
Paper Study: Melding the data decision pipelineChenYiHuang5
 
10_support_vector_machines (1).pptx
10_support_vector_machines (1).pptx10_support_vector_machines (1).pptx
10_support_vector_machines (1).pptxshyedshahriar
 
Reinforcement Learning basics part1
Reinforcement Learning basics part1Reinforcement Learning basics part1
Reinforcement Learning basics part1Euijin Jeong
 
Application of particle swarm optimization in 3 dimensional travelling salesm...
Application of particle swarm optimization in 3 dimensional travelling salesm...Application of particle swarm optimization in 3 dimensional travelling salesm...
Application of particle swarm optimization in 3 dimensional travelling salesm...Maad M. Mijwil
 
Support vector machines
Support vector machinesSupport vector machines
Support vector machinesJinho Lee
 
A Dynamic Logistic Dispatching System With Set-Based Particle Swarm Optimization
A Dynamic Logistic Dispatching System With Set-Based Particle Swarm OptimizationA Dynamic Logistic Dispatching System With Set-Based Particle Swarm Optimization
A Dynamic Logistic Dispatching System With Set-Based Particle Swarm OptimizationRajib Roy
 
Tavas and pashmaks
Tavas and pashmaksTavas and pashmaks
Tavas and pashmaksminsu kim
 
Orbital_Simulation (2).pptx
Orbital_Simulation (2).pptxOrbital_Simulation (2).pptx
Orbital_Simulation (2).pptxMSPrasad7
 
Optimum engineering design - Day 6. Classical optimization methods
Optimum engineering design - Day 6. Classical optimization methodsOptimum engineering design - Day 6. Classical optimization methods
Optimum engineering design - Day 6. Classical optimization methodsSantiagoGarridoBulln
 
Mathematical Understanding in Traffic Flow Modelling
Mathematical Understanding in Traffic Flow ModellingMathematical Understanding in Traffic Flow Modelling
Mathematical Understanding in Traffic Flow ModellingNikhil Chandra Sarkar
 
Introduction of Quantum Annealing and D-Wave Machines
Introduction of Quantum Annealing and D-Wave MachinesIntroduction of Quantum Annealing and D-Wave Machines
Introduction of Quantum Annealing and D-Wave MachinesArithmer Inc.
 
Displacement and weight of Ship
Displacement and weight of ShipDisplacement and weight of Ship
Displacement and weight of ShipAhmed Taha
 
Time series Modelling Basics
Time series Modelling BasicsTime series Modelling Basics
Time series Modelling BasicsAshutosh Kumar
 
Homework 1 Solution.pptx
Homework 1 Solution.pptxHomework 1 Solution.pptx
Homework 1 Solution.pptxiksanbukhori
 
Pricing optimization poster version 2 (1)
Pricing optimization poster version 2 (1)Pricing optimization poster version 2 (1)
Pricing optimization poster version 2 (1)Alex Potocki
 
Sampling method : MCMC
Sampling method : MCMCSampling method : MCMC
Sampling method : MCMCSEMINARGROOT
 

Similar to VRP PSO (20)

Optimum engineering design - Day 5. Clasical optimization methods
Optimum engineering design - Day 5. Clasical optimization methodsOptimum engineering design - Day 5. Clasical optimization methods
Optimum engineering design - Day 5. Clasical optimization methods
 
Kalman filter for Beginners
Kalman filter for BeginnersKalman filter for Beginners
Kalman filter for Beginners
 
Paper study: Attention, learn to solve routing problems!
Paper study: Attention, learn to solve routing problems!Paper study: Attention, learn to solve routing problems!
Paper study: Attention, learn to solve routing problems!
 
Unit-1 Basic Concept of Algorithm.pptx
Unit-1 Basic Concept of Algorithm.pptxUnit-1 Basic Concept of Algorithm.pptx
Unit-1 Basic Concept of Algorithm.pptx
 
Paper Study: Melding the data decision pipeline
Paper Study: Melding the data decision pipelinePaper Study: Melding the data decision pipeline
Paper Study: Melding the data decision pipeline
 
10_support_vector_machines (1).pptx
10_support_vector_machines (1).pptx10_support_vector_machines (1).pptx
10_support_vector_machines (1).pptx
 
Reinforcement Learning basics part1
Reinforcement Learning basics part1Reinforcement Learning basics part1
Reinforcement Learning basics part1
 
Application of particle swarm optimization in 3 dimensional travelling salesm...
Application of particle swarm optimization in 3 dimensional travelling salesm...Application of particle swarm optimization in 3 dimensional travelling salesm...
Application of particle swarm optimization in 3 dimensional travelling salesm...
 
Support vector machines
Support vector machinesSupport vector machines
Support vector machines
 
A Dynamic Logistic Dispatching System With Set-Based Particle Swarm Optimization
A Dynamic Logistic Dispatching System With Set-Based Particle Swarm OptimizationA Dynamic Logistic Dispatching System With Set-Based Particle Swarm Optimization
A Dynamic Logistic Dispatching System With Set-Based Particle Swarm Optimization
 
Tavas and pashmaks
Tavas and pashmaksTavas and pashmaks
Tavas and pashmaks
 
Orbital_Simulation (2).pptx
Orbital_Simulation (2).pptxOrbital_Simulation (2).pptx
Orbital_Simulation (2).pptx
 
Optimum engineering design - Day 6. Classical optimization methods
Optimum engineering design - Day 6. Classical optimization methodsOptimum engineering design - Day 6. Classical optimization methods
Optimum engineering design - Day 6. Classical optimization methods
 
Mathematical Understanding in Traffic Flow Modelling
Mathematical Understanding in Traffic Flow ModellingMathematical Understanding in Traffic Flow Modelling
Mathematical Understanding in Traffic Flow Modelling
 
Introduction of Quantum Annealing and D-Wave Machines
Introduction of Quantum Annealing and D-Wave MachinesIntroduction of Quantum Annealing and D-Wave Machines
Introduction of Quantum Annealing and D-Wave Machines
 
Displacement and weight of Ship
Displacement and weight of ShipDisplacement and weight of Ship
Displacement and weight of Ship
 
Time series Modelling Basics
Time series Modelling BasicsTime series Modelling Basics
Time series Modelling Basics
 
Homework 1 Solution.pptx
Homework 1 Solution.pptxHomework 1 Solution.pptx
Homework 1 Solution.pptx
 
Pricing optimization poster version 2 (1)
Pricing optimization poster version 2 (1)Pricing optimization poster version 2 (1)
Pricing optimization poster version 2 (1)
 
Sampling method : MCMC
Sampling method : MCMCSampling method : MCMC
Sampling method : MCMC
 

Recently uploaded

microprocessor 8085 and its interfacing
microprocessor 8085  and its interfacingmicroprocessor 8085  and its interfacing
microprocessor 8085 and its interfacingjaychoudhary37
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort servicejennyeacort
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLDeelipZope
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx959SahilShah
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSCAESB
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...srsj9000
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝soniya singh
 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2RajaP95
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxbritheesh05
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 

Recently uploaded (20)

microprocessor 8085 and its interfacing
microprocessor 8085  and its interfacingmicroprocessor 8085  and its interfacing
microprocessor 8085 and its interfacing
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCL
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentation
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptx
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 

VRP PSO

  • 1. SENIOR PROJECT SRS ON VEHICLE ROUTING PROBLEM using Particle Swarm Optimization
  • 2. Description: Capacitated VRP • Objectives: Minimize the distance travelled by vehicles. • We have in this problem, a depot and set of customers. Conditions:  Vehicles with limited and equal capacity.  Each customer is to be visited exactly once.  Each vehicle must start from depot and must return back to depot
  • 3. Sample example of Problem: A Complete Graph Depot 1 4 5 6 2 3
  • 4. Sample example of Solution: The main focus of the project is to solve the capacitated VRP using particle swarm optimization, and find an optimal route which is the minimized distance. Considering 2 vehicles: Depot 1 6 2 5 3 4
  • 5. Particle Swarm Optimization • PSO is a population- based search method proposed by Kennedy and Eberhart in 1995. • The main motivation or focus here is on a group of birds. This group of birds is termed as “Swarm”. Here each particle is considered like a bird in the swarm. • These particles are allowed to move around and explore the search space
  • 6. Finding Particles (Solution): Particles(Swarm) move in a direction which is guided by- 1. The particle’s own position and velocity 2. Distance from the individual particle’s best known position. (Pbest) 3. Distance from the swarms best known position. (Gbest).
  • 7. Flowchart of PSO: START Initialize the population, Particles. Find the personal best Find the Global best Update Velocity, Particle position Evaluate Fitness STOPPING CONDITION END FALSE TRUE
  • 8. Equations and formulas • Position matrix: Initially:𝑷 𝒊, 𝒋 = 𝑿 𝒎𝒂𝒙 − 𝑿 𝒎𝒊𝒏 ∗ 𝒓𝒂𝒏𝒅 𝟏 + 𝑿 𝒎𝒊𝒏 For updating: 𝑷 𝒊, 𝒋 = 𝑷 𝒊, 𝒋 + 𝑽 𝒊, 𝒋 • Velocity matrix: Initially:𝑽 𝒊, 𝒋 = 𝑽 𝒎𝒂𝒙 − 𝑽 𝒎𝒊𝒏 ∗ 𝒓𝒂𝒏𝒅 𝟐 + 𝑿 𝒎𝒊𝒏 For updating: 𝑽 𝒊, 𝒋 = 𝒘 ∗ 𝑽 𝒊, 𝒋 + 𝑪 𝟏 ∗ 𝒓 ∗ 𝑷𝒃(𝒊, 𝒋) – 𝒑(𝒊, 𝒋) + 𝑪 𝟐 ∗ 𝒓 ∗ (𝑮𝒃(𝒊) – 𝑷(𝒊, 𝒋)) Where, i:particle,j:population; Xmax=1,Xmin=-1; rand is random number between 0 and 1 Vmax=1,Vmin=-1, pb: the best position values for each particle searched so far, gb:the best particle’s searched among pb; W =inertia constant C1=Cognitive acceleration constant C2=Social acceleration constant
  • 9. Proposed Solution of VRP using PSO Let us consider that there are 10 customers, with some demand and their distance from depot and from each other is given, we have ‘4’ identical vehicles with capacity 200. CUSTOMER DEMAND Coordinates( Distance from depot) Depot - 1 20 1 2 70 3 3 50 5 4 80 7 5 100 3 6 30 4 7 10 2 8 40 10 9 20 6 10 60 3
  • 10. Distance Matrix: distance between customers and from depot. 0 1 2 3 4 5 6 7 8 9 10 0 0 1 3 5 7 3 4 2 10 6 3 1 1 0 6 4 3 6 5 4 3 2 5 2 3 6 0 5 10 8 6 2 1 4 3 3 5 4 5 0 4 6 1 3 8 4 7 4 7 3 10 4 0 2 4 6 8 4 5 5 3 6 8 6 2 0 5 9 2 8 6 6 4 5 6 1 4 5 0 4 3 7 8 7 2 4 2 3 6 9 4 0 2 4 9 8 10 3 1 8 8 2 3 2 0 8 3 9 6 2 4 4 4 8 7 4 8 0 7 10 3 5 7 7 5 6 8 9 3 7 0
  • 11. Calculation of position matrix: • For particle 1- • P[1,1] represent the initial position value of 1st customer • P[1,2] represent the initial position value of 2st customer and so on till the last customer i.e. 10th customer. • 𝑷 𝟏, 𝟏 = 𝑿 𝒎𝒂𝒙 − 𝑿 𝒎𝒊𝒏 ∗ 𝒓𝒂𝒏𝒅 𝟏 + 𝑿 𝒎𝒊𝒏 • 𝑷 𝟏, 𝟏 = 𝟏 − −𝟏 ∗ 𝟎. 𝟓𝟐 + −𝟏 = 𝟎. 𝟎𝟒 • Similarly, • 𝑷 𝟏, 𝟐 = 𝟏 − −𝟏 ∗ 𝟎. 𝟑𝟏 + −𝟏 = −𝟎. 𝟑𝟖 • 𝑷 𝟏, 𝟑 = 𝟏 − −𝟏 ∗ 𝟎. 𝟖𝟒 + −𝟏 = 𝟎. 𝟔𝟖 • 𝑷 𝟏, 𝟒 = 𝟏 − −𝟏 ∗ 𝟎. 𝟒𝟐 + −𝟏 = −𝟎. 𝟏𝟔 • 𝑷 𝟏, 𝟓 = 𝟏 − −𝟏 ∗ 𝟎. 𝟗𝟏 + −𝟏 = 𝟎. 𝟖𝟐 • 𝑷 𝟏, 𝟔 = 𝟏 − −𝟏 ∗ 𝟎. 𝟓𝟎 + −𝟏 = 𝟎. 𝟎𝟎 • 𝑷 𝟏, 𝟕 = 𝟏 − −𝟏 ∗ 𝟎. 𝟑𝟕 + −𝟏 = −𝟎. 𝟐𝟔 • 𝑷 𝟏, 𝟖 = 𝟏 − −𝟏 ∗ 𝟎. 𝟔𝟒 + −𝟏 = 𝟎. 𝟐𝟖 • 𝑷 𝟏, 𝟗 = 𝟏 − −𝟏 ∗ 𝟎. 𝟗𝟕 + −𝟏 = 𝟎. 𝟗𝟒 • 𝑷 𝟏, 𝟏𝟎 = 𝟏 − −𝟏 ∗ 𝟎. 𝟖𝟖 + −𝟏 = 𝟎. 𝟕𝟔
  • 12. Calculation of Velocity matrix: • 𝑽 𝒊, 𝒋 = 𝑽 𝒎𝒂𝒙 − 𝑽 𝒎𝒊𝒏 ∗ 𝒓𝒂𝒏𝒅 𝟐 + 𝑽 𝒎𝒊𝒏 • Velocity vector is used for updating position vector as it is rate of change of the position. • 𝑽 𝟏, 𝟏 = 𝟏 − (−𝟏) ∗ 𝟎. 𝟐𝟒 + −𝟏 = −𝟎. 𝟓𝟐 • 𝑽 𝟏, 𝟐 = 𝟏 − (−𝟏) ∗ 𝟎. 𝟓𝟗 + −𝟏 = 𝟎. 𝟏𝟖 • 𝑽 𝟏, 𝟑 = 𝟏 − (−𝟏) ∗ 𝟎. 𝟒𝟐 + −𝟏 = −𝟎. 𝟏𝟔 • 𝑽 𝟏, 𝟒 = 𝟏 − (−𝟏) ∗ 𝟎. 𝟏𝟏 + −𝟏 = −𝟎. 𝟕𝟖 • 𝑽 𝟏, 𝟓 = 𝟏 − (−𝟏) ∗ 𝟎. 𝟗𝟗 + −𝟏 = 𝟎. 𝟗𝟖 • 𝑽 𝟏, 𝟔 = 𝟏 − (−𝟏) ∗ 𝟎. 𝟕𝟒 + −𝟏 = 𝟎. 𝟒𝟖 • 𝑽 𝟏, 𝟕 = 𝟏 − (−𝟏) ∗ 𝟎. 𝟔𝟎 + −𝟏 = 𝟎. 𝟐 • 𝑽 𝟏, 𝟖 = 𝟏 − (−𝟏) ∗ 𝟎. 𝟒𝟗 + −𝟏 = −𝟎. 𝟎𝟐 • 𝑽 𝟏, 𝟗 = 𝟏 − (−𝟏) ∗ 𝟎. 𝟎𝟖 + −𝟏 = −𝟎. 𝟖𝟒 • 𝑽 𝟏, 𝟏𝟎 = 𝟏 − (−𝟏) ∗ 𝟎. 𝟐𝟒 + −𝟏 = −𝟎. 𝟓𝟐 Position matrix: here, P[min]=-0.38 & P[max]=0.94 0.04 -0.38 0.68 -0.16 0.82 0.00 -0.26 0.28 0.94 0.76 -0.52 0.18 -0.16 -0.78 0.98 0.48 0.20 -0.02 -0.84 -0.52 Velocity matrix:
  • 13. Encoding Scheme: Particle-Vehicle Mapping  Calculation of γ : For dividing the Range into equal interval we will use γ, and it is calculated using the below formula: γ = (Pmax - Pmin)/ no. of vehicles γ = (0.94+0.38/4) γ = 0.33  Calculation of Interval Ranges: Since we are considering 4 vehicles , interval ranges are 4. [Pmin,Pmin+γ],[Pmin+γ,Pmin+2γ),[Pmin+2γ,Pmin+3γ),[Pmin+4γ] [-0.38,-0.05),[-0.05,0.28),[0.28,0.61),(0.61,0.94]
  • 14. Mapping -0.38 -0.05 0.28 0.61 0.94 2 7 4 6 1 3 10 5 98  1st Vehicle will serve Customers 2,7,4.  2nd Vehicle will serve Customers 6,1.  3rd Vehicle will Customer 8.  4th Vehicle will serve Customers 3,10,5,9.
  • 15. Calculation of fitness value (Distance) 2 7 4 6 1 8 3 10 5 9 Vehicle 1 Vehicle 2 Vehicle 4Vehicle 3 1. Distance travelled by vehicle 1= d(0,2)+d(2,7)+d(7,4)+d(4,0)=3+2+6+7=18 2. Distance travelled by vehicle 2= d(0,6)+d(6,1)+d(1,0)=4+5+1=10 3. Distance travelled by vehicle 3= d(0,6)+d(8,0)=4+10=14 4. Distance travelled by vehicle 4= d(0,3)+d(3,10)+d(10,5)+d(5,9)+d(9,0)=5+7+6+8+6=32
  • 16. • FitnessValue1=D1=18+10+14+32=74 • This way we will evaluate fitness value every time till the condition is false and loop terminates. • Fitness value (minimized distance ) calculated in the end is the potential solution to the problem .