Docsity

Graphs - Discrete Math - Lecture Slides, Slides of Discrete Mathematics

Partial preview of the text

Download Graphs - Discrete Math - Lecture Slides and more Slides Discrete Mathematics in PDF only on Docsity!

Introduction to Discrete

Mathematics

Graphs

Tree

Not Tree

Tree

How Many n-Node Trees?

Theorem: Let G be a graph with n nodes and e edges

The following are equivalent:

  1. G is a tree (connected, acyclic)
  2. G is connected and n = e + 1
  3. G is acyclic and n = e + 1
  4. G is acyclic and if any two non-adjacent points are joined by adding a new edge, the resulting graph has exactly one cycle
  5. Every two nodes of G are joined by a unique path

To prove this, it suffices to show

2 ⇒ 3 2. Every two nodes of G are

joined by a unique path

Proof: (by induction) Assume true for every graph with < n nodes

  1. G is connected and n = e + 1

Let G have n nodes and let x and y be adjacent

Let n 1 ,e 1 be number of nodes and edges in G 1 Then n = n 1 + n 2 = e 1 + e 2 + 2 = e + 1

x y

G 1 G 2

Proof: (by contradiction)

Assume G is connected with n = e + 1, and G has a cycle containing k nodes

  1. G is connected and n = e + 1
  2. G is acyclic and n = e + 1

k nodes

Note that the cycle has k nodes and k edges Starting from cycle, add other nodes and edges until you cover the whole graph Number of edges in the graph will be at least n

How many labeled trees are there

with three nodes?

How many labeled trees are there

with four nodes?

a b

c d

How many labeled trees are there

with n nodes?

16 labeled trees with 4 nodes

3 labeled trees with 3 nodes

125 labeled trees with 5 nodes

n n-2^ labeled trees with n nodes

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

Cayley’s Formula