Lecture 013 - Graph Contraction

Graph partition (part, block): partition of a graph G into several vertex-induced subgraphs of G.

Making connected component (in undirected graph) a block will result no cut edge between the blocks.

Example partition. We can write klzzwxh:0002 or simply klzzwxh:0003

Example partition. We can write (\{abc, d, ef\}, \{a \to abc, b \to abc, c \to abc, d \to d, e \to ef, f \to ef\}) or simply (\{a, d, ef\}, \{a \to a, b \to a, c \to a, d \to d, e \to e, f \to e\})

Graph contraction: a contraction technique for computing properties of graphs in parallel. As a contraction technique, it is used to solve a problem instance by reducing it to a smaller instance of the same problem.

graph partitioning problems are typically NP-hard.

General Strategy:

When you contract, there might be multiple edges in the quotient graph connecting two super-vertex. We can choose to remove duplicate or work with multigraph, depending on applications.

The ultimate goal of graph contraction technique is to reduce the size of the graph by a constant fraction (possibly in expectation) at each round of contraction. Graph contraction technique does not specify which contraction strategy to use.

Edge Contraction

Example of Edge Partition

Example of Edge Partition

Edge contraction: a graph contraction where blocks being contracted correspond to edges.

Edge partition: a graph partition where each block is either a single vertex or two vertices connected by an edge.

To find edge partition, we need to solve vertex matching problem.

Vertex Maching Example: There are two matched edge and two unmatched vertex. The match size is 2. This is not a maximum maching since klzzwxh:0006 is a better maching.

Vertex Maching Example: There are two matched edge and two unmatched vertex. The match size is 2. This is not a maximum maching since \{(a,c), (b, d), (e,f)\} is a better maching.

Vertex Matching: pick maximum edges that don't share endpoint, which can be solved in O(|E|\sqrt{|V|}) work.

For edge contraction, we do not need a maximum matching but one that it is sufficiently large.

We will use Vertex Matching as a way to select edges to contract in a round.

Greedy Vertex Matching

Greedy Vertex Matching: it finds a solution within a factor 2 of optimal.

  1. initialize empty edge set M, copy edge list to E from the original graph
  2. pick arbitrary edge (u, v) from E
  3. if u, v \not\in M, then add (u, v) to M
  4. else remove (u, v) from E

The greedy algorithm is sequential, because each decision depends on previous decisions.

Randomized Parallel Vertex Macthing

Parallel Vertex Matching: method 1

  1. flip a coin for each edge
  2. select all edges if (1) the edge is HEAD (2) all nearby edges are TAIL

The probability of selecting an edge in a circle-graph is \frac{1}{8}, and so \frac{1}{8} of the edge will be selected in expectation in a circle-graph.

Parallel Vertex Matching: method 2

  1. each vertex u pick one of its neighbor v \in (V - \{u\})
  2. select the edge (u, v) only when u picked v and v picked u

The expected number of edge selected is \frac{1}{4} in a circle-graph. (Of course, worse as the degree of vertex increase.)

Parallel Vertex Matching: method 3

  1. each edge pick a floating point number
  2. select te edge if it is local maximum

The expected number of edge selected is \frac{1}{3}.

Edge Partition doesn't work quiet well with vertices with high degree. If there is a vertex with high degree, then only one of its edges can be selected. Star graphs are a canonical example of such graphs, although there are many others.

Edge contraction therefore is not effective for general graphs.

Edge Contraction

So if we guarantee a fraction of edges will be selected, then contraction will end in O(k\log |E|) rounds with high probability.

Star Contraction

Stargraph:

a single vertex, and a single edge are stargraph.

star partition: partition the graph in a way that each block is a vertex-induced subgraph that is a stargraph

Star Partition

Partition a graph to stars. There are two disjoint stars: red and green. Note that the middle vertex is contained in green, but not in red, making two stars disjoint.

