0% found this document useful (0 votes)
3 views

Parallel and Distributed lec 11

The document discusses parallel and distributed computing, focusing on parallel search and sorting algorithms. It explains how parallel searching improves efficiency by utilizing multiple processors to search datasets simultaneously, and details various algorithms such as Depth-First Search and Best-First Search. Additionally, it covers parallel sorting methods like Enumeration Sort, Parallel Merge Sort, and Hyper Quick Sort.

Uploaded by

reactuser76
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Parallel and Distributed lec 11

The document discusses parallel and distributed computing, focusing on parallel search and sorting algorithms. It explains how parallel searching improves efficiency by utilizing multiple processors to search datasets simultaneously, and details various algorithms such as Depth-First Search and Best-First Search. Additionally, it covers parallel sorting methods like Enumeration Sort, Parallel Merge Sort, and Hyper Quick Sort.

Uploaded by

reactuser76
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 15

Parallel and Distributed

Computing
COMP3139
Contents

Parallel Search
• Searching Algorithms
• Examples
• Parallel sort
• Sorting Algorithm
• Examples
PARALLEL SEARCH

• Parallel searching is the process of searching for a target


element or solution in a dataset using multiple processors
or threads simultaneously.
• Reduce the time it takes to find a specific item.
• By dividing the search workload across multiple
processing units, the search process becomes more
efficient compared to sequential searching.

3
PARALLEL SEARCH

• Example:
• Suppose you have a large array of numbers, and you want to find if a
specific number exists in this array.
• In sequential search (linear search), you would check each element one
by one until you either find the number or reach the end of the array. This
is slow for large datasets.
• Divide the array into multiple sections and assign each section to a
different processor or thread.

4
PARALLEL SEARCH ALGORITHM

1. Divide and Conquer


• In divide and conquer approach,
the problem is divided into several
small sub-problems.
• Then the sub-problems are solved
recursively and combined to get
the solution of the original problem.

5
PARALLEL SEARCH ALGORITHM

2. Depth-First Search
Depth-First Search (or DFS) is an algorithm for searching a tree or an
undirected graph data structure.
Concept is to start from the starting node known as the root and traverse
as far as possible in the same branch.
If we get a node with no successor node, we return and continue with the
vertex, which is yet to be visited.

6
PARALLEL SEARCH ALGORITHM

2. Depth-First Search
• Consider a node (root) that is not
visited previously and mark it visited.
• Visit the first adjacent successor node
and mark it visited.
• If all the successors' nodes of the
considered node are already visited or
it doesn’t have any more successor
node, return to its parent node.

7
PARALLEL SEARCH ALGORITHM

3. Best-First Search
• Best-First Search is an algorithm that traverses a graph to reach a target in the
shortest possible path. Unlike BFS and DFS,
• Start with the root node, mark it visited.
• Find the next appropriate node and mark it visited.
• Go to the next level and find the appropriate node and mark it visited.
• Continue this process until the target is reached.

8
PARALLEL SEARCH ALGORITHM

3. Best-First Search
Pseudocode

9
PARALLEL SORTING

• Sorting is a process of arranging elements in a group in a particular order, i.e.,


ascending order, descending order, alphabetic order, etc.

1.Enumeration Sort
• Enumeration sort is a method of arranging all the elements in a list by
finding the final position of each element in a sorted list.
• It is done by comparing each element with all other elements and finding the
number of elements having smaller value.

10
PARALLEL SORTING

• Therefore, for any two


elements, ai and aj any one of
the following cases must be
true

11
PARALLEL SORTING

2. Parallel Merge Sort


• Merge sort first divides the unsorted
list into smallest possible sub-lists,
compares it with the adjacent list,
and merges it in a sorted order.
• It implements parallelism very nicely
by following the divide and conquer
algorithm.

12
PARALLEL SORTING

2. Parallel Merge
Sort
Algorithm:

13
PARALLEL SORTING

3. Hyper Quick Sort


• Hyper quick sort is an implementation of quick sort on hypercube. Its
steps are as follows −
• Divide the unsorted list among each node.
• Sort each node locally.
• From node 0, broadcast the median value.
• Split each list locally, then exchange the halves across the highest
dimension.
• Repeat steps 3 and 4 in parallel until the dimension reaches 0.
14
THANK YOU

You might also like