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
Ad

More Related Content

What's hot (20)

Symbolic Mathematics
Symbolic Mathematics Symbolic Mathematics
Symbolic Mathematics
saadurrehman35
 
Parallel algorithms
Parallel algorithmsParallel algorithms
Parallel algorithms
guest084d20
 
Distributed concurrency control
Distributed concurrency controlDistributed concurrency control
Distributed concurrency control
Binte fatima
 
N queen problem
N queen problemN queen problem
N queen problem
Ridhima Chowdhury
 
Distributed operating system
Distributed operating systemDistributed operating system
Distributed operating system
udaya khanal
 
Distributed DBMS - Unit 8 - Distributed Transaction Management & Concurrency ...
Distributed DBMS - Unit 8 - Distributed Transaction Management & Concurrency ...Distributed DBMS - Unit 8 - Distributed Transaction Management & Concurrency ...
Distributed DBMS - Unit 8 - Distributed Transaction Management & Concurrency ...
Gyanmanjari Institute Of Technology
 
Parallel searching
Parallel searchingParallel searching
Parallel searching
Md. Mahedi Mahfuj
 
Paging.ppt
Paging.pptPaging.ppt
Paging.ppt
infomerlin
 
Memory management1
Memory management1Memory management1
Memory management1
rizwanaabassi
 
File organization 1
File organization 1File organization 1
File organization 1
Rupali Rana
 
Computer architecture multi processor
Computer architecture multi processorComputer architecture multi processor
Computer architecture multi processor
Mazin Alwaaly
 
Inter Process Communication
Inter Process CommunicationInter Process Communication
Inter Process Communication
Adeel Rasheed
 
Database replication
Database replicationDatabase replication
Database replication
Arslan111
 
Memory management
Memory managementMemory management
Memory management
Vishal Singh
 
Memory management
Memory managementMemory management
Memory management
CHANDERPRABHU JAIN COLLEGE OF HIGHER STUDIES & SCHOOL OF LAW
 
Process scheduling (CPU Scheduling)
Process scheduling (CPU Scheduling)Process scheduling (CPU Scheduling)
Process scheduling (CPU Scheduling)
Mukesh Chinta
 
Concurrency control
Concurrency controlConcurrency control
Concurrency control
Soumyajit Dutta
 
Multi processor scheduling
Multi  processor schedulingMulti  processor scheduling
Multi processor scheduling
Shashank Kapoor
 
Allocating of Frames.pptx
Allocating of Frames.pptxAllocating of Frames.pptx
Allocating of Frames.pptx
infomerlin
 
Demand paging
Demand pagingDemand paging
Demand paging
SwaroopSorte
 

Similar to Parallel Algorithms- Sorting and Graph (20)

Chap9 slides
Chap9 slidesChap9 slides
Chap9 slides
BaliThorat1
 
Sorting algorithms
Sorting algorithmsSorting algorithms
Sorting algorithms
Syed Zaid Irshad
 
Sequential and Parallel Searching Algorithms
Sequential and Parallel Searching AlgorithmsSequential and Parallel Searching Algorithms
Sequential and Parallel Searching Algorithms
Suresh Pokharel
 
Performance evaluation of parallel bubble sort algorithm on supercomputer IMAN1.
Performance evaluation of parallel bubble sort algorithm on supercomputer IMAN1.Performance evaluation of parallel bubble sort algorithm on supercomputer IMAN1.
Performance evaluation of parallel bubble sort algorithm on supercomputer IMAN1.
Shakil Ahmed
 
Parallel Processing Concepts
Parallel Processing Concepts Parallel Processing Concepts
Parallel Processing Concepts
Dr Shashikant Athawale
 
PriorityqDhruvBaswal.pptx
PriorityqDhruvBaswal.pptxPriorityqDhruvBaswal.pptx
PriorityqDhruvBaswal.pptx
ssuser17c9c21
 
Parallel search
Parallel searchParallel search
Parallel search
Md. Mahedi Mahfuj
 
Ch22 parallel d_bs_cs561
Ch22 parallel d_bs_cs561Ch22 parallel d_bs_cs561
Ch22 parallel d_bs_cs561
Shobhit Saxena
 
Parallel programming Comparisions
Parallel programming ComparisionsParallel programming Comparisions
Parallel programming Comparisions
Muhammad Bilal Khan
 
Analytical Models of Parallel Programs
Analytical Models of Parallel ProgramsAnalytical Models of Parallel Programs
Analytical Models of Parallel Programs
Dr Shashikant Athawale
 
