Lecture Notes on 20 Apr 2022 * Directed Acyclic Graphs (DAGs) https://www.cs.utexas.edu/users/mitra/csSpring2022/cs313/notes/DAG.pdf Topological Sort (Topo Sort) Works on directed graphs that do not have cycles (DAGs) 0. Determine the in_degree for all vertices. The in_degree is the number of edges that are incident on that vertex. 1. Remove the vertices that have an in_degree of 0 to a list and remove the out going edges from those vertices. Sort the list in a given order. Enqueue the vertices into a Queue and then update the in_degree of all remaining vertices. 2. Repeat step 1 until there are no more vertices in the Graph. 3. Dequeue the vertices and print. * Minimum Spanning Tree (MST) - Kruskal's Algorithm and Prim's Algorithm. * Kruskal's Algorithm - Order the edges by increasing weight. - Start with an empty graph having only the vertices but no edges. Add an edge to this graph as long as it does not form a cycle. - When all the vertices are connected you are done. * Prim's Algorithm - Start with an empty graph having only the vertices. - Start with any vertex and add it to the list of visited vertices. - Choose the edge with the smallest weight to an unvisited vertex as long as it does not form a cycle. Add that vertex to the list of visited vertices. - Keep adding the edges with the smallest weight from any of the vertices in the list of visited vertices as long as those edges do not form a cycle. - When all the vertices have been visited then you are done. * Do Exercises on Graphs https://www.cs.utexas.edu/users/mitra/csSpring2022/cs313/notes/Graph_Exercises.pdf https://www.cs.utexas.edu/users/mitra/csSpring2022/cs313/notes/Minimum_Spanning_Tree.pdf