SlideShare uma empresa Scribd logo
1 de 3
Parallel Algorithms
Preorder Tree Traversal- The problem of preorder tree traversal may
look like sequential when viewed in terms of node traversal because to
assign labels to right sub tree we have to assign labels to left sub tree or
like that. But when viewed in terms of edges traversal the tree traversal
is viewed as traversal of linked list first when going towards downward
and another when going towards upwards. And linked list is processed
as parallel algorithm, which has four steps:
1. Construct singly linked list where nodes corresponds to upward or
downward edges of tree.
2. Assign weights to the node of the singly linked list. Assign weight
one to downward edge or zero to upwards edge.
3. Compute the rank of each element in the singly linked list.
4. Downward edges processors use the ranks to assign a preorder
traversal number to their associated nodes.
Data Structure- Every tree node has
Parent
Sibling (Right)
Child (leftmost )
The algorithm uses 2(n-1) processors for parallel computation, (n-1) for
downward edges and (n-1) for upward edges. All processors construct a
linked list corresponds to edges in the preorder traversal. They decide
which is next successor edge in traversal.
After construction of linked list, they assign position value to all nodes,
one for downward edges or 0 for upward edges. After that the pointer
jumping algorithm assigns final position to them.

Merging Two Sorted Lists
Merging of two sorted list algorithm can be performed in low time
using parallel algorithm. Optimal sequential algorithm can merge two
sorted list of n/2 elements in
time. And one parallel algorithm
using n processor can perform the task in
time by assigning
every element to its own processor.
Every Processor finds the position of its element using binary search.
And all n elements can be inserted into the merged list in constant
time.
First all processors are activated than they determine the range of
indices they are going to search. The processors associated with
elements in the upper half of the array will perform binary search on
elements in the lower half of the array and lower half elements
perform binary search on upper half elements of array.
The total operations have increased in parallel algorithm, by
to merge the lists.

to

Graph Coloring
We can assign a processor for every possible coloring of the graph, then
have each processor check to see if coloring is valid or not.
Let graph has n vertices, adjacencymatrix n x n and a constant c, a
processor is created for every possible coloring of the graph. Each
processor spends
time to determine if two adjacent vertices
have same color or not, if for any two adjacent vertices same color the
coloring is not valid.

Cost optimal parallel algorithmis an algorithm for which cost is in same
complexity as an optimal sequential algorithm.

Brent’s Theorem
According to Brent’s theorem “Given A, a parallel algorithm with
computation time t, if parallel algorithm A perform m computational
operations, then p processors can execute algorithm A in time
t+(m-1)/p”
According to Brent’s theorem to reduce the cost of parallel algorithm,
we must reduce the number of processors and use processors in
efficient manner.

Mais conteúdo relacionado

Destaque

Презентация по теме "Классный час"
Презентация по теме "Классный час"Презентация по теме "Классный час"
Презентация по теме "Классный час"
zarina2014
 
통일을 해야 하는 까닭
통일을 해야 하는 까닭통일을 해야 하는 까닭
통일을 해야 하는 까닭
지효 김
 
Online reputation management for car dealerships car dealer reputation mark...
Online reputation management for car dealerships   car dealer reputation mark...Online reputation management for car dealerships   car dealer reputation mark...
Online reputation management for car dealerships car dealer reputation mark...
Andrew Wroblewski
 
How does your media product represent particular social
How does your media product represent particular socialHow does your media product represent particular social
How does your media product represent particular social
salesian2014as
 
Beume junho16 pdf
Beume junho16 pdfBeume junho16 pdf
Beume junho16 pdf
Ume Maria
 

Destaque (12)

Презентация по теме "Классный час"
Презентация по теме "Классный час"Презентация по теме "Классный час"
Презентация по теме "Классный час"
 
At89c2051 Data sheet
At89c2051 Data sheetAt89c2051 Data sheet
At89c2051 Data sheet
 
통일을 해야 하는 까닭
통일을 해야 하는 까닭통일을 해야 하는 까닭
통일을 해야 하는 까닭
 
Online reputation management for car dealerships car dealer reputation mark...
Online reputation management for car dealerships   car dealer reputation mark...Online reputation management for car dealerships   car dealer reputation mark...
Online reputation management for car dealerships car dealer reputation mark...
 
Asamblare calculator
Asamblare calculatorAsamblare calculator
Asamblare calculator
 
How does your media product represent particular social
How does your media product represent particular socialHow does your media product represent particular social
How does your media product represent particular social
 
Beume junho16 pdf
Beume junho16 pdfBeume junho16 pdf
Beume junho16 pdf
 
EES Hub Intro
EES Hub IntroEES Hub Intro
EES Hub Intro
 
Partea 3
Partea 3Partea 3
Partea 3
 
Sinister Movie Review
Sinister Movie ReviewSinister Movie Review
Sinister Movie Review
 
Cuéllar
CuéllarCuéllar
Cuéllar
 
BS170 Transistor data sheet
BS170 Transistor data sheetBS170 Transistor data sheet
BS170 Transistor data sheet
 

Último

Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
ssuserdda66b
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 

Último (20)

Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 

Parallel and distributed algorithm

  • 1. Parallel Algorithms Preorder Tree Traversal- The problem of preorder tree traversal may look like sequential when viewed in terms of node traversal because to assign labels to right sub tree we have to assign labels to left sub tree or like that. But when viewed in terms of edges traversal the tree traversal is viewed as traversal of linked list first when going towards downward and another when going towards upwards. And linked list is processed as parallel algorithm, which has four steps: 1. Construct singly linked list where nodes corresponds to upward or downward edges of tree. 2. Assign weights to the node of the singly linked list. Assign weight one to downward edge or zero to upwards edge. 3. Compute the rank of each element in the singly linked list. 4. Downward edges processors use the ranks to assign a preorder traversal number to their associated nodes. Data Structure- Every tree node has Parent Sibling (Right) Child (leftmost ) The algorithm uses 2(n-1) processors for parallel computation, (n-1) for downward edges and (n-1) for upward edges. All processors construct a linked list corresponds to edges in the preorder traversal. They decide which is next successor edge in traversal.
  • 2. After construction of linked list, they assign position value to all nodes, one for downward edges or 0 for upward edges. After that the pointer jumping algorithm assigns final position to them. Merging Two Sorted Lists Merging of two sorted list algorithm can be performed in low time using parallel algorithm. Optimal sequential algorithm can merge two sorted list of n/2 elements in time. And one parallel algorithm using n processor can perform the task in time by assigning every element to its own processor. Every Processor finds the position of its element using binary search. And all n elements can be inserted into the merged list in constant time. First all processors are activated than they determine the range of indices they are going to search. The processors associated with elements in the upper half of the array will perform binary search on elements in the lower half of the array and lower half elements perform binary search on upper half elements of array. The total operations have increased in parallel algorithm, by to merge the lists. to Graph Coloring We can assign a processor for every possible coloring of the graph, then have each processor check to see if coloring is valid or not. Let graph has n vertices, adjacencymatrix n x n and a constant c, a processor is created for every possible coloring of the graph. Each processor spends time to determine if two adjacent vertices
  • 3. have same color or not, if for any two adjacent vertices same color the coloring is not valid. Cost optimal parallel algorithmis an algorithm for which cost is in same complexity as an optimal sequential algorithm. Brent’s Theorem According to Brent’s theorem “Given A, a parallel algorithm with computation time t, if parallel algorithm A perform m computational operations, then p processors can execute algorithm A in time t+(m-1)/p” According to Brent’s theorem to reduce the cost of parallel algorithm, we must reduce the number of processors and use processors in efficient manner.