30
Lecture 10: Graphs Graph Terminology Special Types of Graphs Representing Graphs Graph Isomorphism

Lecture 10: Graphs Graph Terminology Special Types of Graphs Representing Graphs Graph Isomorphism

Embed Size (px)

Citation preview

Lecture 10: Graphs

Graph Terminology

Special Types of Graphs

Representing Graphs

Graph Isomorphism

Basic Terminology

An edge connects two vertices

Two vertices are adjacent if they are connected

An edge is incident with the two vertices it connects

Vertices are the endpoints of the edge connecting them

The degree of a vertex is the number of incident edges

An isolated vertex has degree zero (0)

A pendant vertex has degree one (1)

The Handshaking "Theorem"

Vv

ve )deg(2

4

4

5

47

5

3

3

6

5

3

4

2

0

1

28

562

e

e

Every undirected graph has an even number of vertices of odd degree.

The "First Theorem" of Graph Theory

E

E

O

EO

O

O

O

E

O

O

E

E

E

O

In a graph with directed edges the in-degree of a vertex v, denoted by deg-(v), is the number of edges with v as their terminal vertex.

The out-degree of v, denoted by deg+(v), is the number of edges with v as their initial vertex.

A Theorem for Directed Graphs

EvvVvVv

)(deg)(deg

Let G=(V,E) be a graph with directed edges. Then

K1 K2 K3 K4 K5 K6

Complete Graphs Kn

A complete graph is a simple graph with one edge between every pair of vertices.

How many edges are there in a complete graph of n vertices?

First we note that each vertex of Kn has degree n-1.

Using the Handshaking Theorem, we have

2e = deg(v) = n*(n-1),

therefore

e = n*(n-1)/2.

C3 C4 C5 C6

Cycles

W3 W4 W5 W6

Wheels

The n-Cube Qn

Q1 Q2 Q3

Q4 - The 4D Hypercube

The Connection Machine was a series of supercomputers that grew out of Danny Hillis's research in the early 1980s at MIT on alternatives to the traditional von Neumann architecture of computation. The Connection Machine was originally intended for applications in artificial intelligence and symbolic processing, but later versions found greater success in the field of computational science.

Connection Machine

CM-2 CM-5

http://en.wikipedia.org/wiki/Connection_Machine

K2,3 K3,3

K3,5 K2,6

Some Complete Bipartite Graphs

The "first theorem" of planar graph theory - K3,3 is not planar.

The Arc Reversal Algorithm

The arc-reversal algorithm has applications in computer communications, parallel processing, flow analysis, scheduling and Bayesian Networks.

The Assignment Problem

Maximal Matching Problem

Subgraph of a Graph

Union of Graphs

Graph Isomorphisms

For an n-node graph we build an nxn array with 1's indicating edges and 0's no edge the main diagonal of the matrix is unused unless a node has an edge connected to itself. If graph is weighted, 1's are replaced with edge weight values

Adjacency Matrix Graph Representation

adjacency matrix

A B C D E F G HA - 1 1 1 1 1 0 0B 1 - 1 0 1 0 0 1C 1 1 - 1 1 0 0 1D 1 0 1 - 0 1 1 1E 1 1 1 0 - 1 1 0F 1 0 0 1 1 - 1 1G 0 0 0 1 1 1 - 1H 0 1 1 1 0 1 1 -

A D F

C H

B E G

Summary

Basic Terminology

Some Classic Theorems

Types of Graphs K, C, W, Q

Bipartite and Complete Bipartite Graphs

Graph Problems and Algorithms Arc Reversal Algorithm Assignment Problem Maximal Matching

Graphs and Subgraphs

Graph Isomorphisms

Adjacency Matrix