120 likes | 135 Views
An Euler cycle in a graph is a cyclic path which traverses each edge of the graph exactly once. Parallel construction of Euler Cycle. Lecture 13. Euler cycle in a directed graph. Given: graph G Find: an Euler cycle of G (1) Creation of a set of edge disjoint cycles
E N D
An Euler cycle in a graph is a cyclic path which traverses each edge of the graph exactly once Parallel construction of Euler Cycle Lecture 13
Euler cycle in a directed graph • Given: graph G • Find: an Euler cycle of G (1) Creation of a set of edge disjoint cycles (2) Creation of a special biconncetd graph B between cycles and nodes of G (3) Parallel construction of a spanning tree T for the graph B (4) Construction an Euler tour C of a tree T by replacing each edge of T by two directed antiparallel edges (5) Converting the cycle C into an Euler cycle of G
Step 2: Creating an auxiliary graph G’, nodes of G’ are edge-disjoint cycles of G, and vertices of G. Each cycle is connected to vertices which lie on it For our example A PART of the graph G’ looks as follows; Step 3: Parallel construction of a spanning tree T for the graph B
Step 4: Construction an Euler tour C of a tree T by replacing each edge of T by two directed antiparallel edges
Euler paths on arbitrary graphs Complexity = O(log(n)) Sort using p processors = O(log n) with p > n
Euler paths on arbitrary graphs // input: n = num-nodes, m = num edges // output D = each edge labeled with representative // of each cycle // note: succ[in(v,k)] = out(k,v) par_for x = 1 ... m D[e[x]] = e[x] // every edge is a potential cycle-representative next[e[x]] = succ[e[x]] // scratch space for contraction for k = 1 ... ceil(log(n)) par_for x = 1 ... m D[e[x]] := min(D[e[x]], D[next[e[x]]]) next[e[x]] = next[next[e[x]]]