SlideShare a Scribd company logo
PARALLELALGORITHMS
SORTING AND GRAPH
Prof. Shashikant V. Athawale
Assistant Professor | Computer Engineering
Department | AISSMS College of Engineering,
Kennedy Road, Pune , MH, India - 411001
Contents
❖ Issues in Sorting on Parallel Computers
❖ Bubble Sort and its Variants
❖ Parallelizing Quicksort
❖ All-Pairs Shortest Paths
❖ Algorithm for sparse graph
❖ Parallel Depth-First Search
❖ Parallel Best-First Search.
Parallel Depth First Search
❖ Depth-first search can be performed in parallel by
partitioning the search space into many small, disjunct
parts (subtrees) that can be explored concurrently.
Sorting
❖ Sorting can be comparison-based or non comparison-
based
❖ The fundamental operation of comparison-based sorting
is compare-exchange.
Sorting: Parallel Compare Exchange
Operation
❖ A parallel compare-exchange operation. Processes Pi and
Pj send their elements to each other. Process Pi keeps
min{ai, aj}, and Pj keeps max{ai, aj}.
Sorting: Parallel Compare Split Operation
❖ A compare-split operation. Each process sends its block
of size n/p to the other process.
❖ Each process merges the received block with its own
block and retains only the appropriate half of the merged
block.
❖ In the example, process Pi retains the smaller elements
and process Pj retains the larger elements.
Sorting: Parallel Compare Split Operation
Bubble Sort and its Variants
❖ The sequential bubble sort algorithm compares and
exchanges adjacent elements in the sequence to be
sorted.
❖ The complexity of bubble sort is Θ(n2
).
❖ Bubble sort is difficult to parallelize since the algorithm
has no concurrency.
❖ A simple variant, though, uncovers the concurrency.
Parallelizing Quicksort
❖ Quicksort is one of the most common sorting algorithms
for sequential computers because of its simplicity, low
overhead, and optimal average complexity.
❖ Quicksort selects one of the entries in the sequence to be
the pivot and divides the sequence into two – one with all
elements less than the pivot and other greater.
❖ The process is recursively applied to each of the sublists.
❖ In parallel quicksort,choose a pivot from one of the
processes and broadcast it to every process.
All-Pairs Shortest Paths
Algorithm for Sparse Graph
❖ A graph G = (V, E) is sparse if |E| is much smaller than |V
|2
❖ Examples of Sparse graph:
➢ Linear graph, in which each vertex has two incident
edges
Algorithm for Sparse Graph
❖ Grid graph,in which each vertex has four incident
vertices
❖ Random sparse graph.
Parallel Depth First Search
❖ Depth-first search can be performed in parallel by
partitioning the search space into many small, disjunct
parts (subtrees) that can be explored concurrently.
❖ Depth-first search algorithm uses idea of backtraching.
Parallel Breadth First Search

More Related Content

What's hot (20)

PPT
Classical problem of synchronization
Shakshi Ranawat
 
PPTX
Real time Operating System
Tech_MX
 
PPT
Np cooks theorem
Narayana Galla
 
PDF
I. AO* SEARCH ALGORITHM
vikas dhakane
 
PPTX
Spell checker using Natural language processing
Sandeep Wakchaure
 
PPTX
knowledge representation using rules
Harini Balamurugan
 
PPT
Parallel computing
Vinay Gupta
 
PPTX
Logics for non monotonic reasoning-ai
ShaishavShah8
 
PPTX
Backpropagation algo
noT yeT woRkiNg !! iM stiLl stUdYinG !!
 
PPT
CPU Scheduling Algorithms
Shubhashish Punj
 
PPT
Cluster Computing
BOSS Webtech
 
PPTX
Knowledge representation In Artificial Intelligence
Ramla Sheikh
 
PPTX
Routing protocols for ad hoc wireless networks
Divya Tiwari
 
PPTX
Dempster shafer theory
Dr. C.V. Suresh Babu
 
PPTX
Unification and Lifting
Megha Sharma
 
PPTX
Semantic nets in artificial intelligence
harshita virwani
 
PPTX
Structured Knowledge Representation
Sagacious IT Solution
 
PPT
Symbol table management and error handling in compiler design
Swati Chauhan
 
PPT
multiprocessors and multicomputers
Pankaj Kumar Jain
 
PPT
Branch and bound
Dr Shashikant Athawale
 
Classical problem of synchronization
Shakshi Ranawat
 
Real time Operating System
Tech_MX
 
Np cooks theorem
Narayana Galla
 
I. AO* SEARCH ALGORITHM
vikas dhakane
 
Spell checker using Natural language processing
Sandeep Wakchaure
 
knowledge representation using rules
Harini Balamurugan
 
