Docsity

Assignment 4 for Advanced Algorithms | CS 5050, Assignments of Algorithms and Programming

Toggle sidebar
bg1
Assignment 4 (100 points)
Due at 11:59 pm Mar 27 (Thursday)
Name_____________________________
R-7.2 (15 points)
R-7.5 (20 points)
R-7.6 (20 points)
Question A. (15 points) Draw a graph with 5 vertices and 7 edges that is connected but
not bi-connected.
Question B. (15 points) Bob loves foreign languages and wants to plan his course
schedule for the following years. He is interested in the following nine language courses:
LA15, LA16, LA22, LA31, LA32, LA126, LA127, LA141, and LA169. The course
prerequisites are:
LA15: (none)
LA16: LA15
LA22: (none)
LA31: LA15
LA32: LA16, LA31
LA126: LA22, LA32
LA127: LA16
LA141: LA22, LA16
LA169: LA32
Find the sequence of courses that allows Bob to satisfy all the prerequisites.Describe your
method briefly.
Question C. (15 points) Dijkstra’s algorithm computes the shortest distances from a given
vertex s to all the other vertices. It grows a cloud of vertices, beginning with s and
eventually covering all the vertices. The figure below shows an intermediate step (step i)
of Dijkstra’s algorithm that grows a cloud starting from s. The integers in parenthesis
are the distance labels of vertices. The integers along the edges are edge weights. The
dashed circle shows the cloud.
1
pf2

Partial preview of the text

Download Assignment 4 for Advanced Algorithms | CS 5050 and more Assignments Algorithms and Programming in PDF only on Docsity!

Assignment 4 (100 points)

Due at 11:59 pm Mar 27 (Thursday) Name_____________________________ R-7.2 (15 points) R-7.5 (20 points) R-7.6 (20 points) Question A. (15 points) Draw a graph with 5 vertices and 7 edges that is connected but not bi-connected. Question B. (15 points) Bob loves foreign languages and wants to plan his course schedule for the following years. He is interested in the following nine language courses: LA15, LA16, LA22, LA31, LA32, LA126, LA127, LA141, and LA169. The course prerequisites are: LA15: (none) LA16: LA LA22: (none) LA31: LA LA32: LA16, LA LA126: LA22, LA LA127: LA LA141: LA22, LA LA169: LA Find the sequence of courses that allows Bob to satisfy all the prerequisites.Describe your method briefly. Question C. (15 points) Dijkstra’s algorithm computes the shortest distances from a given vertex s to all the other vertices. It grows a cloud of vertices, beginning with s and eventually covering all the vertices. The figure below shows an intermediate step (step i ) of Dijkstra’s algorithm that grows a cloud starting from s. The integers in parenthesis are the distance labels of vertices. The integers along the edges are edge weights. The dashed circle shows the cloud. 1

In step i+1 , the algorithm will pull one vertex into the cloud and update the distance labels. In the graph below, show the result of step i+1 (i.e., show the cloud and fill in the distances).

B

D

C

S

F

E

B

D

C

S

F

E