SlideShare a Scribd company logo
CS403 : Parellel Programming
Travelling Salesman Problem
Design of Parallel Algorithm
Team Members
● P Jishnu Jaykumar (201352005)
○ 201352005@iiitvadodara.ac.in
● Vivek Kumar Singh (201352015)
○ 201352015@iiitvadodara.ac.in
● Rahul Nalawade (201351017)
○ 201351017@iiitvadodara.ac.in
● Ajay Shewale (201351030)
○ 201351030@iiitvadodara.ac.in
Table of contents
● Possible ways to parallelize.
● Describing strategies with task graphs and algorithms.
● Analyzing strategies with speed-up calculations
Possible ways to parellelize
NOTE : We are only designing two ways to parellelize our serial code.
Serial algorithm
Input : Adjacency matrix containing cost value between two cities.
Output : Optimal Hamiltonian circuit with minimum travel cost.
Procedure :
● Calculate all possible travel routes (more specifically circuits).
○ i.e. Permutation of all possible travel path
● Calculate total cost corresponding to each travel route.
● Pick the route with minimum travel cost
○ This would be the optimal Hamiltonian path.
○ The travel path corresponding to this travel cost will be the output.
First Approach : Parallel Design
Input : Adjacency matrix containing cost value between two cities.
Output : Optimal Hamiltonian circuit with minimum travel cost.
Procedure :
● Calculate all possible travel routes (more specifically circuits).
○ i.e. Permutation of all possible travel path -- This would run sequentially one after the other.
● Divide permutations among various threads.
○ Let there be n! permutated paths and p processors.
○ Each processor will have (n!/p) travel paths. -- Let us call this travel chunk.
● Each processor will calculate total cost corresponding to each travel route in the travel chunk.
● Pick the route with minimum travel cost in each travel chunk.
○ This would be the sub-optimal Hamiltonian path
● After calculation of all the minimum travel paths from each travel chunk,
● pick out the minimal cost travel path out of this filtered list.
○ The travel path corresponding to this travel cost will be the output.
Task Graph
Speed-up calculations
● Speed up is based on ideal conditions.
● Speed up = T_serial / T_parellel
● Theoretically
○ T_parellel = T_serial / n
○ Where n = number of processors
● So Speed up = n
● Graphs will be provided once parallel algorithms are coded.
Second Approach ( Using Shared Space & mutex)
Input : Adjacency matrix containing cost value between two cities.
Output : Optimal Hamiltonian circuit with minimum travel cost.
Procedure :
Shared Variable → Min Cost=infinity (theoretically) & Min Circuit.
● Calculate all possible travel routes (more specifically circuits).
● Divide permutations among various threads.
○ Let there be n! permutated paths and p processors .
● In each thread, while adding each edge from the permutation list, check if total cost after adding it is
greater than Min Cost. If Yes, drop that permutation, no need of further calculation.
Start calculation for other permutation from the list.
Second Approach ( Using Shared Space & mutex)
● If the minimum cost of the permutation is less than Min Cost. Then Update the value of the Min Cost
and Update the value of MinCircuit with that permutation cost and permutation.
● All threads will update the MinCost shared variable and MinCircuit .
● At the end, We finally get Minimum Cost and Minimum Circuit.
Task Graph
Speed-up calculations
● Speed up is based on ideal conditions.
● Speed up = T_serial / T_parellel
● Theoretically
○ T_parellel = ((T_serial / n) - X)
○ Where n = number of processors
○ X= number of cities with no edge between them.
● So Speed up = (n / (1 - (n*X / T_serial)))
● Graphs will be provided once parallel algorithms are coded.
Any Queries?
Thank you ...

More Related Content

PPT
Parallel Algorithms- Sorting and Graph
PPTX
ailet maths question
PPT
Analytical Models of Parallel Programs
PDF
Ad Placement Challenge
PDF
Outbrain Click Prediction
PPT
PPT
study Latent Doodle Space
PPTX
Caculation of pigging effectiveness
Parallel Algorithms- Sorting and Graph
ailet maths question
Analytical Models of Parallel Programs
Ad Placement Challenge
Outbrain Click Prediction
study Latent Doodle Space
Caculation of pigging effectiveness

What's hot (19)