Data Structures in C
Data Structures in CData Structures in C
Data Structures in C
Jabs6
 
Data Parallel and Object Oriented Model
Data Parallel and Object Oriented ModelData Parallel and Object Oriented Model
Data Parallel and Object Oriented Model
Nikhil Sharma
 
GRAPH MATCHING ALGORITHM FOR TASK ASSIGNMENT PROBLEM
GRAPH MATCHING ALGORITHM FOR TASK ASSIGNMENT PROBLEMGRAPH MATCHING ALGORITHM FOR TASK ASSIGNMENT PROBLEM
GRAPH MATCHING ALGORITHM FOR TASK ASSIGNMENT PROBLEM
IJCSEA Journal
 
Nbvtalkataitamimageprocessingconf
NbvtalkataitamimageprocessingconfNbvtalkataitamimageprocessingconf
Nbvtalkataitamimageprocessingconf
Nagasuri Bala Venkateswarlu
 
Deep Dive into Hyperparameter Tuning
Deep Dive into Hyperparameter TuningDeep Dive into Hyperparameter Tuning
Deep Dive into Hyperparameter Tuning
Shubhmay Potdar
 
Introsort or introspective sort
Introsort or introspective sortIntrosort or introspective sort
Introsort or introspective sort
Eftykhar Mahmud
 
DATA STRUCTURE ooooooooooooooooooooooooaaaaaaappt.pptx
DATA STRUCTURE ooooooooooooooooooooooooaaaaaaappt.pptxDATA STRUCTURE ooooooooooooooooooooooooaaaaaaappt.pptx
DATA STRUCTURE ooooooooooooooooooooooooaaaaaaappt.pptx
abhirana59
 
Data Structures 6
Data Structures 6Data Structures 6
Data Structures 6
Dr.Umadevi V
 
Sorting-Algorithms-A-Comprehensive-Guide.pptx
Sorting-Algorithms-A-Comprehensive-Guide.pptxSorting-Algorithms-A-Comprehensive-Guide.pptx
Sorting-Algorithms-A-Comprehensive-Guide.pptx
ReemEmad26
 
Chap11 slides
Chap11 slidesChap11 slides
Chap11 slides
BaliThorat1
 
Sequential and Parallel Searching Algorithms
Sequential and Parallel Searching AlgorithmsSequential and Parallel Searching Algorithms
Sequential and Parallel Searching Algorithms
Suresh Pokharel
 
Performance evaluation of parallel bubble sort algorithm on supercomputer IMAN1.
Performance evaluation of parallel bubble sort algorithm on supercomputer IMAN1.Performance evaluation of parallel bubble sort algorithm on supercomputer IMAN1.
Performance evaluation of parallel bubble sort algorithm on supercomputer IMAN1.
Shakil Ahmed
 
PriorityqDhruvBaswal.pptx
PriorityqDhruvBaswal.pptxPriorityqDhruvBaswal.pptx
PriorityqDhruvBaswal.pptx
ssuser17c9c21
 
Ch22 parallel d_bs_cs561
Ch22 parallel d_bs_cs561Ch22 parallel d_bs_cs561
Ch22 parallel d_bs_cs561
Shobhit Saxena
 
Parallel programming Comparisions
Parallel programming ComparisionsParallel programming Comparisions
Parallel programming Comparisions
Muhammad Bilal Khan
 
Analytical Models of Parallel Programs
Analytical Models of Parallel ProgramsAnalytical Models of Parallel Programs
Analytical Models of Parallel Programs
Dr Shashikant Athawale
 
Data Structures in C
Data Structures in CData Structures in C
Data Structures in C
Jabs6
 
Data Parallel and Object Oriented Model
Data Parallel and Object Oriented ModelData Parallel and Object Oriented Model
Data Parallel and Object Oriented Model
Nikhil Sharma
 
GRAPH MATCHING ALGORITHM FOR TASK ASSIGNMENT PROBLEM
GRAPH MATCHING ALGORITHM FOR TASK ASSIGNMENT PROBLEMGRAPH MATCHING ALGORITHM FOR TASK ASSIGNMENT PROBLEM
GRAPH MATCHING ALGORITHM FOR TASK ASSIGNMENT PROBLEM
IJCSEA Journal
 
Deep Dive into Hyperparameter Tuning
Deep Dive into Hyperparameter TuningDeep Dive into Hyperparameter Tuning
Deep Dive into Hyperparameter Tuning
Shubhmay Potdar
 