Parallel computing
Vinay Gupta
 
Logics for non monotonic reasoning-ai
ShaishavShah8
 
CPU Scheduling Algorithms
Shubhashish Punj
 
Cluster Computing
BOSS Webtech
 
Knowledge representation In Artificial Intelligence
Ramla Sheikh
 
Routing protocols for ad hoc wireless networks
Divya Tiwari
 
Dempster shafer theory
Dr. C.V. Suresh Babu
 
Unification and Lifting
Megha Sharma
 
Semantic nets in artificial intelligence
harshita virwani
 
Structured Knowledge Representation
Sagacious IT Solution
 
Symbol table management and error handling in compiler design
Swati Chauhan
 
multiprocessors and multicomputers
Pankaj Kumar Jain
 
Branch and bound
Dr Shashikant Athawale
 

Similar to Parallel Algorithms- Sorting and Graph (20)

PDF
Parallel sorting Algorithms
GARIMA SHAKYA
 
PPT
Sorting algorithms
Syed Zaid Irshad
 
PDF
Performance Evaluation of Parallel Bubble Sort Algorithm on Supercomputer IMAN1
AIRCC Publishing Corporation
 
PPTX
Unit 2 - 2.2 (Basic Algorithms).pptxeeee
Abhishek826982
 
PDF
Parallel search
Md. Mahedi Mahfuj
 
PDF
Sequential and Parallel Searching Algorithms
Suresh Pokharel
 
DOCX
Parallel searching
Md. Mahedi Mahfuj
 
PPTX
Parallel Sorting Algorithms. Quicksort. Merge sort. List Ranking
SukhrobAtoev2
 
PDF
parallel sorting by regular sampling
Wei Mu
 
PPTX
Performance evaluation of parallel bubble sort algorithm on supercomputer IMAN1.
Shakil Ahmed
 
PDF
Unit-I-DAA.pdf
AdityaKumar993506
 
PPTX
Data structfghz€zdsrgnhlhlfdshllures.pptx
srahul53094
 
PPT
Chap9 slides
BaliThorat1
 
PPTX
Different Searching and Sorting Methods.pptx
Minakshee Patil
 
PPTX
ntroduction to Algorithm 2.pptx
Marisse Presilda
 
PDF
Sorting algorithm
Balaji Nangare
 
ODP
Sorting Algorithm
Abu Shaik saurab
 
PDF
Algorithms summary (English version)
Young-Min kang
 
PPTX
Graphical reprsentation dsa (DATA STRUCTURE ALGORITHM)
abdulrafaychaudhry
 
PDF
9001 DS nijboubuoboubuonuonounoinSORTING.pdf
srk712906
 
Parallel sorting Algorithms
GARIMA SHAKYA
 
Sorting algorithms
Syed Zaid Irshad
 
Performance Evaluation of Parallel Bubble Sort Algorithm on Supercomputer IMAN1
AIRCC Publishing Corporation
 
Unit 2 - 2.2 (Basic Algorithms).pptxeeee
Abhishek826982
 
Parallel search
Md. Mahedi Mahfuj
 
Sequential and Parallel Searching Algorithms
Suresh Pokharel
 
Parallel searching
Md. Mahedi Mahfuj
 
Parallel Sorting Algorithms. Quicksort. Merge sort. List Ranking
SukhrobAtoev2
 
parallel sorting by regular sampling
Wei Mu
 
Performance evaluation of parallel bubble sort algorithm on supercomputer IMAN1.
Shakil Ahmed
 
Unit-I-DAA.pdf
AdityaKumar993506
 
Data structfghz€zdsrgnhlhlfdshllures.pptx
srahul53094
 
Chap9 slides
BaliThorat1
 
Different Searching and Sorting Methods.pptx
Minakshee Patil
 
ntroduction to Algorithm 2.pptx
Marisse Presilda
 
Sorting algorithm
Balaji Nangare
 
Sorting Algorithm
Abu Shaik saurab
 
Algorithms summary (English version)
Young-Min kang
 
Graphical reprsentation dsa (DATA STRUCTURE ALGORITHM)
abdulrafaychaudhry
 
9001 DS nijboubuoboubuonuonounoinSORTING.pdf
srk712906
 
Ad

More from Dr Shashikant Athawale (20)

PPT
multi threaded and distributed algorithms
Dr Shashikant Athawale
 
PPT
Amortized analysis
Dr Shashikant Athawale
 
PPT
Complexity theory
Dr Shashikant Athawale
 
PPT
Divide and Conquer
Dr Shashikant Athawale
 
PPT
Model and Design
Dr Shashikant Athawale
 
PPT
Fundamental of Algorithms
Dr Shashikant Athawale
 
