SlideShare une entreprise Scribd logo
1  sur  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.

Contenu connexe

En vedette

Презентация по теме "Классный час"
Презентация по теме "Классный час"Презентация по теме "Классный час"
Презентация по теме "Классный час"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
 
Asamblare calculator
Asamblare calculatorAsamblare calculator
Asamblare calculatorIonut Tabara
 
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 socialsalesian2014as
 
Beume junho16 pdf
Beume junho16 pdfBeume junho16 pdf
Beume junho16 pdfUme Maria
 

En vedette (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
 

Dernier

Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajanpragatimahajan3
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...PsychoTech Services
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024Janet Corral
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingTeacherCyreneCayanan
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 

Dernier (20)

Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 

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.