

























Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


























Lecture 20 (November 7, 2007)
The number of labeled trees on n nodes is n n-
A coloring of a graph is an assignment of a color to each vertex such that no neighboring vertices have the same color
A spanning tree of a graph G is a tree that touches every node of G and uses only edges from G
Every connected graph has a spanning tree
Finding Optimal Trees
Problem: Find a minimum spanning tree, that is, a tree that has a node for every node in the graph, such that the sum of the edge weights is minimum
The algorithm outputs a spanning tree T.
Let M be a minimum spanning tree.
Let e be the first edge chosen by the algorithm that is not in M.
N = M+e-f is another spanning tree.
Suppose that it’s not minimum. (For simplicity, assume all edge weights in graph are distinct)
If we add e to M, it creates a cycle. Since this cycle isn’t fully contained in T, it has an edge f not in T.
The greedy algorithm, by adding the least costly edges in each stage, succeeds in finding an MST
But — in math and life — if pushed too far, the greedy approach can lead to bad results.
Given a number of cities and the costs of traveling from any city to any other city, what is the cheapest round-trip route that visits each city exactly once and then returns to the starting city?
This is a 2-competitive algorithm
Shortcuts only decrease the cost, so Cost(Greedy Tour) ≤ 2 Cost(MST) ≤ 2 Cost(Optimal Tour)
A graph is bipartite if the nodes can be partitioned into two sets V 1 and V 2 such that all edges go only between V 1 and V 2 (no edges go from V 1 to V 1 or from V 2 to V 2 )