PPT
CUDA Architecture
Dr Shashikant Athawale
 
PPT
Analytical Models of Parallel Programs
Dr Shashikant Athawale
 
PPT
Basic Communication
Dr Shashikant Athawale
 
PPT
Parallel Processing Concepts
Dr Shashikant Athawale
 
PPT
Parallel Processing Concepts
Dr Shashikant Athawale
 
PPT
Dynamic programming
Dr Shashikant Athawale
 
PPT
Parallel algorithms
Dr Shashikant Athawale
 
PPT
Greedy method
Dr Shashikant Athawale
 
PPT
Divide and conquer
Dr Shashikant Athawale
 
PPT
Asymptotic notation
Dr Shashikant Athawale
 
PPT
String matching algorithms
Dr Shashikant Athawale
 
PPTX
Advanced Wireless Technologies
Dr Shashikant Athawale
 
PPTX
Vehicular network
Dr Shashikant Athawale
 
multi threaded and distributed algorithms
Dr Shashikant Athawale
 
Amortized analysis
Dr Shashikant Athawale
 
Complexity theory
Dr Shashikant Athawale
 
Divide and Conquer
Dr Shashikant Athawale
 
Model and Design
Dr Shashikant Athawale
 
Fundamental of Algorithms
Dr Shashikant Athawale
 
CUDA Architecture
Dr Shashikant Athawale
 
Analytical Models of Parallel Programs
Dr Shashikant Athawale
 
Basic Communication
Dr Shashikant Athawale
 
Parallel Processing Concepts
Dr Shashikant Athawale
 
Parallel Processing Concepts
Dr Shashikant Athawale
 
Dynamic programming
Dr Shashikant Athawale
 
Parallel algorithms
Dr Shashikant Athawale
 
Greedy method
Dr Shashikant Athawale
 
Divide and conquer
Dr Shashikant Athawale
 
Asymptotic notation
Dr Shashikant Athawale
 
String matching algorithms
Dr Shashikant Athawale
 
Advanced Wireless Technologies
Dr Shashikant Athawale
 
Vehicular network
Dr Shashikant Athawale
 
Ad

Recently uploaded (20)

PPTX
ASBC application presentation template (ENG)_v3 (1).pptx
HassanMohammed730118
 
PDF
CLIP_Internals_and_Architecture.pdf sdvsdv sdv
JoseLuisCahuanaRamos3
 
PDF
LLC CM NCP1399 SIMPLIS MODEL MANUAL.PDF
ssuser1be9ce
 
PPTX
Bharatiya Antariksh Hackathon 2025 Idea Submission PPT.pptx
AsadShad4
 
PDF
Plant Control_EST_85520-01_en_AllChanges_20220127.pdf
DarshanaChathuranga4
 
PDF
Designing for Tomorrow – Architecture’s Role in the Sustainability Movement
BIM Services
 
PDF
01-introduction to the ProcessDesign.pdf
StiveBrack
 
PDF
June 2025 - Top 10 Read Articles in Network Security and Its Applications
IJNSA Journal
 
PPTX
CST413 KTU S7 CSE Machine Learning Neural Networks and Support Vector Machine...
resming1
 
PPTX
Explore USA’s Best Structural And Non Structural Steel Detailing
Silicon Engineering Consultants LLC
 
PDF
Bayesian Learning - Naive Bayes Algorithm
Sharmila Chidaravalli
 
PDF
Tesia Dobrydnia - An Avid Hiker And Backpacker
Tesia Dobrydnia
 
PPTX
Stability of IBR Dominated Grids - IEEE PEDG 2025 - short.pptx
ssuser307730
 
PDF
تقرير عن التحليل الديناميكي لتدفق الهواء حول جناح.pdf
محمد قصص فتوتة
 
PDF
Authentication Devices in Fog-mobile Edge Computing Environments through a Wi...
ijujournal
 
PDF
輪読会資料_Miipher and Miipher2 .
NABLAS株式会社
 
PPTX
FSE_LLM4SE1_A Tool for In-depth Analysis of Code Execution Reasoning of Large...
cl144
 
PPT
دراسة حاله لقرية تقع في جنوب غرب السودان
محمد قصص فتوتة
 
