SlideShare a Scribd company logo
2
Most read
AssignmentNo.1
Findthe Shortesttourfrom the followinggraphusingACO-TSP(antColonyOptimization-Travelling
SalesmanProblem) wherethe graphrepresentsasetof nodesanddistance betweeneverypairof
nodes.The shortestpossibleroute mustvisit everynode exactlyonce andreturntothe startingpoint.
(Assume startnode is1)
Solution:
Steps:
1. Considernode1asthe startingand endingpoint.
2. Generate all (n-1)!Permutationsof nodes.
3. Calculate costof everypermutationandkeeptrackof minimum costpermutation.
4. Returnthe permutationwithminimumcost.
Sl No. Permutations Corresponding cost
1 1-2-3-4-1 95(10+35+30+20)
2 1-2-4-3-1 80(10+25+30+15)
3 1-3-2-4-1 95(15+35+25+20)
4 1-3-4-2-1 80(15+30+25+10)
5 1-4-3-2-1 95(20+30+35+10)
6 1-4-2-3-1 95(20+25+35+15)
Weightage Matrix:
1 2 3 4
1 0 10 15 20
2 10 0 35 25
3 15 35 0 30
4 20 25 30 0
Let usassume,start node 1, considerasS
Iteration
No.
Cost function Evaluation Cost Path
1 C(4,S) D(4,1) 20 1-4
C(3,S) D(3,1) 15 1-3
C(2,S) D(2,1) 10 1-2
2 C(2,{3}) D(2,3)+C(3,S) 35+15=50 1-3-2
C(2, {4}) D(2,4)+C(4,S) 25+20=45 1-4-2
C(3,{2}) D(3,2)+C(2,S) 35+10=45 1-2-3
C(3,{4}) D(3,4)+C(4,S) 30+20=50 1-4-3
C(4,{2}) D(4,2)+C(2,S) 25+10=35 1-2-4
C(4,{3}) D(4,3)+C(3,S) 30+15=45 1-3-4
3 C(2,{3,4}) MIN(D(2,3) + C(3,{4}),
D(2,4)+C(4,{3}))
MIN(50+35,45+25)
=80
1-3-4-2
C(3,{2,4}) MIN(D(3,2)+C(2,{4}),
D(3,4)+C(4,{2}))
MIN(45+35,35+30)
=65
1-2-4-3
C(4,{2,3}) MIN(D(4,2)+C(2,{3}),
D(4,3)+C(3,{2}))
MIN(50+25,45+30)
=75
1-2-3-4
4 C(1,{2,3,4}) MIN(D(1,2)+C(2,{3,4})
, D(1,3)+C(3,{2,4}),
D(1,4)+ C(4,{2,3}))
MIN(90,80,95)
=80
1-2-4-3-1
SO,THE OPTIMAL PATH 1-2-4-3-1 FOR TOUR HAS LENGTH 80.
AssignmentNo.2
There are 5 teams:T1, T2, T3, T4 and T5 ina couple of serieswhere 3typesof games:G1, G2
and G3. NowT1 and T3 bothplaysall three typesof games,T2 playsonlyG1 and G3, T4 plays
onlyG2 and G3 andT5 onlyplaysG1 and G3.
NowusingAntColonyOptimizationfindoutthe schedulingof gamesamongG1,G2 and G3.
Solution:
Here create a matrix Cij where ithrepresentsteamandjthrepresentsgame.Now consider1
for playinggame and0 for non-playinggame.
G1 G2 G3
T1 1 1 1
T2 1 0 1
T3 1 1 1
T4 0 1 1
T5 1 0 1
Now,the weightage Dij representsthe numberof competitorswherethe competitor
participatesinboththe gamesI and j.
Thisweightage functionformsamatrix whichisknownasweightage matrix.
D3x3
G1 G2 G3
G1 0 2 4
G2 2 0 3
G3 4 3 0
SL NO PERMUTATION PATH COST
1 1-2-3-1 9
2 1-3-2-1 9
3 2-1-3-2 9
4 2-3-1-2 9
5 3-1-2-3 9
1
2
3
2 4
3
6 3-2-1-3 9
Let us assume start node 1 (S)
IterationNo. Cost function Evaluation Cost Path
1 C(2,S) D(2,1) 2 1-2
C(3,S) D(3,1) 4 1-3
2 C(3,{2}) D(3,2)+C(2,S) 3+2=5 1-2-3
C(2,{3}) D(2,3)+C(3,S) 3+4=7 1-3-2
MIN(C(3,{2}),C(2,{3}))=MIN(5,7) =5 SO,PATH 1-2-3
Let us assume start node 2 (S)
IterationNo. Cost function Evaluation Cost Path
1 C(1,S) D(1,2) 2 2-1
C(3,S) D(3,2) 3 2-3
2 C(3,{1}) D(3,1)+C(1,S) 4+2=6 2-1-3
C(1,{3}) D(1,3)+C(3,S) 4+3=7 2-3-1
MIN(C(3,{1}),C(1,{3}))=MIN(6,7) =6 SO,PATH 2-1-3
Let us assume start node 3 (S)
IterationNo. Cost function Evaluation Cost Path
1 C(2,S) D(2,3) 3 3-2
C(1,S) D(1,3) 4 3-1
2 C(1,{2}) D(1,2)+C(2,S) 2+3=5 3-2-1
C(2,{1}) D(2,1)+C(1,S) 2+4=6 3-1-2
MIN(C(1,{2}),C(2,{1}))=MIN(5,6) =5 SO,PATH 3-2-1
So overall minimizationeitherpathschedule 1-2-3or 3-2-1
So,G1-G2-G3 OR G3-G2-G1.

