Solved Homework #4 - Advanced Algorithms | CISC 829, Assignments of Computer Science

Material Type: Assignment; Class: COMPUTATIONAL PHOTOGRAPHY & VI; Subject: Computer/Information Sciences; University: University of Delaware; Term: Spring 2009;

Typology: Assignments

Pre 2010

Uploaded on 09/02/2009

koofers-user-a8c
koofers-user-a8c 🇺🇸

9 documents

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CISC-829 Advanced Algorithms
Homework 4: Problem 9
Sandeep Kumar
May 22, 2009
Problem
Give a linear time algorithm for finding a minimum spanning tree of a planar
graph.
Solution
Let G(V, E ) be a planar graph with edge weight w(e) where eE.
We use two properties of planar graphs to give linear time algorithm:
The planar graph remains planar when we contract the edge and merge
two vertices into one;
From Euler’s formula, there exists some vertices vsuch that degree(v)<
4 if graph is planar.
Let S(v) denote the set of edges incident on vertex v.
Algorithm
Step-1 Let Tbe the minimum spanning tree of graph G. Initialize
T= Ø;
Step-2 Create two buckets Aand B. For each vertex vV, if degree
of vi<4, place viin bucket A; else place viin bucket B;
Step-3 Pick a vertex vfrom bucket A:
1
pf2

Partial preview of the text

Download Solved Homework #4 - Advanced Algorithms | CISC 829 and more Assignments Computer Science in PDF only on Docsity!

CISC-829 Advanced Algorithms

Homework 4: Problem 9

Sandeep Kumar

May 22, 2009

Problem

Give a linear time algorithm for finding a minimum spanning tree of a planar graph.

Solution

Let G(V, E) be a planar graph with edge weight w(e) where e ∈ E. We use two properties of planar graphs to give linear time algorithm:

  • The planar graph remains planar when we contract the edge and merge two vertices into one;
  • From Euler’s formula, there exists some vertices v such that degree(v) < 4 if graph is planar.

Let S(v) denote the set of edges incident on vertex v.

Algorithm

Step-1 Let T be the minimum spanning tree of graph G. Initialize T = Ø;

Step-2 Create two buckets A and B. For each vertex v∈V , if degree of vi < 4, place vi in bucket A; else place vi in bucket B;

Step-3 Pick a vertex v from bucket A:

Case-1 If S(v) contains a self loop by edge e, remove the edge e from graph; reduce the degree of vertices containing e by 1; update the vertices to buckets A and B on basis of degree; Goto Step-3. Case-2 If S(v) does not contain self loop:

  • Find min w(e) such that e ∈ S(v). (The degree of v is less than 4, so this operation takes O(1))
  • Add edge e to T ;
  • Contract the edge e and merge the vertices containing e; (The degree of v is less than 4, so this operation takes O(1))
  • Update the degree of new vertex;
  • the buckets A and B; Goto Step-3. Case-3 If v is isolated, goto Step-4;

Step-4 Output minimum spanning tree T.

Proof

a. The algorithm always finds a vertex in bucket A of degree less than 4 because by edge contraction and deletion, the planar graph property is maintained.

b. Essentially, it is the same as Prim’s algorithm, but we reduce the time by considering vertices with degree less than 4, thus limiting the time to find minimum weight edge to O(1). So it can be easily verified that T is MST of graph G.

c. As at most 4 vertices are updated at a time, the bucket update takes time O(1).

d. Total RT = T (Step 2) + |E| ∗ T (Step 3) = O(|V | + |E|). For planar graph, |E| ≤ 3 |V | − 6, so RT = O(|V | + 3|V | − 6) = O(|V |).