Advanced Algorithms: Lab Problems Set 2: Random Walks

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

Advanced Algorithms : Lab problems Set 2

Pre requisite : You may use a graph library or write your own code for performing tasks such
as reading a graph, finding connected components etc.

1. Implementation of approximation algorithm for the minimum dominating set


Read a graph stored in edge list format from a file and perform the following computations.
(a) Compute a dominating set by implementing the greedy approximation algorithm discussed
in class.
(b) Based on the solution from above greedy algorithm estimate the size of the minimum
dominating set for the given graph.
2. Implementation of randomized approximation algorithm for vertex cover
Read a graph stored in edge list format from a file and compute a vertex cover by implementing
the randomized approximation algorithm discussed in class. Apply the algorithm multiple times
and report the size of smallest vertex cover.
3. Computing the min cut (global) on a graph
Implement the randomized algorithm discussed in class to compute the min cut on an un-
weighted, undirected graph. Repeat the procedure multiple times and report the best min
cut.

Random walks
Random walks are a useful technique for analysis as well as producing practically feasible solu-
tions on large graphs. Usually the answers are not exact but either hold with high probability
or are within a bound of the exact answer.
4. Connectivity between two vertices
Depth First Search and Breadth First Search are two approaches commonly used for identifying
connected components in a graph. For large graphs it is infeasible to run a connected component
algorithm on the whole graph. Consider an undirected graph. To find out if two vertices u and
v are connected, start from one of the vertices (say u) and perform a random walk. i.e.
Initially start from vertex u. At each step, from current vertex randomly select one of the
neighbouring vertices and visit it. If this is the vertex v, report that u and v are connected and
stop. Otherwise, set the newly visited vertex as current vertex and continue. Terminate the
procedure after 2n3 steps.
Question Is the above a Las Vegas or Monte Carlo algorithm?

You might also like