Introsort or introspective sort
Introsort or introspective sortIntrosort or introspective sort
Introsort or introspective sort
Eftykhar Mahmud
 
DATA STRUCTURE ooooooooooooooooooooooooaaaaaaappt.pptx
DATA STRUCTURE ooooooooooooooooooooooooaaaaaaappt.pptxDATA STRUCTURE ooooooooooooooooooooooooaaaaaaappt.pptx
DATA STRUCTURE ooooooooooooooooooooooooaaaaaaappt.pptx
abhirana59
 
Sorting-Algorithms-A-Comprehensive-Guide.pptx
Sorting-Algorithms-A-Comprehensive-Guide.pptxSorting-Algorithms-A-Comprehensive-Guide.pptx
Sorting-Algorithms-A-Comprehensive-Guide.pptx
ReemEmad26
 
Ad

More from Dr Shashikant Athawale (20)

multi threaded and distributed algorithms
multi threaded and distributed algorithms multi threaded and distributed algorithms
multi threaded and distributed algorithms
Dr Shashikant Athawale
 
Amortized analysis
Amortized analysisAmortized analysis
Amortized analysis
Dr Shashikant Athawale
 
Complexity theory
Complexity theory Complexity theory
Complexity theory
Dr Shashikant Athawale
 
Divide and Conquer
Divide and ConquerDivide and Conquer
Divide and Conquer
Dr Shashikant Athawale
 
Model and Design
Model and Design Model and Design
Model and Design
Dr Shashikant Athawale
 
Fundamental of Algorithms
Fundamental of Algorithms Fundamental of Algorithms
Fundamental of Algorithms
Dr Shashikant Athawale
 
CUDA Architecture
CUDA ArchitectureCUDA Architecture
CUDA Architecture
Dr Shashikant Athawale
 
Basic Communication
Basic CommunicationBasic Communication
Basic Communication
Dr Shashikant Athawale
 
Parallel Processing Concepts
Parallel Processing Concepts Parallel Processing Concepts
Parallel Processing Concepts
Dr Shashikant Athawale
 
Dynamic programming
Dynamic programmingDynamic programming
Dynamic programming
Dr Shashikant Athawale
 
Parallel algorithms
Parallel algorithms Parallel algorithms
Parallel algorithms
Dr Shashikant Athawale
 
Greedy method
Greedy method Greedy method
Greedy method
Dr Shashikant Athawale
 
Divide and conquer
Divide and conquerDivide and conquer
Divide and conquer
Dr Shashikant Athawale
 
Branch and bound
Branch and boundBranch and bound
Branch and bound
Dr Shashikant Athawale
 
Asymptotic notation
Asymptotic notationAsymptotic notation
Asymptotic notation
Dr Shashikant Athawale
 
String matching algorithms
String matching algorithmsString matching algorithms
String matching algorithms
Dr Shashikant Athawale
 
Advanced Wireless Technologies
Advanced Wireless TechnologiesAdvanced Wireless Technologies
Advanced Wireless Technologies
Dr Shashikant Athawale
 
Vo ip
Vo ipVo ip
Vo ip
Dr Shashikant Athawale
 
Vehicular network
Vehicular networkVehicular network
Vehicular network
Dr Shashikant Athawale
 
Delay telerant network
Delay telerant networkDelay telerant network
Delay telerant network
Dr Shashikant Athawale
 
Ad

Recently uploaded (20)

Value Stream Mapping Worskshops for Intelligent Continuous Security
Value Stream Mapping Worskshops for Intelligent Continuous SecurityValue Stream Mapping Worskshops for Intelligent Continuous Security
Value Stream Mapping Worskshops for Intelligent Continuous Security
Marc Hornbeek
 
Explainable-Artificial-Intelligence-XAI-A-Deep-Dive (1).pptx
Explainable-Artificial-Intelligence-XAI-A-Deep-Dive (1).pptxExplainable-Artificial-Intelligence-XAI-A-Deep-Dive (1).pptx
Explainable-Artificial-Intelligence-XAI-A-Deep-Dive (1).pptx
MahaveerVPandit
 
Raish Khanji GTU 8th sem Internship Report.pdf
Raish Khanji GTU 8th sem Internship Report.pdfRaish Khanji GTU 8th sem Internship Report.pdf
Raish Khanji GTU 8th sem Internship Report.pdf
RaishKhanji
 
