sol4 - CMPT 307 - Data Structures and Algorithms: Solutions...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
CMPT 307 - Data Structures and Algorithms: Solutions to Problem Set 4 1. Forming committees In a certain department, there are n faculty members. The department needs to organize m different committees (such as undergraduate admission committee, etc). Each faculty member belongs to a group, sometimes several (such as Theory, Graphics, AI); there are k such groups and each group i has a list C i for 1 i k of faculty members belonging to this group. For fairness, there should not be more than one person from each group on every committee. (a) Give an algorithm that, on input n,m,k and C i for 1 i k , determines whether it is possible for each committee to have representatives of at least 5 groups, where one person can represent several groups . Hint: design a flow network that represents this problem. Think of each category as a “layer” in your network. Solution: In this problem we have three different categories: faculty members, groups and committees. Each category is represented by one “layer” of our net- work; a layer can only be connected to preceding/subsequent layer, and source and target nodes are treated as layers. The groups have to be connected to both committees and faculty members, so the groups layer is in the middle. It does not matter which layer is first and which is last, so let’s take faculty members to be the first layer (connected to the source), and committees the last layer (connected to the target). So the network has the following structure: Source node s . n nodes representing faculty members, to which the source node s is connected by directed edges of capacity 5 m (so that every faculty member can possibly represent 5 groups on every committee). This capacity can be any number 5 m , even . k
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 3

sol4 - CMPT 307 - Data Structures and Algorithms: Solutions...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online