PDF
Sparse inverse covariance estimation
PDF
Avito Duplicate Ads Detection @ kaggle
ODP
Gear slideshow
PDF
Exam100118
PPT
Dynamic programming
PDF
Exam100412
PDF
Sequential and Parallel Searching Algorithms
PPTX
Compiler Design
PDF
Microstation SS4 Corridor Modeler: Alignment Data
PDF
Exam110121
PPTX
Learning Algorithms For A Specific Configuration Of The Quantron
PPTX
Alg 1 sections 1.5-1.6
PPTX
Bellman ford algorithm
PDF
Final take home_exam2012_ie516
PPTX
Amortized analysis
PPTX
Time series statastics
PPTX
AS level Application of differential calculus in different fields
PDF
CIKM Cup 2016: Cross-Device Linking
Sparse inverse covariance estimation
Avito Duplicate Ads Detection @ kaggle
Gear slideshow
Exam100118
Dynamic programming
Exam100412
Sequential and Parallel Searching Algorithms
Compiler Design
Microstation SS4 Corridor Modeler: Alignment Data
Exam110121
Learning Algorithms For A Specific Configuration Of The Quantron
Alg 1 sections 1.5-1.6
Bellman ford algorithm
Final take home_exam2012_ie516
Amortized analysis
Time series statastics
AS level Application of differential calculus in different fields
CIKM Cup 2016: Cross-Device Linking
Ad

Similar to Cs403 Parellel Programming Travelling Salesman Problem (20)

PDF
A parallel gpu version of the traveling salesman problem slides
PDF
Presentazione tesi magistrale Martino Marangon
PDF
Elementary Parallel Algorithms
PPTX
Applied Algorithms Introduction to Algorithms.pptx
PPTX
5.2 Least Squares Linear Regression.pptx
PPTX
2Wisjshsbebe pehele isienew Dorene isksnwnw
PDF
Chapter 2 Computer graphics by Kushal Bhattarai
PDF
“An Alternate Approach to Find an Optimal Solution of a Transportation Problem.”
PPTX
3rd Conference on Sustainable Urban Mobility
PDF
A feasible solution algorithm for a primitive vehicle routing problem
PPTX
Graph of UK train stations
PDF
Shortest Path search in your Database and more with pgRouting - FOSS4G Europe...
PPTX
ESCC 2016, July 10-16, Athens, Greece
PPTX
Data Structures - Lecture 1 [introduction]
PDF
Introducton to Convolutional Nerural Network with TensorFlow
PPTX
Fakhre alam
PDF
Optimizing last mile delivery
PDF
Finding Dense Subgraphs
PPS
Case Study for Plant Layout :: A modern analysis
PPTX
Prediction of taxi rides ETA
A parallel gpu version of the traveling salesman problem slides
Presentazione tesi magistrale Martino Marangon
Elementary Parallel Algorithms
Applied Algorithms Introduction to Algorithms.pptx
5.2 Least Squares Linear Regression.pptx
2Wisjshsbebe pehele isienew Dorene isksnwnw
Chapter 2 Computer graphics by Kushal Bhattarai
“An Alternate Approach to Find an Optimal Solution of a Transportation Problem.”
3rd Conference on Sustainable Urban Mobility
A feasible solution algorithm for a primitive vehicle routing problem
Graph of UK train stations
Shortest Path search in your Database and more with pgRouting - FOSS4G Europe...
ESCC 2016, July 10-16, Athens, Greece
Data Structures - Lecture 1 [introduction]
Introducton to Convolutional Nerural Network with TensorFlow
Fakhre alam
Optimizing last mile delivery
Finding Dense Subgraphs
Case Study for Plant Layout :: A modern analysis
Prediction of taxi rides ETA
Ad

More from Jishnu P (7)

PDF
SinGAN - Learning a Generative Model from a Single Natural Image
PDF
Breaking CAPTCHAs using ML
PDF
Stencil computation research project presentation #1
PDF
Btp 2017 presentation
PDF
Ir mcq-answering-system
PDF
Ansible Overview - System Administration and Maintenance
PDF
CS404 Pattern Recognition - Locality Preserving Projections
SinGAN - Learning a Generative Model from a Single Natural Image
Breaking CAPTCHAs using ML
Stencil computation research project presentation #1
Btp 2017 presentation
Ir mcq-answering-system
Ansible Overview - System Administration and Maintenance
CS404 Pattern Recognition - Locality Preserving Projections

Recently uploaded (20)

