Docsity

Discrete Mathematics Lecture 20: Trees, Graph Coloring, and Minimum Spanning Trees, Slides of Discrete Mathematics

Partial preview of the text

Download Discrete Mathematics Lecture 20: Trees, Graph Coloring, and Minimum Spanning Trees and more Slides Discrete Mathematics in PDF only on Docsity!

Introduction to Discrete

Mathematics

Graphs II

Lecture 20 (November 7, 2007)

The number of labeled trees on n nodes is n n-

Cayley’s Formula

A graph is planar if

it can be drawn in the

plane without crossing

edges

A coloring of a graph is an assignment of a color to each vertex such that no neighboring vertices have the same color

Graph Coloring

Spanning Trees

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

Tree Approximations

Applying the Algorithm

Analyzing the Algorithm

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.

Greed is Good (In this case…)

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.

TSP: Traveling Salesman Problem

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?

Tours from Trees

This is a 2-competitive algorithm

Shortcuts only decrease the cost, so Cost(Greedy Tour) ≤ 2 Cost(MST) ≤ 2 Cost(Optimal Tour)

Bipartite Graph

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 )