More Related Content

PPTX
Travelling salesman problem
PPTX
Traveling Salesman Problem
PPTX
Peephole optimization techniques in compiler design
PPTX
Greedy Algorithms
PPTX
Travelling salesman problem using genetic algorithms
PPT
Scheduling algorithms
PPTX
Dijkstra’S Algorithm
PPTX
Job sequencing with Deadlines
Travelling salesman problem
Traveling Salesman Problem
Peephole optimization techniques in compiler design
Greedy Algorithms
Travelling salesman problem using genetic algorithms
Scheduling algorithms
Dijkstra’S Algorithm
Job sequencing with Deadlines

What's hot (20)

PPTX
Dijkstra's Algorithm
PPTX
Backtracking
PPTX
Opearion on Fuzzy sets with Example
PPTX
Three Address code
PPT
Pipeline hazards in computer Architecture ppt
PPTX
Timing and control
PPTX
Deadlock Presentation
PPT
Real-Time Scheduling
PPT
Divide and conquer
PPTX
Tsp branch and-bound
PPTX
Dijkstra's algorithm
PPTX
Greedy Algorithm - Knapsack Problem
PDF
It interview questions
PPTX
data structures- back tracking
PPTX
RISC (reduced instruction set computer)
PPTX
Process synchronization in Operating Systems
PPTX
NP completeness
PPTX
Travelling Salesman Problem
PPTX
CPU scheduling algorithms in OS
PPTX
Mutual exclusion in distributed systems
Dijkstra's Algorithm
Backtracking
Opearion on Fuzzy sets with Example
Three Address code
Pipeline hazards in computer Architecture ppt
Timing and control
Deadlock Presentation
Real-Time Scheduling
Divide and conquer
Tsp branch and-bound
Dijkstra's algorithm
Greedy Algorithm - Knapsack Problem
It interview questions
data structures- back tracking
RISC (reduced instruction set computer)
Process synchronization in Operating Systems
NP completeness
Travelling Salesman Problem
CPU scheduling algorithms in OS
Mutual exclusion in distributed systems
Ad

Similar to Traveling salesman problem: Game Scheduling Problem Solution: Ant Colony Optimization (20)

PDF
Analysis of Electro-Mechanical System
DOC
algorithm Unit 3
PPTX
The Delta Of An Arithmetic Asian Option Via The Pathwise Method
PPTX
2_1 Edit Distance.pptx
PDF
1ST_UNIT_DAdefewfrewfgrwefrAdfdgfdsgevedr (2).pdf
PDF
Hull White model presentation
DOCX
DSP LAB COMPLETE CODES.docx
PPTX
Branch and bounding : Data structures
PPT
Hprec7.1
DOC
Unit 3 daa
PDF
Quantum espresso G Vector distributon
PDF
Filter design and simulation
PDF
Computer graphics 2
PPT
How to calculate complexity in Data Structure
PDF
PPT
Asymptotic Notation and Complexity
PDF
Asymptotic Notation
PPT
Time complexity.ppt
PPT
Time complexity.pptr56435 erfgegr t 45t 35
PPTX
BALLANDBEAM_GROUP7.pptx
Analysis of Electro-Mechanical System
algorithm Unit 3
The Delta Of An Arithmetic Asian Option Via The Pathwise Method
2_1 Edit Distance.pptx
1ST_UNIT_DAdefewfrewfgrwefrAdfdgfdsgevedr (2).pdf
Hull White model presentation
DSP LAB COMPLETE CODES.docx
Branch and bounding : Data structures
Hprec7.1
Unit 3 daa
Quantum espresso G Vector distributon
Filter design and simulation
Computer graphics 2
How to calculate complexity in Data Structure
Asymptotic Notation and Complexity
Asymptotic Notation
Time complexity.ppt
Time complexity.pptr56435 erfgegr t 45t 35
BALLANDBEAM_GROUP7.pptx
Ad

More from Soumen Santra (20)

PDF
Basic and advance idea of Sed and Awk script with examples
PPT
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
PPTX
Cell hole identification in carcinogenic segment using Geodesic Methodology: ...
PPTX
PPT_PAPERID 31_SOUMEN_SANTRA - ICCET23.pptx
PPT
Basic networking hardware: Switch : Router : Hub : Bridge : Gateway : Bus : C...
PPT
Optimization techniques: Ant Colony Optimization: Bee Colony Optimization: Tr...
PPT
Quick Sort
PPT
Merge sort
PPTX
A Novel Real Time Home Automation System with Google Assistance Technology
PPTX
Java basic part 2 : Datatypes Keywords Features Components Security Exceptions
PPTX
Java Basic PART I
PPT
Threads Advance in System Administration with Linux
PPTX
Frequency Division Multiplexing Access (FDMA)
PPTX
Carrier Sense Multiple Access With Collision Detection (CSMA/CD) Details : Me...
PPTX
Code-Division Multiple Access (CDMA)
PPTX
PURE ALOHA : MEDIUM ACCESS CONTROL PROTOCOL (MAC): Definition : Types : Details
PPTX
Carrier-sense multiple access with collision avoidance CSMA/CA
PPTX
RFID (RADIO FREQUENCY IDENTIFICATION)
PPTX
SPACE DIVISION MULTIPLE ACCESS (SDMA) SATELLITE COMMUNICATION
PPT
Threads Basic : Features, Types & Implementation
Basic and advance idea of Sed and Awk script with examples
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Cell hole identification in carcinogenic segment using Geodesic Methodology: ...
PPT_PAPERID 31_SOUMEN_SANTRA - ICCET23.pptx
Basic networking hardware: Switch : Router : Hub : Bridge : Gateway : Bus : C...
Optimization techniques: Ant Colony Optimization: Bee Colony Optimization: Tr...
Quick Sort
Merge sort
A Novel Real Time Home Automation System with Google Assistance Technology
Java basic part 2 : Datatypes Keywords Features Components Security Exceptions
Java Basic PART I
Threads Advance in System Administration with Linux
Frequency Division Multiplexing Access (FDMA)
Carrier Sense Multiple Access With Collision Detection (CSMA/CD) Details : Me...
Code-Division Multiple Access (CDMA)
PURE ALOHA : MEDIUM ACCESS CONTROL PROTOCOL (MAC): Definition : Types : Details
Carrier-sense multiple access with collision avoidance CSMA/CA
RFID (RADIO FREQUENCY IDENTIFICATION)
SPACE DIVISION MULTIPLE ACCESS (SDMA) SATELLITE COMMUNICATION
Threads Basic : Features, Types & Implementation

Recently uploaded (20)

PPTX
CYBER-CRIMES AND SECURITY A guide to understanding
PDF
Well-logging-methods_new................
PDF
composite construction of structures.pdf
PPT
CRASH COURSE IN ALTERNATIVE PLUMBING CLASS
DOCX
573137875-Attendance-Management-System-original
PPTX
Welding lecture in detail for understanding
PDF
Automation-in-Manufacturing-Chapter-Introduction.pdf
PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
PDF
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
PPTX
Internet of Things (IOT) - A guide to understanding
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
PPTX
Sustainable Sites - Green Building Construction
PPT
Project quality management in manufacturing
PPTX
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
PDF
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
PDF
Embodied AI: Ushering in the Next Era of Intelligent Systems
PPTX
Lecture Notes Electrical Wiring System Components
PDF
Model Code of Practice - Construction Work - 21102022 .pdf
PPTX
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
CYBER-CRIMES AND SECURITY A guide to understanding
Well-logging-methods_new................
composite construction of structures.pdf
CRASH COURSE IN ALTERNATIVE PLUMBING CLASS
573137875-Attendance-Management-System-original
Welding lecture in detail for understanding
Automation-in-Manufacturing-Chapter-Introduction.pdf
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
Internet of Things (IOT) - A guide to understanding
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
UNIT-1 - COAL BASED THERMAL POWER PLANTS
Sustainable Sites - Green Building Construction
Project quality management in manufacturing
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
Embodied AI: Ushering in the Next Era of Intelligent Systems
Lecture Notes Electrical Wiring System Components
Model Code of Practice - Construction Work - 21102022 .pdf
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...