PDF
Embodied AI: Ushering in the Next Era of Intelligent Systems
PPTX
Artificial Intelligence
PPTX
Construction Project Organization Group 2.pptx
PPT
Project quality management in manufacturing
PPT
Mechanical Engineering MATERIALS Selection
PDF
R24 SURVEYING LAB MANUAL for civil enggi
PDF
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
PPTX
Current and future trends in Computer Vision.pptx
PDF
Digital Logic Computer Design lecture notes
PDF
Operating System & Kernel Study Guide-1 - converted.pdf
PDF
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
PPTX
CYBER-CRIMES AND SECURITY A guide to understanding
PPTX
OOP with Java - Java Introduction (Basics)
PDF
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
PDF
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PDF
Model Code of Practice - Construction Work - 21102022 .pdf
PPTX
Safety Seminar civil to be ensured for safe working.
PPTX
additive manufacturing of ss316l using mig welding
PPTX
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
Embodied AI: Ushering in the Next Era of Intelligent Systems
Artificial Intelligence
Construction Project Organization Group 2.pptx
Project quality management in manufacturing
Mechanical Engineering MATERIALS Selection
R24 SURVEYING LAB MANUAL for civil enggi
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
Current and future trends in Computer Vision.pptx
Digital Logic Computer Design lecture notes
Operating System & Kernel Study Guide-1 - converted.pdf
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
CYBER-CRIMES AND SECURITY A guide to understanding
OOP with Java - Java Introduction (Basics)
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
Model Code of Practice - Construction Work - 21102022 .pdf
Safety Seminar civil to be ensured for safe working.
additive manufacturing of ss316l using mig welding
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx

Cs403 Parellel Programming Travelling Salesman Problem

  • 1. CS403 : Parellel Programming Travelling Salesman Problem Design of Parallel Algorithm
  • 2. Team Members ● P Jishnu Jaykumar (201352005) ○ 201352005@iiitvadodara.ac.in ● Vivek Kumar Singh (201352015) ○ 201352015@iiitvadodara.ac.in ● Rahul Nalawade (201351017) ○ 201351017@iiitvadodara.ac.in ● Ajay Shewale (201351030) ○ 201351030@iiitvadodara.ac.in
  • 3. Table of contents ● Possible ways to parallelize. ● Describing strategies with task graphs and algorithms. ● Analyzing strategies with speed-up calculations
  • 4. Possible ways to parellelize NOTE : We are only designing two ways to parellelize our serial code.
  • 5. Serial algorithm Input : Adjacency matrix containing cost value between two cities. Output : Optimal Hamiltonian circuit with minimum travel cost. Procedure : ● Calculate all possible travel routes (more specifically circuits). ○ i.e. Permutation of all possible travel path ● Calculate total cost corresponding to each travel route. ● Pick the route with minimum travel cost ○ This would be the optimal Hamiltonian path. ○ The travel path corresponding to this travel cost will be the output.
  • 6. First Approach : Parallel Design Input : Adjacency matrix containing cost value between two cities. Output : Optimal Hamiltonian circuit with minimum travel cost. Procedure : ● Calculate all possible travel routes (more specifically circuits). ○ i.e. Permutation of all possible travel path -- This would run sequentially one after the other. ● Divide permutations among various threads. ○ Let there be n! permutated paths and p processors. ○ Each processor will have (n!/p) travel paths. -- Let us call this travel chunk. ● Each processor will calculate total cost corresponding to each travel route in the travel chunk. ● Pick the route with minimum travel cost in each travel chunk. ○ This would be the sub-optimal Hamiltonian path ● After calculation of all the minimum travel paths from each travel chunk, ● pick out the minimal cost travel path out of this filtered list. ○ The travel path corresponding to this travel cost will be the output.
  • 8. Speed-up calculations ● Speed up is based on ideal conditions. ● Speed up = T_serial / T_parellel ● Theoretically ○ T_parellel = T_serial / n ○ Where n = number of processors ● So Speed up = n ● Graphs will be provided once parallel algorithms are coded.
  • 9. Second Approach ( Using Shared Space & mutex) Input : Adjacency matrix containing cost value between two cities. Output : Optimal Hamiltonian circuit with minimum travel cost. Procedure : Shared Variable → Min Cost=infinity (theoretically) & Min Circuit. ● Calculate all possible travel routes (more specifically circuits). ● Divide permutations among various threads. ○ Let there be n! permutated paths and p processors . ● In each thread, while adding each edge from the permutation list, check if total cost after adding it is greater than Min Cost. If Yes, drop that permutation, no need of further calculation. Start calculation for other permutation from the list.
  • 10. Second Approach ( Using Shared Space & mutex) ● If the minimum cost of the permutation is less than Min Cost. Then Update the value of the Min Cost and Update the value of MinCircuit with that permutation cost and permutation. ● All threads will update the MinCost shared variable and MinCircuit . ● At the end, We finally get Minimum Cost and Minimum Circuit.
  • 12. Speed-up calculations ● Speed up is based on ideal conditions. ● Speed up = T_serial / T_parellel ● Theoretically ○ T_parellel = ((T_serial / n) - X) ○ Where n = number of processors ○ X= number of cities with no edge between them. ● So Speed up = (n / (1 - (n*X / T_serial))) ● Graphs will be provided once parallel algorithms are coded.