ITLB
Assignment 4 Solutions

Assignment 4 Solutions - COMP 251 Autumn 2013 Solutions to...

• Homework Help
• 3

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

COMP 251 Autumn 2013 Solutions to Assignment 4 Gheorghe Comanici Prakash Panangaden Question 1 [20 points] This problem is solved using a greedy algorithm, building the solution from east to west. We start with a list of all the houses. Find the westmost house, and place a base station 4 miles to its east . Remove all the houses covered by this station from the list of houses. Repeat the process until the problem has no more houses. Does our solution stay ahead of other solutions? Suppose somebody claims that some other solution S = { s 1 ,s 2 ,...,s k } is a better than our solution T = { t 1 ,t 2 ,...,t r } (where the stations are sorted from west to east). That is, k <r and both S and T cover all houses. Note that both s 1 and t 1 have to cover the west-most house h , but we chose t 1 as the east most point to cover h , therefore t 1 s 1 Assume t i s i . Then it must be the case that all houses covered { s 1 ,s 2 ,...,s i } will also be covered by { t 1 ,t 2 ,...,t i } , so if we add s i +1 to { t 1 ,t 2 ,...,t i } there won’t be any houses uncovered between t i and s i +1 . But we choose t i +1 as large as possible to cover these houses, so it must be the case that t i +1 s i +1 .

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

This is the end of the preview. Sign up to access the rest of the document.
• Spring '08
• --
• Graph Theory, Greedy algorithm, Spanning tree

{[ 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