Traveling salesman problem: Game Scheduling Problem Solution: Ant Colony Optimization

  • 1. AssignmentNo.1 Findthe Shortesttourfrom the followinggraphusingACO-TSP(antColonyOptimization-Travelling SalesmanProblem) wherethe graphrepresentsasetof nodesanddistance betweeneverypairof nodes.The shortestpossibleroute mustvisit everynode exactlyonce andreturntothe startingpoint. (Assume startnode is1) Solution: Steps: 1. Considernode1asthe startingand endingpoint. 2. Generate all (n-1)!Permutationsof nodes. 3. Calculate costof everypermutationandkeeptrackof minimum costpermutation. 4. Returnthe permutationwithminimumcost. Sl No. Permutations Corresponding cost 1 1-2-3-4-1 95(10+35+30+20) 2 1-2-4-3-1 80(10+25+30+15) 3 1-3-2-4-1 95(15+35+25+20) 4 1-3-4-2-1 80(15+30+25+10) 5 1-4-3-2-1 95(20+30+35+10) 6 1-4-2-3-1 95(20+25+35+15)
  • 2. Weightage Matrix: 1 2 3 4 1 0 10 15 20 2 10 0 35 25 3 15 35 0 30 4 20 25 30 0 Let usassume,start node 1, considerasS Iteration No. Cost function Evaluation Cost Path 1 C(4,S) D(4,1) 20 1-4 C(3,S) D(3,1) 15 1-3 C(2,S) D(2,1) 10 1-2 2 C(2,{3}) D(2,3)+C(3,S) 35+15=50 1-3-2 C(2, {4}) D(2,4)+C(4,S) 25+20=45 1-4-2 C(3,{2}) D(3,2)+C(2,S) 35+10=45 1-2-3 C(3,{4}) D(3,4)+C(4,S) 30+20=50 1-4-3 C(4,{2}) D(4,2)+C(2,S) 25+10=35 1-2-4 C(4,{3}) D(4,3)+C(3,S) 30+15=45 1-3-4 3 C(2,{3,4}) MIN(D(2,3) + C(3,{4}), D(2,4)+C(4,{3})) MIN(50+35,45+25) =80 1-3-4-2 C(3,{2,4}) MIN(D(3,2)+C(2,{4}), D(3,4)+C(4,{2})) MIN(45+35,35+30) =65 1-2-4-3 C(4,{2,3}) MIN(D(4,2)+C(2,{3}), D(4,3)+C(3,{2})) MIN(50+25,45+30) =75 1-2-3-4 4 C(1,{2,3,4}) MIN(D(1,2)+C(2,{3,4}) , D(1,3)+C(3,{2,4}), D(1,4)+ C(4,{2,3})) MIN(90,80,95) =80 1-2-4-3-1 SO,THE OPTIMAL PATH 1-2-4-3-1 FOR TOUR HAS LENGTH 80. AssignmentNo.2 There are 5 teams:T1, T2, T3, T4 and T5 ina couple of serieswhere 3typesof games:G1, G2 and G3. NowT1 and T3 bothplaysall three typesof games,T2 playsonlyG1 and G3, T4 plays onlyG2 and G3 andT5 onlyplaysG1 and G3. NowusingAntColonyOptimizationfindoutthe schedulingof gamesamongG1,G2 and G3. Solution: Here create a matrix Cij where ithrepresentsteamandjthrepresentsgame.Now consider1 for playinggame and0 for non-playinggame.
  • 3. G1 G2 G3 T1 1 1 1 T2 1 0 1 T3 1 1 1 T4 0 1 1 T5 1 0 1 Now,the weightage Dij representsthe numberof competitorswherethe competitor participatesinboththe gamesI and j. Thisweightage functionformsamatrix whichisknownasweightage matrix. D3x3 G1 G2 G3 G1 0 2 4 G2 2 0 3 G3 4 3 0 SL NO PERMUTATION PATH COST 1 1-2-3-1 9 2 1-3-2-1 9 3 2-1-3-2 9 4 2-3-1-2 9 5 3-1-2-3 9 1 2 3 2 4 3
  • 4. 6 3-2-1-3 9 Let us assume start node 1 (S) IterationNo. Cost function Evaluation Cost Path 1 C(2,S) D(2,1) 2 1-2 C(3,S) D(3,1) 4 1-3 2 C(3,{2}) D(3,2)+C(2,S) 3+2=5 1-2-3 C(2,{3}) D(2,3)+C(3,S) 3+4=7 1-3-2 MIN(C(3,{2}),C(2,{3}))=MIN(5,7) =5 SO,PATH 1-2-3 Let us assume start node 2 (S) IterationNo. Cost function Evaluation Cost Path 1 C(1,S) D(1,2) 2 2-1 C(3,S) D(3,2) 3 2-3 2 C(3,{1}) D(3,1)+C(1,S) 4+2=6 2-1-3 C(1,{3}) D(1,3)+C(3,S) 4+3=7 2-3-1 MIN(C(3,{1}),C(1,{3}))=MIN(6,7) =6 SO,PATH 2-1-3 Let us assume start node 3 (S) IterationNo. Cost function Evaluation Cost Path 1 C(2,S) D(2,3) 3 3-2 C(1,S) D(1,3) 4 3-1 2 C(1,{2}) D(1,2)+C(2,S) 2+3=5 3-2-1 C(2,{1}) D(2,1)+C(1,S) 2+4=6 3-1-2 MIN(C(1,{2}),C(2,{1}))=MIN(5,6) =5 SO,PATH 3-2-1 So overall minimizationeitherpathschedule 1-2-3or 3-2-1 So,G1-G2-G3 OR G3-G2-G1.