An Euler cycle in a graph is a

  • Slides: 12
Download presentation
An Euler cycle in a graph is a cyclic path which traverses each edge

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

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

Graph G

Graph G

Step 1: Creation of a set of edge disjoint cycles

Step 1: Creation of a set of edge disjoint cycles

Step 2: Creating an auxiliary graph G’, nodes of G’ are edge-disjoint cycles of

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

Step 4: Construction an Euler tour C of a tree T by replacing each edge of T by two directed antiparallel edges

Step 5: Converting the cycle C into an Euler cycle of G

Step 5: Converting the cycle C into an Euler cycle of G

Euler paths on arbitrary graphs

Euler paths on arbitrary graphs

Euler paths on arbitrary graphs Complexity = O(log(n)) Sort using p processors = O(log

Euler paths on arbitrary graphs Complexity = O(log(n)) Sort using p processors = O(log n) with p > n

Euler paths on arbitrary graphs

Euler paths on arbitrary graphs

Euler paths on arbitrary graphs // input: n = num-nodes, m = num edges

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[e[x]]]