Jeddah Municipality has decided to build a network of national hospitals to treat infectious diseases. A special task force is constituted which is tasked to investigate possible locations for these new hospitals. The task force has done its job and come back with a list of potential sites. Each of these hospitals has an associated cost and will provide coverage to some number of nearby districts within Jeddah. We can represent each potential hospital site as having: a name (string), cost to build the hospital (int) and a set of districts to be covered (Set of strings). Jeddah Municipality is interested in providing health care to all, but they do not have funds to build an unlimited number of hospitals. The goal is to provide coverage to as many districts as possible using the available funds. For example, suppose Jeddah Municipality has the following districts: Al-Aziziya, Ar-Rihab, Mosharafa, Al-Faysaliya, Bani Malik, An-Naseem, Al-Balad, Al-Salam, Al- Makarona, As-Salmiya, Al-Gozain, Al-Hamdaniya Suppose that these are the possible hospital sites: Site 1: Covers Al-Aziziya, Ar-Rihab, Mosharafa, Al-Faysaliya. Cost: SARS 20,000,000. Site 2: Covers Ar-Rihab, Bani Malik, An-Naseem, Al-Balad. Cost: SARS 50,000,000. Site 3: Covers Al-Balad, Al-Salam, Al-Makarona, As-Salmiya, Al-Gozain. Cost: SARS 40,000,000. Site 4: Covers As-Salmiya, Al-Gozain, Al-Hamdaniya. Cost: SARS 10,000,000. Site 5: Covers Mosharafa, Al-Faysaliya, An-Naseem, Al-Balad. Cost: SARS 30,000,00. Site 6: Covers Al-Balad, Al-Salam, Al-Hamdaniya. Cost: SARS 10,000,000. Site 7: Covers AI-Balad, Mosharafa, Al-Salam, Al-Makarona, As-Salmiya. Cost: SARS 60,000,000. Site 8: Covers Ar-Rihab, Bani Malik, Al-Makarona, As-Salmiya, Al-Balad. Cost: SARS 50,000,000. If you build Site 1 and Site 2, you have provi Faysaliya, Bani Malik, An-Naseem, and Al-Balad a total of seven districts, at a cost of SARS 70,000,000. (Notice that both Site 1 and Site 2 provide coverage to Ar-Rihab, so even though Site 1 and Site 2 cover four districts each, only seven total districts end up covered). Adding in Site 5 would add in a cost of SARS 50,000,000 without actually providing any new coverage, since all four of the cities it services are already covered. coverage to Al-Aziziya, Ar-Rihab, sharafa, Al- Your task is to write a recursive function that takes as input a list of possible hospital sites and an amount of funds available, and then returns a list of hospitals that should be built to provide coverage to the maximum number of cities. It is important to note that multiple hospitals could provide coverage to the same district. However, when you count up the total number of districts covered, you do not double-count a district. A sample run: Suppose total available funds (budget) are: SARS 80,000,000. The optimal coverage is [Site 1, Site 4, Site 5, Site 6] which covers 11 districts.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
I need the answer as soon as possible
Jeddah Municipality has decided to build a network of national hospitals to treat infectious
diseases. A special task force is constituted which is tasked to investigate possible locations for
these new hospitals. The task force has done its job and come back with a list of potential sites.
Each of these hospitals has an associated cost and will provide coverage to some number of
nearby districts within Jeddah. We can represent each potential hospital site as having: a name
(string), cost to build the hospital (int) and a set of districts to be covered (Set of strings).
Jeddah Municipality is interested in providing health care to all, but they do not have funds to
build an unlimited number of hospitals. The goal is to provide coverage to as many districts as
possible using the available funds. For example, suppose Jeddah Municipality has the following
districts:
Al-Aziziya, Ar-Rihab, Mosharafa, Al-Faysaliya, Bani Malik, An-Naseem, Al-Balad, Al-Salam, Al-
Makarona, As-Salmiya, Al-Gozain, Al-Hamdaniya
Suppose that these are the possible hospital sites:
Site 1: Covers Al-Aziziya, Ar-Rihab, Mosharafa, Al-Faysaliya. Cost: SARS 20,000,000.
Site 2: Covers Ar-Rihab, Bani Malik, An-Naseem, Al-Balad. Cost: SARS 50,000,000.
Site 3: Covers Al-Balad, Al-Salam, Al-Makarona, As-Salmiya, AlI-Gozain. Cost: SARS 40,000,000.
Site 4: Covers As-Salmiya, Al-Gozain, Al-Hamdaniya. Cost: SARS 10,000,000.
Site 5: Covers Mosharafa, Al-Faysaliya, An-Naseem, Al-Balad. Cost: SARS 30,000,00.
Site 6: Covers Al-Balad, Al-Salam, Al-Hamdaniya. Cost: SARS 10,000,000.
Site 7: Covers AI-Balad, Mosharafa, Al-Salam, Al-Makarona, As-Salmiya. Cost: SARS 60,000,000.
Site 8: Covers Ar-Rihab, Bani Malik, Al-Makarona, As-Salmiya, Al-Balad. Cost: SARS 50,000,000.
If you build Site 1 and Site 2, you have provided coverage to Al-Aziziya, Ar-
Faysaliya, Bani Malik, An-Naseem, and Al-Balad a total of seven districts, at a cost of SARS
70,000,000. (Notice that both Site 1 and Site 2 provide coverage to Ar-Rihab, so even though
Site 1 and Site 2 cover four districts each, only seven total districts end up covered). Adding in
Site 5 would add in a cost of SARS 50,000,000 without actually providing any new coverage,
since all four of the cities it services are already covered.
Mosharafa, Al-
Your task is to write a recursive function that takes as input a list of possible hospital sites and
an amount of funds available, and then returns a list of hospitals that should be built to provide
coverage to the maximum number of cities.
It is important to note that multiple hospitals could provide coverage to the same district.
However, when you count up the total number of districts covered, you do not double-count a
district.
A sample run:
Suppose total available funds (budget) are: SARS 80,000,000. The optimal coverage is [Site 1,
Site 4, Site 5, Site 6] which covers 11 districts.
Transcribed Image Text:Jeddah Municipality has decided to build a network of national hospitals to treat infectious diseases. A special task force is constituted which is tasked to investigate possible locations for these new hospitals. The task force has done its job and come back with a list of potential sites. Each of these hospitals has an associated cost and will provide coverage to some number of nearby districts within Jeddah. We can represent each potential hospital site as having: a name (string), cost to build the hospital (int) and a set of districts to be covered (Set of strings). Jeddah Municipality is interested in providing health care to all, but they do not have funds to build an unlimited number of hospitals. The goal is to provide coverage to as many districts as possible using the available funds. For example, suppose Jeddah Municipality has the following districts: Al-Aziziya, Ar-Rihab, Mosharafa, Al-Faysaliya, Bani Malik, An-Naseem, Al-Balad, Al-Salam, Al- Makarona, As-Salmiya, Al-Gozain, Al-Hamdaniya Suppose that these are the possible hospital sites: Site 1: Covers Al-Aziziya, Ar-Rihab, Mosharafa, Al-Faysaliya. Cost: SARS 20,000,000. Site 2: Covers Ar-Rihab, Bani Malik, An-Naseem, Al-Balad. Cost: SARS 50,000,000. Site 3: Covers Al-Balad, Al-Salam, Al-Makarona, As-Salmiya, AlI-Gozain. Cost: SARS 40,000,000. Site 4: Covers As-Salmiya, Al-Gozain, Al-Hamdaniya. Cost: SARS 10,000,000. Site 5: Covers Mosharafa, Al-Faysaliya, An-Naseem, Al-Balad. Cost: SARS 30,000,00. Site 6: Covers Al-Balad, Al-Salam, Al-Hamdaniya. Cost: SARS 10,000,000. Site 7: Covers AI-Balad, Mosharafa, Al-Salam, Al-Makarona, As-Salmiya. Cost: SARS 60,000,000. Site 8: Covers Ar-Rihab, Bani Malik, Al-Makarona, As-Salmiya, Al-Balad. Cost: SARS 50,000,000. If you build Site 1 and Site 2, you have provided coverage to Al-Aziziya, Ar- Faysaliya, Bani Malik, An-Naseem, and Al-Balad a total of seven districts, at a cost of SARS 70,000,000. (Notice that both Site 1 and Site 2 provide coverage to Ar-Rihab, so even though Site 1 and Site 2 cover four districts each, only seven total districts end up covered). Adding in Site 5 would add in a cost of SARS 50,000,000 without actually providing any new coverage, since all four of the cities it services are already covered. Mosharafa, Al- Your task is to write a recursive function that takes as input a list of possible hospital sites and an amount of funds available, and then returns a list of hospitals that should be built to provide coverage to the maximum number of cities. It is important to note that multiple hospitals could provide coverage to the same district. However, when you count up the total number of districts covered, you do not double-count a district. A sample run: Suppose total available funds (budget) are: SARS 80,000,000. The optimal coverage is [Site 1, Site 4, Site 5, Site 6] which covers 11 districts.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Probability Problems
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education