PDF
13th International Conference of Security, Privacy and Trust Management (SPTM...
ijcisjournal
 
PDF
Generative AI & Scientific Research : Catalyst for Innovation, Ethics & Impact
AlqualsaDIResearchGr
 
ASBC application presentation template (ENG)_v3 (1).pptx
HassanMohammed730118
 
CLIP_Internals_and_Architecture.pdf sdvsdv sdv
JoseLuisCahuanaRamos3
 
LLC CM NCP1399 SIMPLIS MODEL MANUAL.PDF
ssuser1be9ce
 
Bharatiya Antariksh Hackathon 2025 Idea Submission PPT.pptx
AsadShad4
 
Plant Control_EST_85520-01_en_AllChanges_20220127.pdf
DarshanaChathuranga4
 
Designing for Tomorrow – Architecture’s Role in the Sustainability Movement
BIM Services
 
01-introduction to the ProcessDesign.pdf
StiveBrack
 
June 2025 - Top 10 Read Articles in Network Security and Its Applications
IJNSA Journal
 
CST413 KTU S7 CSE Machine Learning Neural Networks and Support Vector Machine...
resming1
 
Explore USA’s Best Structural And Non Structural Steel Detailing
Silicon Engineering Consultants LLC
 
Bayesian Learning - Naive Bayes Algorithm
Sharmila Chidaravalli
 
Tesia Dobrydnia - An Avid Hiker And Backpacker
Tesia Dobrydnia
 
Stability of IBR Dominated Grids - IEEE PEDG 2025 - short.pptx
ssuser307730
 
تقرير عن التحليل الديناميكي لتدفق الهواء حول جناح.pdf
محمد قصص فتوتة
 
Authentication Devices in Fog-mobile Edge Computing Environments through a Wi...
ijujournal
 
輪読会資料_Miipher and Miipher2 .
NABLAS株式会社
 
FSE_LLM4SE1_A Tool for In-depth Analysis of Code Execution Reasoning of Large...
cl144
 
دراسة حاله لقرية تقع في جنوب غرب السودان
محمد قصص فتوتة
 
13th International Conference of Security, Privacy and Trust Management (SPTM...
ijcisjournal
 
Generative AI & Scientific Research : Catalyst for Innovation, Ethics & Impact
AlqualsaDIResearchGr
 

Parallel Algorithms- Sorting and Graph

  • 1. PARALLELALGORITHMS SORTING AND GRAPH Prof. Shashikant V. Athawale Assistant Professor | Computer Engineering Department | AISSMS College of Engineering, Kennedy Road, Pune , MH, India - 411001
  • 2. Contents ❖ Issues in Sorting on Parallel Computers ❖ Bubble Sort and its Variants ❖ Parallelizing Quicksort ❖ All-Pairs Shortest Paths ❖ Algorithm for sparse graph ❖ Parallel Depth-First Search ❖ Parallel Best-First Search.
  • 3. Parallel Depth First Search ❖ Depth-first search can be performed in parallel by partitioning the search space into many small, disjunct parts (subtrees) that can be explored concurrently.
  • 4. Sorting ❖ Sorting can be comparison-based or non comparison- based ❖ The fundamental operation of comparison-based sorting is compare-exchange.
  • 5. Sorting: Parallel Compare Exchange Operation ❖ A parallel compare-exchange operation. Processes Pi and Pj send their elements to each other. Process Pi keeps min{ai, aj}, and Pj keeps max{ai, aj}.
  • 6. Sorting: Parallel Compare Split Operation ❖ A compare-split operation. Each process sends its block of size n/p to the other process. ❖ Each process merges the received block with its own block and retains only the appropriate half of the merged block. ❖ In the example, process Pi retains the smaller elements and process Pj retains the larger elements.
  • 7. Sorting: Parallel Compare Split Operation
  • 8. Bubble Sort and its Variants ❖ The sequential bubble sort algorithm compares and exchanges adjacent elements in the sequence to be sorted. ❖ The complexity of bubble sort is Θ(n2 ). ❖ Bubble sort is difficult to parallelize since the algorithm has no concurrency. ❖ A simple variant, though, uncovers the concurrency.
  • 9. Parallelizing Quicksort ❖ Quicksort is one of the most common sorting algorithms for sequential computers because of its simplicity, low overhead, and optimal average complexity. ❖ Quicksort selects one of the entries in the sequence to be the pivot and divides the sequence into two – one with all elements less than the pivot and other greater. ❖ The process is recursively applied to each of the sublists. ❖ In parallel quicksort,choose a pivot from one of the processes and broadcast it to every process.
  • 11. Algorithm for Sparse Graph ❖ A graph G = (V, E) is sparse if |E| is much smaller than |V |2 ❖ Examples of Sparse graph: ➢ Linear graph, in which each vertex has two incident edges
  • 12. Algorithm for Sparse Graph ❖ Grid graph,in which each vertex has four incident vertices ❖ Random sparse graph.
  • 13. Parallel Depth First Search ❖ Depth-first search can be performed in parallel by partitioning the search space into many small, disjunct parts (subtrees) that can be explored concurrently. ❖ Depth-first search algorithm uses idea of backtraching.