Directed Graphs

1. Give the order in which DFS first visits each vertex in the following digraph. This is called the preorder. (Iterate through the vertices incident from v in increasing order.) see image.

2. Give the order in which DFS finishes visiting each vertex in the following DAG. This is called the postorder. (Iterate through the vertices incident from v in increasing order.) (20 Points) see image.

3. Use the postorder from the previous question to topologically sort the DAG.

Minimum Spanning Trees

1. Consider the following weighted undirected graph. see image.

List the edges in the MST in the order in which they are discovered by Prim's algorithm, starting the search at A. Since all edge weights are distinct, identify each edge by its weight (instead of its endpoints).

2. Repeat question 1 for Kruskal's algorithm.

3. Explain briefly, but rigorously, why running Kruskal's algorithm with the squares of the weights yields an MST on the original network (with the original weights). Assume all weights are nonnegative.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.