You are on page 1of 1

Advanced Algorithms 2011.

Exercises 7-9

Exercise 7.
Given a bipartite graph G = (X, Y, E), we want to join nodes in X with up
to two nodes in Y (using edges from E), in such a way that no node from
Y is used more than once. This is similar to a matching, except that nodes
in X may have one or two partners.

How can you efficiently serve as many as possible nodes of Y ?

(Non-serious remark: When it comes to applications, think of resource allo-


cation problems rather than a marriage bureau supporting bigamy.)

Exercise 8.
Let Q be a set of n unit squares in a grid, that is, squares of side length 1
whose corners have integer coordinates. A domino is a 2 1 rectangle. The
task is to place as many as possible dominos onto Q, under the following
conditions: Every domino must cover two adjacent squares of Q, and the
dominos must not overlap. However we may rotate the dominos, i.e., place
them horizontally or vertically. As a practical motivation, imagine that
you have to store 2 1 boxes on a floor where many squares are already
occupied unsystematically by other heavy boxes which are not easy to move.
Q is the available space.

An optimal placement of dominos can be computed in polynomial time.


How? (But do not provide some questionable greedy algorithm without
optimality proof. Instead apply a suitable method from the course.) Specify
a time bound.

Exercise 9.
It is easy to confuse the various flow and connectivity problems and their
complexities, therefore be careful:

Given a directed graph with k sources and k sinks (all distinct), suppose that
you have to connect them all by k edge-disjoint directed paths, but now it
is up to you which source you connect to which sink. The only condition is
that every source (sink) must be start node (end node) of one path.

Is this problem NP-complete or polynomial? Motivate your answer.

You might also like