Smart Storage Solutions.pptx for production engineering
Smart Storage Solutions.pptx for production engineeringSmart Storage Solutions.pptx for production engineering
Smart Storage Solutions.pptx for production engineering
rushikeshnavghare94
 
Machine learning project on employee attrition detection using (2).pptx
Machine learning project on employee attrition detection using (2).pptxMachine learning project on employee attrition detection using (2).pptx
Machine learning project on employee attrition detection using (2).pptx
rajeswari89780
 
Structural Response of Reinforced Self-Compacting Concrete Deep Beam Using Fi...
Structural Response of Reinforced Self-Compacting Concrete Deep Beam Using Fi...Structural Response of Reinforced Self-Compacting Concrete Deep Beam Using Fi...
Structural Response of Reinforced Self-Compacting Concrete Deep Beam Using Fi...
Journal of Soft Computing in Civil Engineering
 
Introduction to FLUID MECHANICS & KINEMATICS
Introduction to FLUID MECHANICS &  KINEMATICSIntroduction to FLUID MECHANICS &  KINEMATICS
Introduction to FLUID MECHANICS & KINEMATICS
narayanaswamygdas
 
IntroSlides-April-BuildWithAI-VertexAI.pdf
IntroSlides-April-BuildWithAI-VertexAI.pdfIntroSlides-April-BuildWithAI-VertexAI.pdf
IntroSlides-April-BuildWithAI-VertexAI.pdf
Luiz Carneiro
 
ELectronics Boards & Product Testing_Shiju.pdf
ELectronics Boards & Product Testing_Shiju.pdfELectronics Boards & Product Testing_Shiju.pdf
ELectronics Boards & Product Testing_Shiju.pdf
Shiju Jacob
 
π0.5: a Vision-Language-Action Model with Open-World Generalization
π0.5: a Vision-Language-Action Model with Open-World Generalizationπ0.5: a Vision-Language-Action Model with Open-World Generalization
π0.5: a Vision-Language-Action Model with Open-World Generalization
NABLAS株式会社
 
railway wheels, descaling after reheating and before forging
railway wheels, descaling after reheating and before forgingrailway wheels, descaling after reheating and before forging
railway wheels, descaling after reheating and before forging
Javad Kadkhodapour
 
QA/QC Manager (Quality management Expert)
QA/QC Manager (Quality management Expert)QA/QC Manager (Quality management Expert)
QA/QC Manager (Quality management Expert)
rccbatchplant
 
Smart_Storage_Systems_Production_Engineering.pptx
Smart_Storage_Systems_Production_Engineering.pptxSmart_Storage_Systems_Production_Engineering.pptx
Smart_Storage_Systems_Production_Engineering.pptx
rushikeshnavghare94
 
Avnet Silica's PCIM 2025 Highlights Flyer
Avnet Silica's PCIM 2025 Highlights FlyerAvnet Silica's PCIM 2025 Highlights Flyer
Avnet Silica's PCIM 2025 Highlights Flyer
WillDavies22
 
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITYADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ijscai
 
Metal alkyne complexes.pptx in chemistry
Metal alkyne complexes.pptx in chemistryMetal alkyne complexes.pptx in chemistry
Metal alkyne complexes.pptx in chemistry
mee23nu
 
DT REPORT by Tech titan GROUP to introduce the subject design Thinking
DT REPORT by Tech titan GROUP to introduce the subject design ThinkingDT REPORT by Tech titan GROUP to introduce the subject design Thinking
DT REPORT by Tech titan GROUP to introduce the subject design Thinking
DhruvChotaliya2
 
theory-slides-for react for beginners.pptx
theory-slides-for react for beginners.pptxtheory-slides-for react for beginners.pptx
theory-slides-for react for beginners.pptx
sanchezvanessa7896
 
fluke dealers in bangalore..............
fluke dealers in bangalore..............fluke dealers in bangalore..............
fluke dealers in bangalore..............
Haresh Vaswani
 
Level 1-Safety.pptx Presentation of Electrical Safety
Level 1-Safety.pptx Presentation of Electrical SafetyLevel 1-Safety.pptx Presentation of Electrical Safety
Level 1-Safety.pptx Presentation of Electrical Safety
JoseAlbertoCariasDel
 
Value Stream Mapping Worskshops for Intelligent Continuous Security
Value Stream Mapping Worskshops for Intelligent Continuous SecurityValue Stream Mapping Worskshops for Intelligent Continuous Security
Value Stream Mapping Worskshops for Intelligent Continuous Security
Marc Hornbeek
 
