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

PPTX
Chapter 10 Operating Systems silberschatz
PPTX
Cloud applications
PPTX
Introduction to parallel processing
PPTX
Quicksort Presentation
PPT
Sorting network
PPT
Hashing PPT
PPTX
Database recovery
PPTX
Distributed information system
Chapter 10 Operating Systems silberschatz
Cloud applications
Introduction to parallel processing
Quicksort Presentation
Sorting network
Hashing PPT
Database recovery
Distributed information system

What's hot (20)

PPTX
Cloud Computing & Big Data
PPT
Extensible hashing
PDF
QOS (Quality of Services) - Computer Networks
PPTX
Network Layer
PDF
Distributed Operating System_1
PPTX
Fragmentation
PPTX
Parallel computing and its applications
PPSX
Data Structure (Queue)
PPTX
Virtual Memory
PPSX
scaling in cluod computing
PPTX
Process scheduling
PPT
Graph colouring
PPTX
Row major and column major in 2 d
PPTX
Reference models in Networks: OSI & TCP/IP
PPTX
Elements of cache design
PDF
Application of MapReduce in Cloud Computing
PPTX
Chapter 9 Operating Systems silberschatz
PPT
Introduction to data structures and Algorithm
PPTX
CPU Scheduling in OS Presentation
PPTX
Perception in artificial intelligence
Cloud Computing & Big Data
Extensible hashing
QOS (Quality of Services) - Computer Networks
Network Layer
Distributed Operating System_1
Fragmentation
Parallel computing and its applications
Data Structure (Queue)
Virtual Memory
scaling in cluod computing
Process scheduling
Graph colouring
Row major and column major in 2 d
Reference models in Networks: OSI & TCP/IP
Elements of cache design
Application of MapReduce in Cloud Computing
Chapter 9 Operating Systems silberschatz
Introduction to data structures and Algorithm
CPU Scheduling in OS Presentation
Perception in artificial intelligence
Ad

Similar to Parallel Algorithms- Sorting and Graph (20)

PDF
Parallel sorting Algorithms
PPT
Sorting algorithms
PDF
Performance Evaluation of Parallel Bubble Sort Algorithm on Supercomputer IMAN1
PPTX
Unit 2 - 2.2 (Basic Algorithms).pptxeeee
PDF
Parallel search
PDF
Sequential and Parallel Searching Algorithms
DOCX
Parallel searching
PPTX
Parallel Sorting Algorithms. Quicksort. Merge sort. List Ranking
PDF
parallel sorting by regular sampling
PPT
part-1.ppt high performance computing...
PPTX
Performance evaluation of parallel bubble sort algorithm on supercomputer IMAN1.
PDF
Unit-I-DAA.pdf
PPTX
Data structfghz€zdsrgnhlhlfdshllures.pptx
PPT
Chap9 slides
PPTX
Different Searching and Sorting Methods.pptx
PPTX
ntroduction to Algorithm 2.pptx
PDF
Sorting algorithm
ODP
Sorting Algorithm
PDF
Algorithms summary (English version)
PPTX
Graphical reprsentation dsa (DATA STRUCTURE ALGORITHM)
Parallel sorting Algorithms
Sorting algorithms
Performance Evaluation of Parallel Bubble Sort Algorithm on Supercomputer IMAN1
Unit 2 - 2.2 (Basic Algorithms).pptxeeee
Parallel search
Sequential and Parallel Searching Algorithms
Parallel searching
Parallel Sorting Algorithms. Quicksort. Merge sort. List Ranking
parallel sorting by regular sampling
part-1.ppt high performance computing...
Performance evaluation of parallel bubble sort algorithm on supercomputer IMAN1.
Unit-I-DAA.pdf
Data structfghz€zdsrgnhlhlfdshllures.pptx
Chap9 slides
Different Searching and Sorting Methods.pptx
ntroduction to Algorithm 2.pptx
Sorting algorithm
Sorting Algorithm
Algorithms summary (English version)
Graphical reprsentation dsa (DATA STRUCTURE ALGORITHM)
Ad

More from Dr Shashikant Athawale (20)

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

Recently uploaded (20)

DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
PPTX
Lecture Notes Electrical Wiring System Components
PPTX
Geodesy 1.pptx...............................................
PDF
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
PDF
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
PPTX
Welding lecture in detail for understanding
PDF
composite construction of structures.pdf
PDF
Structs to JSON How Go Powers REST APIs.pdf
PPTX
Lesson 3_Tessellation.pptx finite Mathematics
PDF
Embodied AI: Ushering in the Next Era of Intelligent Systems
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PPTX
Sustainable Sites - Green Building Construction
PPTX
CYBER-CRIMES AND SECURITY A guide to understanding
PDF
Operating System & Kernel Study Guide-1 - converted.pdf
PPTX
Construction Project Organization Group 2.pptx
PPTX
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PPTX
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
Lecture Notes Electrical Wiring System Components
Geodesy 1.pptx...............................................
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
Welding lecture in detail for understanding
composite construction of structures.pdf
Structs to JSON How Go Powers REST APIs.pdf
Lesson 3_Tessellation.pptx finite Mathematics
Embodied AI: Ushering in the Next Era of Intelligent Systems
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
Sustainable Sites - Green Building Construction
CYBER-CRIMES AND SECURITY A guide to understanding
Operating System & Kernel Study Guide-1 - converted.pdf
Construction Project Organization Group 2.pptx
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx

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.