Exam 2 Questions.pdf

• Test Prep
• 6
• 100% (1) 1 out of 1 people found this document helpful

This preview shows pages 2–4. Sign up to view the full content.

it visits each location exactly once. The robot must return to t 0 when it finishes its task. The goal is to minimize the total distance that the robot travels. a) Write down a greedy algorithm to make the robot do the desired task. b) Does your algorithm always find the optimal solution? If yes prove it, if no provide a counter example. 2

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

Problem 2: Network Flows There are n students in the CS program, and each of them must take the Algorithms course. There are m sections of Algorithms offered: A 1 , ..., A m . They begin at times T 1 , ..., T m . Each student can sign up for at most one section. Because students also have other courses to take, each student can only attend some subset of the Algorithms sections. This varies by student: some may only be free during one or two sections, while others might be able to attend all of them. In addition, each section A i has a capacity C i on the total enrollment, so you cannot put more than C i students in that section. Your goal is to assign students to sections so that as many students as possi- ble are enrolled in a section of Algorithms (note that it might be impossible to enroll everybody into a section: this is fine). Design an algorithm to solve this problem by using network flows . Note that it is not enough to only describe the graph to solve the problem. You should write an algorithm to describe how to use that graph to solve the given enrollment problem.
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern