# AHFME73Y Second CA Assignment Advanced Algorithmic Techniques – Australia.

Subject Code & Title: AHFME73Y Second CA
Assignment Number : 2 (of 2)
Weighting : 15%
Learning outcome assessed : 3.Identify which of the studied design principles are used in a given algorithm taking account of the similarities and differences between the principles.
4.Apply the studied design principles to produce efficient algorithmic solutions to a given problem taking account of the strengths and weaknesses of the applicable principles.
5.Outline methods of analysing correctness and asymptotic performance of the studied classes of algorithms, and apply them to analyse correctness and asymptotic performance of a given algorithm.
AHFME73Y Second CA Assignment Advanced Algorithmic Techniques – Australia.

Purpose of assessment :
Design and analysis of algorithms similar to known ones.
The aims are: to produce a solution to a related problem in order to obtain efficient solution to a given problem, based on known techniques.

Marking criteria :
Based on the marking descriptors of the University’s Code of Practice on Assessment

Provide answers to the following problems. You may refer to any of the algorithms that were presented in the lectures or the tutorials.

Problem 1
An independent set of a graph G = (V, E) is a set S ⊆ V of vertices, such that for every two vertices u and v, there is not an edge (u, v) in E. Also, recall the definition of a vertex cover, i.e., a set T of vertices such that for every edge (u, v) ∈ E, at least one of u and v is in T.

Prove that S is an independent set if any only if V − S is a vertex cover.

Consider the decision version of the Maximum Independent Set problem: given a graph G = (V, E) and an integer k, decide whether there is an independent set S of size at least k in G (i.e., whether |S| ≥ k.) Also recall the decision version of the (minimum) Vertex Cover problem: given a graph G = (V, E) and an integer k, decide whether there is a vertex cover of size at most k in G.

Assume that you have an algorithm A for solving the decision version of the Vertex Cover problem in O(1) time.Design a polynomial time algorithm B that uses the algorithm A, which solves the decision version of the Maximum Independent Set problem. Provide an argument for the correctness of the algorithm. What is the implication of the existence of algorithm B on the computational complexity of the decision version of the Maximum Independent Set problem?

AHFME73Y Second CA Assignment Advanced Algorithmic Techniques – Australia.

Assume that you have an algorithm A for solving the decision version of the Vertex Cover problem in O(n 2· 2 k) time,where n = |V | and k is the input integer parameter for the decision version of Vertex Cover. Does algorithm B solve the decision version of the Maximum Independent Set problem in time O(n 2· 2 k), where n = |V | and k is the input integer parameter for the decision version of Maximum Independent Set? Justify your answer.

Problem 2 :
MR.XXX has prepared 50 problems for the exam of his module “Advanced Algorithmic Techniques”. Each one of these problems has two attributes:

• Its type: it is either a problem on graph algorithms, approximation algorithms or randomised algorithms.
• Its difficulty: it is either easy, moderate or difficult.

For example, it could be that Problem #34 is an easy problem on approximation algorithms.

AHFME73Y Second CA Assignment Advanced Algorithmic Techniques – Australia.

MR.XXX would like to prepare an exam consisting of 24 of those problems, but he wants to make sure that the exam containts 8 problems on graph algorithms, 8 problems on approximation algorithms and 8 problems on ran-domised algorithms and at the same time 8 easy problems, 8 moderate problems and 8 difficult problems.

Model this problem as a maximum flow problem, by explaining all the parameters of the flow network. Explain how to find a feasible exam set (i.e., satisfying the constraints set by MR.XXX above) from the maximum flow in the network, if it exists, or how to decide that it does not exist.

It turned out that the exam set by MR.XXX in the previous part of the problem was really boring. For that reason, he decided to record an additional attribute for each problem, its entertainment value, which is a real number between 0 and 1. MR.XXX would now like to find a feasible exam (satisfying the constraints set in the previous part) which maximises the total entertainment value (i.e., the sum of the entertainment values of the problems included in the exam).

Problem 3 :
MR.XXX aims to schedule a series of 1-hour Q&A sessions with n students and has set up a doodle poll where there are m available time slots. Every student has indicated which slots they could attend and it turns out that any student appears in at least 1 and at most k time slots in the doodle poll. MR.XXX would like to minimise the number of sessions that he will have to do, making sure that he does at least one session for every student (i.e., every student will have a chance to attend some session).

Model this problem as an integer linear program (ILP). Explain the variables and the constraints of your ILP.

Write the LP-relaxation of the ILP that you constructed above.

Design a rounding scheme for the LP-relaxation that results in an approximation algorithm for the problem with ap- proximation ratio at most k. Argue about the correctness of your algorithm.

Is this the best approximation algorithm that one can design for this problem? Can the problem be solved in polynomial time? If not, what is the best possible approximation that one could hope for (assuming P̸=NP)?

Problem 4 :
Consider the following problem. There is a set of n cities (where n is even) located on a cycle graph G = (V, E) and numbered as shown in the figure. There is also a set R of taxi ride requests, with each request ri ∈ R being represented by an (origin, destination) pair, where the origin and the destinations are two cities on the cycle. Each request can be driven via two alternative directions (Direction 1 or Direction 2), as shown in the figure.The congestion Ce on an edge e of a cycle is the number of requests that are driven via that edge. The make span congestion is the maximum congestion on any edge, i.e., max e∈E we. The objective is to find an assignment of the requests to the two directions (Direction 1 and Direction 2) such that the make span congestion is minimised.

Design a greedy polynomial-time approximation algorithm for the problem with approximation ratio at most 2. Provide an argument for the approximation ratio of the algorithm.

Design a polynomial-time approximation algorithm for the problem with approximation ratio at most 2, based on the LP-relaxation and rounding technique. Specifically:

1.Formulate the problem as an integer linear program. Use indicator variables xi to denote if a request was driven in Direction 1 or Direction 2. For each edge e, use Re to denote the set of requests which would be driven via edge e if they were driven via Direction 1 (regardless of the value of xi). For example, in the figure, for edge e = (4, 5), the requests (4, n − 2) and (3, 2) are in Re, but the request (n − 2, 3) is not.

AHFME73Y Second CA Assignment Advanced Algorithmic Techniques – Australia.

2.Write its LP-relaxation and explain how the fractional version of the problem can be solved.

3.Provide a rounding scheme for the LP-relaxation to obtain a solution to the original problem.

4.Explain why the rounding scheme results to an algorithm with an approximation ratio of at most 2