Partition a graph to stars. There are two disjoint stars: red and green. Note that the middle vertex is contained in green, but not in red, making two stars disjoint.

Sequential Construction: We can construct a star partition sequentially by iteratively adding stars until the vertices are exhausted

  1. Select an arbitrary vertex v from the graph and make v the center of a star.
  2. Attach as satellites all the neighbors of v in the graph.
  3. Remove v and its satellites from the graph.
  4. Jump to 1 until all vertices removed

Parallel Star Partition

Parallel Star Partition

Parallel Construction: randomly assign "leader" (center), if no leader nearby, elect one.

  1. Flip a coin for each vertex.
  2. If a vertex flips heads, then it becomes the center of a star.
  3. If a vertex flips tails, then there are two cases.
    1. The vertex has a neighbor that flips heads. In this case, the vertex selects the neighbor (breaking ties arbitrarily) and becomes a satellite.
    2. The vertex doesn't have a neighbor that flips heads. In this case, the vertex becomes a center.

In the case of all vertices are head, we left with |V| many partitions with only 1 vertex. But this is unlikely to happen.

isolated vertex: if a vertex does not have a neighbor.

The parallel approach to star partition is not optimal, because it might not always create the smallest number of stars. This is acceptable for us, because we only need to reduce the size of the graph by some constant factor.

Star Partition Algorithm using Sets and Table

Star Partition Algorithm using Sets and Table

Star Partition Algorithm using Sequence

Star Partition Algorithm using Sequence

Based on the array-based cost specification for sequences starPartition is O(|E|+|V|) work and O(\log |V|) span.

For a graph G with n non-isolated vertices, the expected number of satellites in a call to starPartition(G, i) for any round i is at least n/4. Proof: let v, u be some non-isolated vertex. Then Pr\{v \text{ is a satellite}\} \geq Pr\{T_v\} \cdot Pr\{H_u\} = \frac{1}{4}. So by linear expectation, there must be \geq \frac{1}{4} satelites which will get contracted.

Star Contraction

Higher-order (generic) star-contraction algorithm:

Generic Star Contraction: klzzwxh:0030 is a mapping from klzzwxh:0031 and klzzwxh:0032 is the new edge set of quotient graph.

Generic Star Contraction: P is a mapping from v \in V \to v' \in V' and E' is the new edge set of quotient graph.

Contract the graph into a number of isolated vertices costs O((|V|+|E|)\log |V|) work and O(\log^2|V|) span, assuming

Span: Since non-isolated vertices after contraction is less than \frac{3}{4} before contraction, the contraction will end in O(\log^2|V|) steps.

Work: bounding the number of edges subtraction by \frac{|V|}{4} is not enough since there can be |V|^2 many edges. For non-isolated vertex: W(n, |E|) \leq W(n', |E|) + O(n + |E|) which solves to O(|V| + |E| \log |V|) in expectation. For isolated vertex, we need additional O(|V|\log|V|) work. The combined work is O((|V|+|E|)\log |V|)

// TODO: understand last sentence

Graph Connectivity

Graph Connectivity: finding all of the connected components in undirected graph by specifying vertex set of each component

Throughout this chapter, we use an edge-set representation for graphs

Sequential Graph Connectivity

BFS (and DFS) can solve the problem but with O(|V|) span (which is considered to be large). This is because there can be |V| components or simply a chain of |V| vertices.

Parallel Graph Connectivity

Counting Component

Contraction-based Component Counting: contract everything and then count the vertices

Contraction-based Component Counting: contract everything and then count the vertices

Computing Components

Instead of simply counting, we can the algorithm to create a set of a set of vertices.

Computing Components: returns a tuple consisting of 1) a representative for each component, and 2) a mapping from the vertices in the graph to the representative of their component.

Computing Components: returns a tuple consisting of 1) a representative for each component, and 2) a mapping from the vertices in the graph to the representative of their component.

Compared to counting, computing only modified the base case and expansion case.

Table of Content