Explainable-Artificial-Intelligence-XAI-A-Deep-Dive (1).pptx
Explainable-Artificial-Intelligence-XAI-A-Deep-Dive (1).pptxExplainable-Artificial-Intelligence-XAI-A-Deep-Dive (1).pptx
Explainable-Artificial-Intelligence-XAI-A-Deep-Dive (1).pptx
MahaveerVPandit
 
Raish Khanji GTU 8th sem Internship Report.pdf
Raish Khanji GTU 8th sem Internship Report.pdfRaish Khanji GTU 8th sem Internship Report.pdf
Raish Khanji GTU 8th sem Internship Report.pdf
RaishKhanji
 
Smart Storage Solutions.pptx for production engineering
Smart Storage Solutions.pptx for production engineeringSmart Storage Solutions.pptx for production engineering
Smart Storage Solutions.pptx for production engineering
rushikeshnavghare94
 
Machine learning project on employee attrition detection using (2).pptx
Machine learning project on employee attrition detection using (2).pptxMachine learning project on employee attrition detection using (2).pptx
Machine learning project on employee attrition detection using (2).pptx
rajeswari89780
 
Introduction to FLUID MECHANICS & KINEMATICS
Introduction to FLUID MECHANICS &  KINEMATICSIntroduction to FLUID MECHANICS &  KINEMATICS
Introduction to FLUID MECHANICS & KINEMATICS
narayanaswamygdas
 
IntroSlides-April-BuildWithAI-VertexAI.pdf
IntroSlides-April-BuildWithAI-VertexAI.pdfIntroSlides-April-BuildWithAI-VertexAI.pdf
IntroSlides-April-BuildWithAI-VertexAI.pdf
Luiz Carneiro
 
ELectronics Boards & Product Testing_Shiju.pdf
ELectronics Boards & Product Testing_Shiju.pdfELectronics Boards & Product Testing_Shiju.pdf
ELectronics Boards & Product Testing_Shiju.pdf
Shiju Jacob
 
π0.5: a Vision-Language-Action Model with Open-World Generalization
π0.5: a Vision-Language-Action Model with Open-World Generalizationπ0.5: a Vision-Language-Action Model with Open-World Generalization
π0.5: a Vision-Language-Action Model with Open-World Generalization
NABLAS株式会社
 
railway wheels, descaling after reheating and before forging
railway wheels, descaling after reheating and before forgingrailway wheels, descaling after reheating and before forging
railway wheels, descaling after reheating and before forging
Javad Kadkhodapour
 
QA/QC Manager (Quality management Expert)
QA/QC Manager (Quality management Expert)QA/QC Manager (Quality management Expert)
QA/QC Manager (Quality management Expert)
rccbatchplant
 
Smart_Storage_Systems_Production_Engineering.pptx
Smart_Storage_Systems_Production_Engineering.pptxSmart_Storage_Systems_Production_Engineering.pptx
Smart_Storage_Systems_Production_Engineering.pptx
rushikeshnavghare94
 
Avnet Silica's PCIM 2025 Highlights Flyer
Avnet Silica's PCIM 2025 Highlights FlyerAvnet Silica's PCIM 2025 Highlights Flyer
Avnet Silica's PCIM 2025 Highlights Flyer
WillDavies22
 
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITYADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ijscai
 
Metal alkyne complexes.pptx in chemistry
Metal alkyne complexes.pptx in chemistryMetal alkyne complexes.pptx in chemistry
Metal alkyne complexes.pptx in chemistry
mee23nu
 
DT REPORT by Tech titan GROUP to introduce the subject design Thinking
DT REPORT by Tech titan GROUP to introduce the subject design ThinkingDT REPORT by Tech titan GROUP to introduce the subject design Thinking
DT REPORT by Tech titan GROUP to introduce the subject design Thinking
DhruvChotaliya2
 
theory-slides-for react for beginners.pptx
theory-slides-for react for beginners.pptxtheory-slides-for react for beginners.pptx
theory-slides-for react for beginners.pptx
sanchezvanessa7896
 
fluke dealers in bangalore..............
fluke dealers in bangalore..............fluke dealers in bangalore..............
fluke dealers in bangalore..............
Haresh Vaswani
 
Level 1-Safety.pptx Presentation of Electrical Safety
Level 1-Safety.pptx Presentation of Electrical SafetyLevel 1-Safety.pptx Presentation of Electrical Safety
Level 1-Safety.pptx Presentation of Electrical Safety
JoseAlbertoCariasDel
 

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.