Está en la página 1de 32

An Introduction to Graph Theory

Course 2 Crina Grosan

The Konigsberg Bridge Problem

Definitions and Examples


Undirected graph loop G=(V,E) isolated vertex multiple edges adjacent simple graph: an undirected graph without loop or multiple edges degree of a vertex: number of edges connected (indegree, outdegree) Directed graph

For simple graphs, deg( v i ) = 2 | E |


vi V

Definitions and Examples


a x path: no vertex can be repeated a-b-c-d-e trail: no edge can be repeat a-b-c-d-e-b-d walk: no restriction a-b-d-a-b-c y e b

d c

closed if x = y closed trail: circuit (a-b-c-d-b-e-d-a, one draw without lifting pen) closed path: cycle (a-b-c-d-a)

length: number of edges in this (path,trail,walk)

Definitions and Examples


Theorem. Let G = (V , E ) be an undirected graph, with a, b V , a b. If there exists a trail from a to b, then there is a path from a to b.
remove any cycle on the repeated vertices a x b

Definition. Let G=(V,E) be an undirected graph. We call G connected if there is a path between any two distinct vertices of G. a b e b a e disconnected with two components d c

d c

Definitions and Examples

multigraph of multiplicity 3 multigraphs

Definitions and Representation

An undirected graph and its adjacency matrix representation.

An undirected graph and its adjacency list representation.

Subgraphs, Complements, and Graph Isomorphism


Definition. If G = (V , E ) is a graph, then G1 = (V1 , E1 ) is called a subgraph of G if V1 V and E1 E, where each edge of in E1 is incident with vertices in V1.
a a e b d c d c c spanning subgraph V1=V d c b d e a b e

Subgraphs, Complements, and Graph Isomorphism


a Definition: complete graph: Kn e b K5 Definition: complement of a graph a G e b b G a c e d

d c c

Subgraphs, Complements, and Graph Isomorphism


Graph Isomorphism
1 2 a b c w 3 4 d x y z

Definition. Let G1 = (V1 , E1 ) and G2 = (V2 , E2 ) be two undirected graphs. A function f : V1 V2 is called a graph isomorphism if any two vertices x and y of G are adjacent in G1 if and only if (x) and (y) are adjacent in G 2 .

Subgraphs, Complements, and Graph Isomorphism


Example v y q w z x e i h t d u a-q c-u e-r g-x i-z b-v d-y f-w h-t j-s, isomorphic Example a f e 6 5 b c d 3 c r j a f b g

1 2 4

Regular graphs
A graph is said to be regular of degree if all local degrees are the same number . A 0-regular graph is an empty graph, a 1-regular graph consists of disconnected edges, and a 2-regular graph consists of disconnected cycles. The first interesting case is therefore 3-regular graphs, which are called cubic graphs.

Vertex Degree: Euler Trails and Circuits

Theorem. For

vi V Corollary . The number of vertices of odd degree must be even.

simple graphs, deg( v i ) = 2 | E |

Example: a regular graph: each vertex has the same degree Is it possible to have a 4-regular graph with 10 edges? 2|E| = 4|V| = 20, |V|=5 with 15 edges? 2|E| = 4|V| = 30 not possible!!! possible (K5)

The Seven Bridge of Konigsberg

Find a way to walk about the city so as to cross each bridge exactly once and then return to the starting point.

Vertex Degree: Euler Trails and Circuits


Definition. Let G=(V,E) be an undirected graph or multigraph with no isolated vertices. Then G is said to have an Euler circuit if there is a circuit in G that traverses every edge of the graph exactly once. If there is an open trail from a to b in G and this trail traverses each edge in G exactly once, the trail is called an Euler trail. Theorem. Let G=(V,E) be an undirected graph or multigraph with no isolated vertices. Then G has an Euler circuit if and only if G is connected and every vertex in G has even degree.

All degrees are odd. Hence no Euler circuit for the Konigsberg bridges problem !

Vertex Degree: Euler Trails and Circuits

Can you think of an algorithm to construct an Euler circuit? Corollary. An Euler trail exists in G if and only if G is connected and has exactly two vertices of odd degree. two odd degree vertices a add an edge b

Theorem. A directed Euler circuit exists in G if and only if G is connected and in-degree(v)=out-degree(v) for all vertices v.

two in, two out

Exercise
Euler's House. Baby Euler has just learned to walk. He is curious to know if he can walk through every doorway in his house exactly once, and return to the room he started in. Will baby Euler succeed? Can baby Euler walk through every door exactly once and return to a different place than where he started? What if the front door is closed?

Planar Graphs
Definition. A graph (or multigraph) G is called planar if G can be drawn in the plane with its edges intersecting only at vertices of G. Such a drawing of G is called an embedding of G in the plane. Example: K1,K2,K3,K4 are planar, Kn for n>4 are nonplanar.

K4

K5

