Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This question asks about running Dijsktra's algorithm. Please help. I will rate as soon as possible! (a) (3 points) You and k 1 of your

image text in transcribed

This question asks about running Dijsktra's algorithm. Please help. I will rate as soon as possible!

(a) (3 points) You and k 1 of your friends have all decided to meet at Odegaard for a study session. Unfor tunately you're scattered all over campus, and you'd like to start studying as soon as possible. You have a map of campus represented as the adjacency list for a weighted, directed graph (the graph has only positive edge weights), where the edge weights represent how much time it will take you to get from one way to another. In this version of UW, there are some one-way streets, which are represented in the graph as well. You have a list of the vertices representing the current locations of you and your friends. You also know which vertex corresponds to Odegaard. Figure 1 shows an example graph. First, let's assume that you cannot alter the graph you have been given, and see what we can do. i. Describe how to find the quickest way for each of you and your friends to arrive at Odegaard. You should say which algorithm(s) you run and any inputs you would pass into the functions described in class Your answer should handle finding the path for each person, not just how long it will take them to get there ii. What is the big-O running time for this process in terms of k, Vand |E? (b) (3 points) Now, By modifying the graph representation, we're going to discover a more efficient algorithm for this problem. Suppose we wanted to reverse every edge in the graph (i.e. an edge pointing from u to v should end up pointing from u to u) i. How long would it take to make a reversed copy of the graph? Assume that the adjacency list uses hash tables, and all inserts will take constant time ii. What does a path from u to v in this new graph correspond to? ii. Describe an algorithm to find the quickest way for all of your friends to get to Odegaard (again you should be able to return the full route, not just how long it takes) iv. What is the big-O running time to find all of the routes? Your answer in this part should be more efficient than the previous algorithm. 6 gure 1: An example graph where k-3 (the highlighted vertices). Odegaard library is L, and Q, F, R are other cations on campus. The shortest path from 1, 2, and 3 to L are 1-L, 2-Q-L, and 3-2-Q-L respectively

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions

Question

Explain the causes of indiscipline.

Answered: 1 week ago