15-Minimum Spanning Trees - Discuss Graphs directed and...

Info icon This preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Discuss Graphs, directed and undirected, adjacency lists representation and adjacency matrix representation both can also be used for weighted graphs. Spanning Trees Given undirected connected graph G with no more than one edge between any two vertices and weights (real numbers) assigned to each edge - find a spanning tree whose edge weights sum up to a minimal value (no other spanning tree has a sum less than the minimal value). This spanning tree is called a minimum spanning tree (MST)) . Assume there are e edges and n vertices and the weight of an edge between vertices u and v is w(u, v). Generic Algorithm Set A to empty. While (A is not a spanning tree) Add a proper edge to A Let V be the set of vertices of G and assume the graph with vertices V and edges A can be extended to become a minimum spanning tree for G. An edge (u, v) is proper if it can be added to A and the new A can be extended to a minimum spanning tree for G. Initially, let A contain an edge selected by either; a) picking any vertex u and selecting a minimal weight edge emanating from it, or b) picking a minimal weight edge among all edges of G. Suppose the edge selected is (u, v). Let T be a minimal spanning tree for G. If T contains (u, v) then it is clearly proper. Otherwise there is a path in T from u to v and hence adding (u, v) to the edges of T creates a cycle which includes vertices u and v. Now, there must be an edge (u, y) with y not v on this path and w(u, v) cannot exceed w(u, y) because of how it was picked. Thus, removing (u, y) from A and replacing it by (u, v) gives a new minimal spanning tree for G which does contain (u, v). So, (u, v) is proper. Now, suppose we have any non-empty A that can be extended to a minimal spanning tree of G. In general, A represents a forest composed of trees. Add an edge to A by either a) selecting any one of its trees and then selecting a minimal weight edge among all edges that connect a vertex of the selected tree and any vertex not in the tree, or b) select any minimal weight edge not in A that can be added to A without creating a cycle.
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern