Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1 Road Network ( 10 points) You are the governor of Ninooiw, s state of n towns and many cornfields. Unfortunately, all those cornfields moukn

image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
1 Road Network ( 10 points) You are the governor of Ninooiw, s state of n towns and many cornfields. Unfortunately, all those cornfields moukn it really hand to get around. So far, there are only m dirt paths, each connecting exactly two towns, and each path talios a whole dny to travene. Any two pathe can obly intersect at a town. 1.1. (3 pointe) You would like to know bor fat all the town are from the capital of Nosidam (which in one of the n towne). Given the list of n townat and m dirt paths, deign an O(n+m) algorithme that returns the maximum anount of time if takes to trwvel from the capital to every other town uning the dirt patha. If a town in unreschable, your algorithan abould indicate that as neil. Justify the runtime of your algorithm. 1.2. (1 point) You've derifed that trawling aloog dirt jatio in toe alve. So pas drolle to bid a proper road network onenecting the towa, Rach roal consesta extly two town, and any two rowle tan oely intersect at a toen. Because gour bodget in limited, yor've ahe derldnd that a's moneh if in in gonible be built? 1.3. (3 points) The varying terrain makes it more expensive to connect tome pairs of towns than othern; your assistant has already computed the costs of building a road between each pair of towns for you. Given this information, design an O(n2logn) ilgorithm that determines the lesst poealble cont to build a road network to connect the towns. Justify the runtime of your algorithm. 1.4. (3 pointe) Later your assistant informn you that the previous governor had the same ides as you and already built r roads, but not all the towns are connected. Design an O(r log n) algorithm to determine the minimum number of new roads that need to be built in order to connect all the towns. Justify the correctness and runtime of your algorithm. Name: I Road Network (10 points) You are the governor of Nisnoesiw, a state of n towns and many cornfields. Unfortunately, all those cornfields make it really hard to get around. So far, there are only m dirt paths, each connecting exactly two towns, and each path takns a whole day to traverse. Any two paths can only intersect at a town. 1.1. (3 points) You would like to know how far all the towns are from the capital of Nosidam (which is one of the n towns). Given the list of n towns and m dirt paths, design an O(n+m) algorithm that returns the maximum amount of time it takes to travel from the capital to every other town using the dirt paths. If a town is unreachable, your algorithm should indicate that as well. Justify the runtime of your alkorithm. (1 point) You've decided that traveling along dirt paths is too slow. So you decide to build a proper road network connecting the towns. Each road connects exactly two towns, and any two roads can only intersect at a town. Because your budget is limited, you've also decided that it's enough if it is possible to travel between any two towns via (possibly multiple) roads. At least how many roads would need to be built? 1 Road Network ( 10 points) You are the governor of Ninooiw, s state of n towns and many cornfields. Unfortunately, all those cornfields moukn it really hand to get around. So far, there are only m dirt paths, each connecting exactly two towns, and each path talios a whole dny to travene. Any two pathe can obly intersect at a town. 1.1. (3 pointe) You would like to know bor fat all the town are from the capital of Nosidam (which in one of the n towne). Given the list of n townat and m dirt paths, deign an O(n+m) algorithme that returns the maximum anount of time if takes to trwvel from the capital to every other town uning the dirt patha. If a town in unreschable, your algorithan abould indicate that as neil. Justify the runtime of your algorithm. 1.2. (1 point) You've derifed that trawling aloog dirt jatio in toe alve. So pas drolle to bid a proper road network onenecting the towa, Rach roal consesta extly two town, and any two rowle tan oely intersect at a toen. Because gour bodget in limited, yor've ahe derldnd that a's moneh if in in gonible be built? 1.3. (3 points) The varying terrain makes it more expensive to connect tome pairs of towns than othern; your assistant has already computed the costs of building a road between each pair of towns for you. Given this information, design an O(n2logn) ilgorithm that determines the lesst poealble cont to build a road network to connect the towns. Justify the runtime of your algorithm. 1.4. (3 pointe) Later your assistant informn you that the previous governor had the same ides as you and already built r roads, but not all the towns are connected. Design an O(r log n) algorithm to determine the minimum number of new roads that need to be built in order to connect all the towns. Justify the correctness and runtime of your algorithm. Name: I Road Network (10 points) You are the governor of Nisnoesiw, a state of n towns and many cornfields. Unfortunately, all those cornfields make it really hard to get around. So far, there are only m dirt paths, each connecting exactly two towns, and each path takns a whole day to traverse. Any two paths can only intersect at a town. 1.1. (3 points) You would like to know how far all the towns are from the capital of Nosidam (which is one of the n towns). Given the list of n towns and m dirt paths, design an O(n+m) algorithm that returns the maximum amount of time it takes to travel from the capital to every other town using the dirt paths. If a town is unreachable, your algorithm should indicate that as well. Justify the runtime of your alkorithm. (1 point) You've decided that traveling along dirt paths is too slow. So you decide to build a proper road network connecting the towns. Each road connects exactly two towns, and any two roads can only intersect at a town. Because your budget is limited, you've also decided that it's enough if it is possible to travel between any two towns via (possibly multiple) roads. At least how many roads would need to be built

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions