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, At-Ribab. Mesharata, Al-Eaxsaliva. Bani Malik, An-Naseem, Al-Balad, Al-Salam, Al- Makarona, As-Salmiya, Al-Gozain, Al-Hamdaniva. Suppose that these are the possible hospital sites:

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Please i need the answer using Java 

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, ArRibab. Mesharata, Al-Eaxsaliva, Bani Malik, An-Naseem, Al-Balad, Al-Salam, Al-
Makarona, As-Salmiya, Al-Gozain, Al-Hamdaniva
Suppose that these are the possible hospital sites:
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, ArRibab. Mesharata, Al-Eaxsaliva, Bani Malik, An-Naseem, Al-Balad, Al-Salam, Al- Makarona, As-Salmiya, Al-Gozain, Al-Hamdaniva Suppose that these are the possible hospital sites:
Site 1: Covers Al-Aziziya, At-Ribab. Mesharata, Al-Eaxsaliya, Cost: SARS 20,000,000.
Site 2: Covers ArRibab, 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-Hamdaniva. Cost: SARS 10,000,000.
Site 5: Covers Mesharata, Al-Eaxsaliva, An-Naseem, Al-Balad. Cost: SARS 30,000,000.
Site 6: Covers Al-Balad, Al-Salam, AI-Hamdaniva. Cost: SARS 10,000,000.
Site 7: Covers Al-Bəlad, Mesharata, AI-Salam, Al-Makaropa, As-Salmiya. Cost: SARS 60,000,000.
Site 8: Covers AtRibab, 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, ArRibab, Mesharata, Al-
Eaxsaliva, 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 At-Bibab, 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.
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.
Update:
Please find the attached file "input.bxt" including the input file as:
1. The number in the first line represents the available fund.
2. The number in the second line represents the number of proposed sites.
3. The rest is arranged as (hospital name -String-, districts to be covered -array of
String-, and the cost for each site -int-).
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] covers 10 districts.
Transcribed Image Text:Site 1: Covers Al-Aziziya, At-Ribab. Mesharata, Al-Eaxsaliya, Cost: SARS 20,000,000. Site 2: Covers ArRibab, 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-Hamdaniva. Cost: SARS 10,000,000. Site 5: Covers Mesharata, Al-Eaxsaliva, An-Naseem, Al-Balad. Cost: SARS 30,000,000. Site 6: Covers Al-Balad, Al-Salam, AI-Hamdaniva. Cost: SARS 10,000,000. Site 7: Covers Al-Bəlad, Mesharata, AI-Salam, Al-Makaropa, As-Salmiya. Cost: SARS 60,000,000. Site 8: Covers AtRibab, 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, ArRibab, Mesharata, Al- Eaxsaliva, 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 At-Bibab, 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. 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. Update: Please find the attached file "input.bxt" including the input file as: 1. The number in the first line represents the available fund. 2. The number in the second line represents the number of proposed sites. 3. The rest is arranged as (hospital name -String-, districts to be covered -array of String-, and the cost for each site -int-). 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] covers 10 districts.
Expert Solution
steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY