Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
30 views
Parallel Graph Search Algorithms
Uploaded by
Geeta Meena
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save Parallel Graph Search Algorithms For Later
Download
Save
Save Parallel Graph Search Algorithms For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
0 ratings
0% found this document useful (0 votes)
30 views
Parallel Graph Search Algorithms
Uploaded by
Geeta Meena
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save Parallel Graph Search Algorithms For Later
Carousel Previous
Carousel Next
Save
Save Parallel Graph Search Algorithms For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
You are on page 1
/ 13
Search
Fullscreen
324 72 Parallel Processing and Parallel Algorithms 3. Those processor P, for which x = Ey. juqo, Update index=(k ~ 1)(n/N)+j In general, the parallel algorithm can be represented as follows to address the speedup over the sequential version. Procedure Parallel-Divide-and-Conquer(Input, Output) Divide(Input, Input, Input, ...mput,) for i= 1 tom do in parallel, Parallel-Divide-and-Conquer(Input,, Output, Input,, Output, Inpat,, Output,) endfor Combine(Output,, Output, ...Output,, Output) End Parallel-Divide-and-Conquer Depth-First Search Sequential graph algorithms often employ some form of graph traversal, which is equivalent to tracing the edges of a spanning tree of the graph, Perhaps, from the sequential complexity point of view, the most successful and commonly used form of graph traversal is the Depth-First Search (DFS). The importance of the depth-first search is that many efficient sequential algorithms on graphs use DFS as the basic procedure. The graph G is represented by its adjacency list and for each vertex v there is a list of all vertices adjacent to v. Depth-first search is the process of searching a graph in such a way that the search moves forward until it reaches a vertex whose neighbors have all been examined. At this point it backtracks a minimum distance and continues in a new direction. In other words, in a depth-first search, if v is the vertex being searched from (starting vertex), (v.w) is the edge being examined and w is unvisited, w will be the next vertex searched from (the new starting point). The DFS is called recursively. However, if vis the starting vertex and (v,w) is the edge being examined and w is already visited, v remains the vertex being searched from, and another ver- tex adjacent to v which has not been visited, is chosen as the vertex to be ex- amined. This indicates that in the DFS strategy the vertices are examined in or- der of decreasing depth in the tree. Although in a depth-first search it is not required the children of a vertex be visited in any particular order, we follow the convention that the children of a vertex are visited from left to right. The depth-first search algorithm assigns a number to each vertex v which specifies the order in which the vertex is visited during the graph traversal. This number is called the depth-first index of the vertex. Formally, the DFS is described as follows.Chapter 7. Parallel Search Algorithms 325 Depth-First-Search (DFS) Input: A directed connected graph G and a specified starting vertex v. Output: The depth-first indices of the vertices of G starting with v = 1. ie 7.2 shows a depth-first search of a tree performed in this manner such that the vertices are numbered in the order they are visited, with the starting vertex being A. The sequential DFS can be represented in terms of the following recursive procedure. The algorithm is called a depth-first search because it initi- ates as many recursive calls as possible before it ever returns from a call. The recursion stops only when exploration of the graph is blocked and can go no further. At this point the recursion stops so alternate possibilities at higher levels, ccan be explored. ABCDEFGH BAA A AE AE c FGF F D HOH E G @ ® © @ Figure 7.2. A graph and its comesponding depth-first tree. (a) Graph G. (b) Adjacency of graph G. (c) Depth-fist tre obtained from depth-first traversal. (4) Depth-first index tree obtained from depth-first traversal. Procedure Depth-First(A) begin mark every vertex “unvisited” veestart vertex ‘1 vis the vertex being searched from */ Call Depth-First-Search(v)326 Parallel Processing and Parallel Algorithms Procedure Depth-First-Search(v) begin mark v “visited” for each vertex w adjacent to v do if w is marked “unvisited” then Call Depth-First-Search(w) endfor End Depth-First-Search end End Depth-First We analyze the time complexity of DFS in a graph with n vertices and m edges, with respect to two basic operations, visiting a vertex and examining a vertex, to determine if it has been visited. The worst-case complexity for both operations occurs when the graph is connected. If the graph is connected, we can verify that every vertex is visited exactly once with a total of n vertex visits. Each edge in the graph addresses exactly two vertex examinations, thus yielding the number of vertices to be examined as 2m. Therefore, the total number of op- erations by DFS in the worst-case is n + 2m, resulting in a complexity of O(n + m). In general, parallel processing is a major approach to enhance the efficiency of search algorithms. We focus entirely on bounded parallelism, which corre- sponds to the more realistic assumption that a given computing system has only a fixed number of processors functioning in parallel. The computational eff ciency of the algorithms depends on the data structure and the search strategies. Alton and Eckstein [Alton 77} proposed a parallel algorithm for a depth-first search. Reghbati and Corneil [Reghbati 78] conjectured that a depth-first search ‘was inherently sequential. It is generally assumed that the use of DFS is incom- patible with efforts to process the search space in parallel, meaning it seems that the problem of finding a depth-first search tree is hardly parallelizable. Hence, ‘many fast parallel computations in graph theory avoid depth-first search com- putations. For the moment, consider the instructions of the depth-first search procedure given earlier. The crucial issue in an effort to parallelize the algorithm. are the lines for each vertex w adjacent to v do if w is marked “unvisited" then .. ‘which mean to find the next unvisited vertex on the adjacency list of v. Alterna- tively, instead of an adjacency list representation of the adjacent vertices to each vertex, we consider an “adjacency list matrix” such that every row represents all the adjacent vertices to each vertex. With this assumption, different processors can simultaneously examine successive vertices to identify whether they are visited or unvisited. We also define an “unvisited adjacency list” U(v) whichChapter 7. Parallel Search Algorithms 327 lists all vertices that are adjacent to v and are still labeled “unvisited.” As soon as a vertex w is “visited,” it will be removed from the lists U(v) for all v adja- ‘cent to w. Of course, the problem of finding an “unvisited” vertex adjacent to v now becomes trivial, by taking the first element of U(v) if U(v) is not empty. Such an approach of deleting elements from “unvisited” adjacent lists is com- patible with DFS, since the flow of control of DFS-based algorithms, the order in which the various recursive calls are performed, depends only on the vertices which remain “unvisited.” In this approach the need for communication between processors is eliminated. Two lists, ARC_LIST and FROND_LIST, as the output of the DFS are de- fined such that the final FROND_LIST(v) isa list of vertices w such that there is 1 frond from v to w, and the final ARC_LIST is a list of vertices w such that there is an arc from v to w. Figure 7.3 illustrates the representation of a graph in the adjacency list matrix, adjacency list, associated end-marker vector, and un- visited adjacency matrix forms. The Adjacency List visit i 1): 2434 45 ml UC): null 32 3 4> null ‘L(2): 1 null U(2): null > 1 null 3): 1 null U@3): null 1 — null ‘1L(4): 1 null ‘U(4): null 31 > null ‘The Adjacency List Matrix The er 132331 133 231-300 271 331300 31 4-100 451 Figure 7.3. Representation of graph regarding different forms. A parallel depth-first search algorithm is now defined follows.328 Parallel Processing and Parallel Algorithms Input: Adjacency list matrix, ALM(L:n,I:n—1), the associated end-marker vector EM(|:n), the initial unvisited adjacency list, U(), 1 Si
You might also like
The Subtle Art of Not Giving a F*ck: A Counterintuitive Approach to Living a Good Life
From Everand
The Subtle Art of Not Giving a F*ck: A Counterintuitive Approach to Living a Good Life
Mark Manson
4/5 (6129)
Principles: Life and Work
From Everand
Principles: Life and Work
Ray Dalio
4/5 (627)
The Gifts of Imperfection: Let Go of Who You Think You're Supposed to Be and Embrace Who You Are
From Everand
The Gifts of Imperfection: Let Go of Who You Think You're Supposed to Be and Embrace Who You Are
Brené Brown
4/5 (1148)
Never Split the Difference: Negotiating As If Your Life Depended On It
From Everand
Never Split the Difference: Negotiating As If Your Life Depended On It
Chris Voss
4.5/5 (934)
The Glass Castle: A Memoir
From Everand
The Glass Castle: A Memoir
Jeannette Walls
4/5 (8215)
Grit: The Power of Passion and Perseverance
From Everand
Grit: The Power of Passion and Perseverance
Angela Duckworth
4/5 (631)
Sing, Unburied, Sing: A Novel
From Everand
Sing, Unburied, Sing: A Novel
Jesmyn Ward
4/5 (1253)
The Perks of Being a Wallflower
From Everand
The Perks of Being a Wallflower
Stephen Chbosky
4/5 (8365)
Shoe Dog: A Memoir by the Creator of Nike
From Everand
Shoe Dog: A Memoir by the Creator of Nike
Phil Knight
4.5/5 (860)
Her Body and Other Parties: Stories
From Everand
Her Body and Other Parties: Stories
Carmen Maria Machado
4/5 (877)
The Hard Thing About Hard Things: Building a Business When There Are No Easy Answers
From Everand
The Hard Thing About Hard Things: Building a Business When There Are No Easy Answers
Ben Horowitz
4.5/5 (361)
Hidden Figures: The American Dream and the Untold Story of the Black Women Mathematicians Who Helped Win the Space Race
From Everand
Hidden Figures: The American Dream and the Untold Story of the Black Women Mathematicians Who Helped Win the Space Race
Margot Lee Shetterly
4/5 (954)
Steve Jobs
From Everand
Steve Jobs
Walter Isaacson
4/5 (2923)
Elon Musk: Tesla, SpaceX, and the Quest for a Fantastic Future
From Everand
Elon Musk: Tesla, SpaceX, and the Quest for a Fantastic Future
Ashlee Vance
4.5/5 (484)
The Emperor of All Maladies: A Biography of Cancer
From Everand
The Emperor of All Maladies: A Biography of Cancer
Siddhartha Mukherjee
4.5/5 (277)
A Man Called Ove: A Novel
From Everand
A Man Called Ove: A Novel
Fredrik Backman
4.5/5 (4972)
Angela's Ashes: A Memoir
From Everand
Angela's Ashes: A Memoir
Frank McCourt
4.5/5 (444)
Brooklyn: A Novel
From Everand
Brooklyn: A Novel
Colm Toibin
3.5/5 (2061)
The Art of Racing in the Rain: A Novel
From Everand
The Art of Racing in the Rain: A Novel
Garth Stein
4/5 (4281)
The Yellow House: A Memoir (2019 National Book Award Winner)
From Everand
The Yellow House: A Memoir (2019 National Book Award Winner)
Sarah M. Broom
4/5 (100)
The Little Book of Hygge: Danish Secrets to Happy Living
From Everand
The Little Book of Hygge: Danish Secrets to Happy Living
Meik Wiking
3.5/5 (447)
Yes Please
From Everand
Yes Please
Amy Poehler
4/5 (1987)
Devil in the Grove: Thurgood Marshall, the Groveland Boys, and the Dawn of a New America
From Everand
Devil in the Grove: Thurgood Marshall, the Groveland Boys, and the Dawn of a New America
Gilbert King
4.5/5 (278)
The World Is Flat 3.0: A Brief History of the Twenty-first Century
From Everand
The World Is Flat 3.0: A Brief History of the Twenty-first Century
Thomas L. Friedman
3.5/5 (2283)
Bad Feminist: Essays
From Everand
Bad Feminist: Essays
Roxane Gay
4/5 (1068)
The Woman in Cabin 10
From Everand
The Woman in Cabin 10
Ruth Ware
3.5/5 (2641)
The Outsider: A Novel
From Everand
The Outsider: A Novel
Stephen King
4/5 (1993)
A Tree Grows in Brooklyn
From Everand
A Tree Grows in Brooklyn
Betty Smith
4.5/5 (1936)
The Sympathizer: A Novel (Pulitzer Prize for Fiction)
From Everand
The Sympathizer: A Novel (Pulitzer Prize for Fiction)
Viet Thanh Nguyen
4.5/5 (125)
A Heartbreaking Work Of Staggering Genius: A Memoir Based on a True Story
From Everand
A Heartbreaking Work Of Staggering Genius: A Memoir Based on a True Story
Dave Eggers
3.5/5 (692)
Team of Rivals: The Political Genius of Abraham Lincoln
From Everand
Team of Rivals: The Political Genius of Abraham Lincoln
Doris Kearns Goodwin
4.5/5 (1912)
Wolf Hall: A Novel
From Everand
Wolf Hall: A Novel
Hilary Mantel
4/5 (4074)
On Fire: The (Burning) Case for a Green New Deal
From Everand
On Fire: The (Burning) Case for a Green New Deal
Naomi Klein
4/5 (75)
Fear: Trump in the White House
From Everand
Fear: Trump in the White House
Bob Woodward
3.5/5 (830)
Manhattan Beach: A Novel
From Everand
Manhattan Beach: A Novel
Jennifer Egan
3.5/5 (901)
Rise of ISIS: A Threat We Can't Ignore
From Everand
Rise of ISIS: A Threat We Can't Ignore
Jay Sekulow
3.5/5 (143)
John Adams
From Everand
John Adams
David McCullough
4.5/5 (2544)
The Light Between Oceans: A Novel
From Everand
The Light Between Oceans: A Novel
M L Stedman
4.5/5 (790)
Parallel DFS and BFS
PDF
No ratings yet
Parallel DFS and BFS
35 pages
Amdahl's Law
PDF
No ratings yet
Amdahl's Law
25 pages
Motilal Nehru National Institute of Technology Allahabad, Prayagraj Computer Science & Engineering Department Formal Methods Lab - CS18201 (CS-8 Sem) Assignment-3 1
PDF
No ratings yet
Motilal Nehru National Institute of Technology Allahabad, Prayagraj Computer Science & Engineering Department Formal Methods Lab - CS18201 (CS-8 Sem) Assignment-3 1
2 pages
Flynn's Classification
PDF
No ratings yet
Flynn's Classification
9 pages
Microprocessor
PDF
No ratings yet
Microprocessor
105 pages
The Unwinding: An Inner History of the New America
From Everand
The Unwinding: An Inner History of the New America
George Packer
4/5 (45)
Little Women
From Everand
Little Women
Louisa Alcott
4/5 (105)
The Constant Gardener: A Novel
From Everand
The Constant Gardener: A Novel
John le Carré
3.5/5 (109)
Related titles
Click to expand Related Titles
Carousel Previous
Carousel Next
The Subtle Art of Not Giving a F*ck: A Counterintuitive Approach to Living a Good Life
From Everand
The Subtle Art of Not Giving a F*ck: A Counterintuitive Approach to Living a Good Life
Principles: Life and Work
From Everand
Principles: Life and Work
The Gifts of Imperfection: Let Go of Who You Think You're Supposed to Be and Embrace Who You Are
From Everand
The Gifts of Imperfection: Let Go of Who You Think You're Supposed to Be and Embrace Who You Are
Never Split the Difference: Negotiating As If Your Life Depended On It
From Everand
Never Split the Difference: Negotiating As If Your Life Depended On It
The Glass Castle: A Memoir
From Everand
The Glass Castle: A Memoir
Grit: The Power of Passion and Perseverance
From Everand
Grit: The Power of Passion and Perseverance
Sing, Unburied, Sing: A Novel
From Everand
Sing, Unburied, Sing: A Novel
The Perks of Being a Wallflower
From Everand
The Perks of Being a Wallflower
Shoe Dog: A Memoir by the Creator of Nike
From Everand
Shoe Dog: A Memoir by the Creator of Nike
Her Body and Other Parties: Stories
From Everand
Her Body and Other Parties: Stories
The Hard Thing About Hard Things: Building a Business When There Are No Easy Answers
From Everand
The Hard Thing About Hard Things: Building a Business When There Are No Easy Answers
Hidden Figures: The American Dream and the Untold Story of the Black Women Mathematicians Who Helped Win the Space Race
From Everand
Hidden Figures: The American Dream and the Untold Story of the Black Women Mathematicians Who Helped Win the Space Race
Steve Jobs
From Everand
Steve Jobs
Elon Musk: Tesla, SpaceX, and the Quest for a Fantastic Future
From Everand
Elon Musk: Tesla, SpaceX, and the Quest for a Fantastic Future
The Emperor of All Maladies: A Biography of Cancer
From Everand
The Emperor of All Maladies: A Biography of Cancer
A Man Called Ove: A Novel
From Everand
A Man Called Ove: A Novel
Angela's Ashes: A Memoir
From Everand
Angela's Ashes: A Memoir
Brooklyn: A Novel
From Everand
Brooklyn: A Novel
The Art of Racing in the Rain: A Novel
From Everand
The Art of Racing in the Rain: A Novel
The Yellow House: A Memoir (2019 National Book Award Winner)
From Everand
The Yellow House: A Memoir (2019 National Book Award Winner)
The Little Book of Hygge: Danish Secrets to Happy Living
From Everand
The Little Book of Hygge: Danish Secrets to Happy Living
Yes Please
From Everand
Yes Please
Devil in the Grove: Thurgood Marshall, the Groveland Boys, and the Dawn of a New America
From Everand
Devil in the Grove: Thurgood Marshall, the Groveland Boys, and the Dawn of a New America
The World Is Flat 3.0: A Brief History of the Twenty-first Century
From Everand
The World Is Flat 3.0: A Brief History of the Twenty-first Century
Bad Feminist: Essays
From Everand
Bad Feminist: Essays
The Woman in Cabin 10
From Everand
The Woman in Cabin 10
The Outsider: A Novel
From Everand
The Outsider: A Novel
A Tree Grows in Brooklyn
From Everand
A Tree Grows in Brooklyn
The Sympathizer: A Novel (Pulitzer Prize for Fiction)
From Everand
The Sympathizer: A Novel (Pulitzer Prize for Fiction)
A Heartbreaking Work Of Staggering Genius: A Memoir Based on a True Story
From Everand
A Heartbreaking Work Of Staggering Genius: A Memoir Based on a True Story
Team of Rivals: The Political Genius of Abraham Lincoln
From Everand
Team of Rivals: The Political Genius of Abraham Lincoln
Wolf Hall: A Novel
From Everand
Wolf Hall: A Novel
On Fire: The (Burning) Case for a Green New Deal
From Everand
On Fire: The (Burning) Case for a Green New Deal
Fear: Trump in the White House
From Everand
Fear: Trump in the White House
Manhattan Beach: A Novel
From Everand
Manhattan Beach: A Novel
Rise of ISIS: A Threat We Can't Ignore
From Everand
Rise of ISIS: A Threat We Can't Ignore
John Adams
From Everand
John Adams
The Light Between Oceans: A Novel
From Everand
The Light Between Oceans: A Novel
Parallel DFS and BFS
PDF
Parallel DFS and BFS
Amdahl's Law
PDF
Amdahl's Law
Motilal Nehru National Institute of Technology Allahabad, Prayagraj Computer Science & Engineering Department Formal Methods Lab - CS18201 (CS-8 Sem) Assignment-3 1
PDF
Motilal Nehru National Institute of Technology Allahabad, Prayagraj Computer Science & Engineering Department Formal Methods Lab - CS18201 (CS-8 Sem) Assignment-3 1
Flynn's Classification
PDF
Flynn's Classification
Microprocessor
PDF
Microprocessor
The Unwinding: An Inner History of the New America
From Everand
The Unwinding: An Inner History of the New America
Little Women
From Everand
Little Women
The Constant Gardener: A Novel
From Everand
The Constant Gardener: A Novel