applications:VLSI routing, plumbing,...

Planar Graphs
bipartite graph complete bipartite graphs (Km,n)

K4,4

K3,3 is not planar.

Planar graphs
elementary subdivision (homeomorphic operation)

Definition. G1 and G2 are called homeomorphic if they are isomorphic or if they can both be obtained from the same loop-free undirected graph H by a sequence of elementary subdivisions. a c e d e b a c d e b a c d e b a c d b

Two homeomorphic graphs are simultaneously planar or nonplanar.

Planar Graphs
Degree of a region (deg(R)): the number of edges traversed in a shortest closed walk about the boundary of R. two different embeddings a R2 c R1 d f deg(R1)=5,deg(R2)=3 deg(R3)=3,deg(R4)=7 abghgfda deg(R5)=4,deg(R6)=3 deg(R7)=5,deg(R8)=6 R3 g h b R4 R6

R8 R7

R5

i =1

deg( Ri ) = 18 = deg( Ri ) = 2 9 = 2 | E |
i= 5

A dual graph of a planar graph

a c

2 3

3 6 5 e g d 4 4 f 6 5

An edge in G corresponds with an edge in Gd.

It is possible to have isomorphic graphs with respective duals that are not isomorphic.

Cut set
Cut-set: a subset of edges whose removal increase the number of components Example b a d e f cut-sets: {(a,b),(a,c)}, {(b,d),(c,d)},{(d,f)},... h

a bridge

For planar graphs, cycles in one graph correspond to cut-sets in a dual graphs and vice versa.

Hamilton Paths and Cycles


a path or cycle that contain every vertex Unlike Euler circuit, there is no known necessary and sufficient condition for a graph to be Hamiltonian. an NP-complete problem Example a d g b e h i c There is a Hamilton path, but no Hamilton cycle. f

Hamilton Paths and Cycles


Example x y start labeling from here 4x's and 6y's, since x and y must interleave in a Hamilton path (or cycle), the graph is not Hamiltonian

x y

x y

The method works only for bipartite graphs. The Hamilton path problem is still NP-complete when restricted to bipartite graphs.

Hamilton Paths and Cycles


Exercise. 17 students sit at a circular table, how many sittings are there such that one has two different neighbors each time? Consider K17, a Hamilton cycle in K17 corresponds to a seating arrangements. Each cycle has 17 edges, so we can have (1/17)17(17-1)/2=8 different sittings. 5 3 2 4 6 1,2,3,4,5,6,...,17,1 1 15 17 2 16 4 6 1,3,5,2,7,4,...,17,14,16,1 3 1 5 15 17 16 2 4 6 14 1,5,7,3,9,2,...,16,12,14,1 3 1 5 15 17 16

Hamilton Paths and Cycles

* * Theorem. Let K n be a complete directed graph, i.e., K n

has n vertices and for any distinct pair x , y of vertices, exactly


* one of the edges ( x , y ) or ( y , x ) is in K n . Such a graph (called a

tournament ) always contains a directed Hamilton path.

Hamilton Paths and Cycles


n -1 Corollary.If deg(v) for all vertices, then the graph 2 has a Hamilton path. Theorem. Let G = (V , E ) be a loop - free undirected graph with | V |= n 3. If deg(x) + deg( y ) n for all nonadjacent x, y V , then G contains contains a Hamilton cycle.

Hamilton Paths and Cycles


A related problem: the traveling salesman problem a 1 b 5 3 3 4 c 2 For example, a-b-e-c-d-a with total cost= 1+3+4+2+2=12. 2 3 e 4 d Find a Hamilton cycle of shortest total distance.

Graph Coloring and Chromatic Polynomials


Definition. If G=(V,E) is an undirected graph, a proper coloring of G occurs when we color the vertices of G so that if (a,b) is an edge in G, then a and b are colored with different colors. The minimum number of colors needed to properly color G is called the chromatic number of G .

a b 3 colors are needed. e a: Red b: Green c: Red d: Blue e: Red d c In general, it's a very difficult problem (NP-complete). (Kn)=n (bipartite graph)=2

Graph Coloring and Chromatic Polynomials


A related problem: color the map where two regions are colored with different colors if they have same boundaries. Four colors are enough for any map. Remain a mystery for a century. Proved with the aid of computer analysis in 1976. f a B f c d b e

a B c Y d R

b G Re

Graph Coloring and Chromatic Polynomials


P(G,): the chromatic polynomial of G=the number of ways to color G with colors. Example (a) G=n isolated points, P(G,)=n. (b) G=Kn, P(G,)=(-1)(-2)...(-n+1)=(n) (c) G=a path of n vertices, P(G,)=(-1)n-1. (d) If G is made up of components G1, G2, ..., Gk, then P(G,)=P(G1,)P(G2,)...P(Gk,). Example e coalescing the vertices

Ge

G' e

También podría gustarte