Graphs - Basic Typesturing.une.edu.au/~amth140/Lectures/Lecture_10/bslides.pdf · Basic Types and...

52
Graphs Basic Types Ioan Despi [email protected] University of New England July 24, 2013

Transcript of Graphs - Basic Typesturing.une.edu.au/~amth140/Lectures/Lecture_10/bslides.pdf · Basic Types and...

Page 1: Graphs - Basic Typesturing.une.edu.au/~amth140/Lectures/Lecture_10/bslides.pdf · Basic Types and Features of Graphs Definition A simple graph is a graph that has neither loops nor

GraphsBasic Types

Ioan Despi

[email protected]

University of New England

July 24, 2013

Page 2: Graphs - Basic Typesturing.une.edu.au/~amth140/Lectures/Lecture_10/bslides.pdf · Basic Types and Features of Graphs Definition A simple graph is a graph that has neither loops nor

Outline

1 Definitions

2 Basic Types and Features of Graphs

3 Subgraph

4 Euler’s Theorem

5 Paths

6 Planar Graphs

Ioan Despi – AMTH140 2 of 19

Page 3: Graphs - Basic Typesturing.une.edu.au/~amth140/Lectures/Lecture_10/bslides.pdf · Basic Types and Features of Graphs Definition A simple graph is a graph that has neither loops nor

Definitions

Definition

A graph 𝐺 consists of

a set 𝑉 containing all vertices of 𝐺,

a set 𝐸 containing all edges of 𝐺,

an edge-endpoint function 𝜎 on 𝐺 which associates to each edge aunique pair of end points on 𝑉 .

It is denoted by 𝐺 = (𝑉,𝐸, 𝜎), or often simply by 𝐺 = (𝑉,𝐸).

Also, for a given graph 𝐺, we use 𝑉 (𝐺) and 𝐸(𝐺) to denote respectivelythe corresponding vertex set 𝑉 and edge set 𝐸.A graph is by default an undirected graph, which means a typical edge𝑒 is represented by the set {𝑣, 𝑤} of its vertices through theedge-endpoint function 𝜎, i.e., 𝜎(𝑒) = {𝑣, 𝑤}.A graph is called a directed graph, or digraph, if a typical edge in 𝐸 isrepresented by an ordered pair (𝑣, 𝑤) of its vertices, i.e., 𝜎(𝑒) = (𝑣, 𝑤).An edge in a digraph is sometimes also called a directed edge or an arc.

Ioan Despi – AMTH140 3 of 19

Page 4: Graphs - Basic Typesturing.une.edu.au/~amth140/Lectures/Lecture_10/bslides.pdf · Basic Types and Features of Graphs Definition A simple graph is a graph that has neither loops nor

Definitions

Definition

A graph 𝐺 consists of

a set 𝑉 containing all vertices of 𝐺,

a set 𝐸 containing all edges of 𝐺,

an edge-endpoint function 𝜎 on 𝐺 which associates to each edge aunique pair of end points on 𝑉 .

It is denoted by 𝐺 = (𝑉,𝐸, 𝜎), or often simply by 𝐺 = (𝑉,𝐸).Also, for a given graph 𝐺, we use 𝑉 (𝐺) and 𝐸(𝐺) to denote respectivelythe corresponding vertex set 𝑉 and edge set 𝐸.

A graph is by default an undirected graph, which means a typical edge𝑒 is represented by the set {𝑣, 𝑤} of its vertices through theedge-endpoint function 𝜎, i.e., 𝜎(𝑒) = {𝑣, 𝑤}.A graph is called a directed graph, or digraph, if a typical edge in 𝐸 isrepresented by an ordered pair (𝑣, 𝑤) of its vertices, i.e., 𝜎(𝑒) = (𝑣, 𝑤).An edge in a digraph is sometimes also called a directed edge or an arc.

Ioan Despi – AMTH140 3 of 19

Page 5: Graphs - Basic Typesturing.une.edu.au/~amth140/Lectures/Lecture_10/bslides.pdf · Basic Types and Features of Graphs Definition A simple graph is a graph that has neither loops nor

Definitions

Definition

A graph 𝐺 consists of

a set 𝑉 containing all vertices of 𝐺,

a set 𝐸 containing all edges of 𝐺,

an edge-endpoint function 𝜎 on 𝐺 which associates to each edge aunique pair of end points on 𝑉 .

It is denoted by 𝐺 = (𝑉,𝐸, 𝜎), or often simply by 𝐺 = (𝑉,𝐸).Also, for a given graph 𝐺, we use 𝑉 (𝐺) and 𝐸(𝐺) to denote respectivelythe corresponding vertex set 𝑉 and edge set 𝐸.A graph is by default an undirected graph, which means a typical edge𝑒 is represented by the set {𝑣, 𝑤} of its vertices through theedge-endpoint function 𝜎, i.e., 𝜎(𝑒) = {𝑣, 𝑤}.

A graph is called a directed graph, or digraph, if a typical edge in 𝐸 isrepresented by an ordered pair (𝑣, 𝑤) of its vertices, i.e., 𝜎(𝑒) = (𝑣, 𝑤).An edge in a digraph is sometimes also called a directed edge or an arc.

Ioan Despi – AMTH140 3 of 19

Page 6: Graphs - Basic Typesturing.une.edu.au/~amth140/Lectures/Lecture_10/bslides.pdf · Basic Types and Features of Graphs Definition A simple graph is a graph that has neither loops nor

Definitions

Definition

A graph 𝐺 consists of

a set 𝑉 containing all vertices of 𝐺,

a set 𝐸 containing all edges of 𝐺,

an edge-endpoint function 𝜎 on 𝐺 which associates to each edge aunique pair of end points on 𝑉 .

It is denoted by 𝐺 = (𝑉,𝐸, 𝜎), or often simply by 𝐺 = (𝑉,𝐸).Also, for a given graph 𝐺, we use 𝑉 (𝐺) and 𝐸(𝐺) to denote respectivelythe corresponding vertex set 𝑉 and edge set 𝐸.A graph is by default an undirected graph, which means a typical edge𝑒 is represented by the set {𝑣, 𝑤} of its vertices through theedge-endpoint function 𝜎, i.e., 𝜎(𝑒) = {𝑣, 𝑤}.A graph is called a directed graph, or digraph, if a typical edge in 𝐸 isrepresented by an ordered pair (𝑣, 𝑤) of its vertices, i.e., 𝜎(𝑒) = (𝑣, 𝑤).

An edge in a digraph is sometimes also called a directed edge or an arc.

Ioan Despi – AMTH140 3 of 19

Page 7: Graphs - Basic Typesturing.une.edu.au/~amth140/Lectures/Lecture_10/bslides.pdf · Basic Types and Features of Graphs Definition A simple graph is a graph that has neither loops nor

Definitions

Definition

A graph 𝐺 consists of

a set 𝑉 containing all vertices of 𝐺,

a set 𝐸 containing all edges of 𝐺,

an edge-endpoint function 𝜎 on 𝐺 which associates to each edge aunique pair of end points on 𝑉 .

It is denoted by 𝐺 = (𝑉,𝐸, 𝜎), or often simply by 𝐺 = (𝑉,𝐸).Also, for a given graph 𝐺, we use 𝑉 (𝐺) and 𝐸(𝐺) to denote respectivelythe corresponding vertex set 𝑉 and edge set 𝐸.A graph is by default an undirected graph, which means a typical edge𝑒 is represented by the set {𝑣, 𝑤} of its vertices through theedge-endpoint function 𝜎, i.e., 𝜎(𝑒) = {𝑣, 𝑤}.A graph is called a directed graph, or digraph, if a typical edge in 𝐸 isrepresented by an ordered pair (𝑣, 𝑤) of its vertices, i.e., 𝜎(𝑒) = (𝑣, 𝑤).An edge in a digraph is sometimes also called a directed edge or an arc.

Ioan Despi – AMTH140 3 of 19

Page 8: Graphs - Basic Typesturing.une.edu.au/~amth140/Lectures/Lecture_10/bslides.pdf · Basic Types and Features of Graphs Definition A simple graph is a graph that has neither loops nor

ExamplesIn all the graphs we draw, heavy dots denote vertices, lines or arcs denoteedges.

Example

Let 𝐺 = (𝑉,𝐸, 𝜎), where the vertex set is 𝑉 = {𝑣1, 𝑣2, 𝑣3, 𝑣4, 𝑣5}, the edge setis 𝐸 = {𝑒1, 𝑒2, 𝑒3, 𝑒4, 𝑒5} and the edge-endpoint function 𝜎 is given by

edge 𝑒 endpoints set 𝜎(𝑒)

𝑒1 {𝑣1}𝑒2 {𝑣1, 𝑣2}𝑒3 {𝑣2, 𝑣3}𝑒4 {𝑣2, 𝑣3}𝑒5 {𝑣2, 𝑣3}

Ioan Despi – AMTH140 4 of 19

Page 9: Graphs - Basic Typesturing.une.edu.au/~amth140/Lectures/Lecture_10/bslides.pdf · Basic Types and Features of Graphs Definition A simple graph is a graph that has neither loops nor

ExamplesIn all the graphs we draw, heavy dots denote vertices, lines or arcs denoteedges.

Example

Let 𝐺 = (𝑉,𝐸, 𝜎), where the vertex set is 𝑉 = {𝑣1, 𝑣2, 𝑣3, 𝑣4, 𝑣5}, the edge setis 𝐸 = {𝑒1, 𝑒2, 𝑒3, 𝑒4, 𝑒5} and the edge-endpoint function 𝜎 is given by

edge 𝑒 endpoints set 𝜎(𝑒)

𝑒1 {𝑣1}𝑒2 {𝑣1, 𝑣2}𝑒3 {𝑣2, 𝑣3}𝑒4 {𝑣2, 𝑣3}𝑒5 {𝑣2, 𝑣3}

Ioan Despi – AMTH140 4 of 19

Page 10: Graphs - Basic Typesturing.une.edu.au/~amth140/Lectures/Lecture_10/bslides.pdf · Basic Types and Features of Graphs Definition A simple graph is a graph that has neither loops nor

ExamplesIn all the graphs we draw, heavy dots denote vertices, lines or arcs denoteedges.

Example

Let 𝐺 = (𝑉,𝐸, 𝜎), where the vertex set is 𝑉 = {𝑣1, 𝑣2, 𝑣3, 𝑣4, 𝑣5}, the edge setis 𝐸 = {𝑒1, 𝑒2, 𝑒3, 𝑒4, 𝑒5} and the edge-endpoint function 𝜎 is given by

edge 𝑒 endpoints set 𝜎(𝑒)

𝑒1 {𝑣1}𝑒2 {𝑣1, 𝑣2}𝑒3 {𝑣2, 𝑣3}𝑒4 {𝑣2, 𝑣3}𝑒5 {𝑣2, 𝑣3}

Ioan Despi – AMTH140 4 of 19

Page 11: Graphs - Basic Typesturing.une.edu.au/~amth140/Lectures/Lecture_10/bslides.pdf · Basic Types and Features of Graphs Definition A simple graph is a graph that has neither loops nor

Examples

An edge with identical endpoints is a loop, e.g., 𝑒1.

Two or more edges that are incident to the same two vertices are calledmultiple edges or parallel edges, e.g., 𝑒3, 𝑒4, 𝑒5.

Ioan Despi – AMTH140 5 of 19

Page 12: Graphs - Basic Typesturing.une.edu.au/~amth140/Lectures/Lecture_10/bslides.pdf · Basic Types and Features of Graphs Definition A simple graph is a graph that has neither loops nor

Examples

An edge with identical endpoints is a loop, e.g., 𝑒1.

Two or more edges that are incident to the same two vertices are calledmultiple edges or parallel edges, e.g., 𝑒3, 𝑒4, 𝑒5.

Ioan Despi – AMTH140 5 of 19

Page 13: Graphs - Basic Typesturing.une.edu.au/~amth140/Lectures/Lecture_10/bslides.pdf · Basic Types and Features of Graphs Definition A simple graph is a graph that has neither loops nor

Examples

Example

In the directed graph below, the vertex set is 𝑉 = {𝑣1, 𝑣2, 𝑣3}, the edge set is𝐸 = {𝑒1, 𝑒2, 𝑒3, 𝑒4}, and the edge-endpoint function 𝜎 is given by

edge 𝑒 endpoints pair 𝜎(𝑒)

𝑒1 (𝑣1, 𝑣1)𝑒2 (𝑣1, 𝑣2)𝑒3 (𝑣3, 𝑣2)𝑒4 (𝑣2, 𝑣3)

v1

v2

v3

e1

e2

e3

e4

Ioan Despi – AMTH140 6 of 19

Page 14: Graphs - Basic Typesturing.une.edu.au/~amth140/Lectures/Lecture_10/bslides.pdf · Basic Types and Features of Graphs Definition A simple graph is a graph that has neither loops nor

Examples

Example

In the directed graph below, the vertex set is 𝑉 = {𝑣1, 𝑣2, 𝑣3}, the edge set is𝐸 = {𝑒1, 𝑒2, 𝑒3, 𝑒4}, and the edge-endpoint function 𝜎 is given by

edge 𝑒 endpoints pair 𝜎(𝑒)

𝑒1 (𝑣1, 𝑣1)𝑒2 (𝑣1, 𝑣2)𝑒3 (𝑣3, 𝑣2)𝑒4 (𝑣2, 𝑣3)

v1

v2

v3

e1

e2

e3

e4

Ioan Despi – AMTH140 6 of 19

Page 15: Graphs - Basic Typesturing.une.edu.au/~amth140/Lectures/Lecture_10/bslides.pdf · Basic Types and Features of Graphs Definition A simple graph is a graph that has neither loops nor

Basic Types and Features of Graphs

Definition

A simple graph is a graph that has neither loops nor parallel edges.

The identification of an edge 𝑒 with its endpoints 𝜎(𝑒) is unique. Thus anedge with endpoints 𝑣 and 𝑤 may be denoted by {𝑣, 𝑤}.

Definition

A complete graph, is a simple graph in which each pair of vertices are joinedby an edge.

The complete graph with 𝑛 vertices is denoted by 𝐾𝑛.

Definition

A graph is complete bipartite if it is a simple graph, and its vertices can beput into two groups so that any pair of vertices from different groups arejoined by an edge while no pair of vertices are joined by an edge if they arefrom a same group.

Such a graph is denoted by 𝐾𝑚,𝑛 if the two groups contains exactly 𝑚and 𝑛 vertices respectively.

Ioan Despi – AMTH140 7 of 19

Page 16: Graphs - Basic Typesturing.une.edu.au/~amth140/Lectures/Lecture_10/bslides.pdf · Basic Types and Features of Graphs Definition A simple graph is a graph that has neither loops nor

Basic Types and Features of Graphs

Definition

A simple graph is a graph that has neither loops nor parallel edges.

The identification of an edge 𝑒 with its endpoints 𝜎(𝑒) is unique. Thus anedge with endpoints 𝑣 and 𝑤 may be denoted by {𝑣, 𝑤}.

Definition

A complete graph, is a simple graph in which each pair of vertices are joinedby an edge.

The complete graph with 𝑛 vertices is denoted by 𝐾𝑛.

Definition

A graph is complete bipartite if it is a simple graph, and its vertices can beput into two groups so that any pair of vertices from different groups arejoined by an edge while no pair of vertices are joined by an edge if they arefrom a same group.

Such a graph is denoted by 𝐾𝑚,𝑛 if the two groups contains exactly 𝑚and 𝑛 vertices respectively.

Ioan Despi – AMTH140 7 of 19

Page 17: Graphs - Basic Typesturing.une.edu.au/~amth140/Lectures/Lecture_10/bslides.pdf · Basic Types and Features of Graphs Definition A simple graph is a graph that has neither loops nor

Basic Types and Features of Graphs

Definition

A simple graph is a graph that has neither loops nor parallel edges.

The identification of an edge 𝑒 with its endpoints 𝜎(𝑒) is unique. Thus anedge with endpoints 𝑣 and 𝑤 may be denoted by {𝑣, 𝑤}.

Definition

A complete graph, is a simple graph in which each pair of vertices are joinedby an edge.

The complete graph with 𝑛 vertices is denoted by 𝐾𝑛.

Definition

A graph is complete bipartite if it is a simple graph, and its vertices can beput into two groups so that any pair of vertices from different groups arejoined by an edge while no pair of vertices are joined by an edge if they arefrom a same group.

Such a graph is denoted by 𝐾𝑚,𝑛 if the two groups contains exactly 𝑚and 𝑛 vertices respectively.

Ioan Despi – AMTH140 7 of 19

Page 18: Graphs - Basic Typesturing.une.edu.au/~amth140/Lectures/Lecture_10/bslides.pdf · Basic Types and Features of Graphs Definition A simple graph is a graph that has neither loops nor

Examples

The first few 𝐾𝑛 are

Some 𝐾𝑚,𝑛 are:

Ioan Despi – AMTH140 8 of 19

Page 19: Graphs - Basic Typesturing.une.edu.au/~amth140/Lectures/Lecture_10/bslides.pdf · Basic Types and Features of Graphs Definition A simple graph is a graph that has neither loops nor

Examples

The first few 𝐾𝑛 are

Some 𝐾𝑚,𝑛 are:

Ioan Despi – AMTH140 8 of 19

Page 20: Graphs - Basic Typesturing.une.edu.au/~amth140/Lectures/Lecture_10/bslides.pdf · Basic Types and Features of Graphs Definition A simple graph is a graph that has neither loops nor

Examples

The first few 𝐾𝑛 are

Some 𝐾𝑚,𝑛 are:

Ioan Despi – AMTH140 8 of 19

Page 21: Graphs - Basic Typesturing.une.edu.au/~amth140/Lectures/Lecture_10/bslides.pdf · Basic Types and Features of Graphs Definition A simple graph is a graph that has neither loops nor

Examples

The first few 𝐾𝑛 are

Some 𝐾𝑚,𝑛 are:

Ioan Despi – AMTH140 8 of 19

Page 22: Graphs - Basic Typesturing.une.edu.au/~amth140/Lectures/Lecture_10/bslides.pdf · Basic Types and Features of Graphs Definition A simple graph is a graph that has neither loops nor

SubgraphDefinition

The graph 𝐻 is a subgraph of graph 𝐺 iff

(i) 𝑉 (𝐻) ⊆ 𝑉 (𝐺),

(ii) 𝐸(𝐻) ⊆ 𝐸(𝐺),

(iii) every edge in 𝐻 has same endpoints as in 𝐺.

Example

Suppose we let 𝑉 = {𝑣1, 𝑣2, 𝑣3}, 𝐸 = {𝑒} and 𝜎1(𝑒) = {𝑣1, 𝑣2}, 𝜎2(𝑒) = {𝑣2, 𝑣3},then graph 𝐺1(𝑉,𝐸, 𝜎1) and graph 𝐺2 = (𝑉,𝐸, 𝜎2) can be drawn as

v1

v2

v3

e

v1

v2

v3

e

G1 G2

Although it is obvious that 𝑉 (𝐺2) ⊆ 𝑉 (𝐺1) , 𝐸(𝐺2) ⊆ 𝐸(𝐺1) = {𝑒}, theendpoints of 𝑒 in 𝐺2 are different from those of 𝑒 in 𝐺1. Hence 𝐺2 is not asubgraph of 𝐺1.

Ioan Despi – AMTH140 9 of 19

Page 23: Graphs - Basic Typesturing.une.edu.au/~amth140/Lectures/Lecture_10/bslides.pdf · Basic Types and Features of Graphs Definition A simple graph is a graph that has neither loops nor

SubgraphDefinition

The graph 𝐻 is a subgraph of graph 𝐺 iff

(i) 𝑉 (𝐻) ⊆ 𝑉 (𝐺),

(ii) 𝐸(𝐻) ⊆ 𝐸(𝐺),

(iii) every edge in 𝐻 has same endpoints as in 𝐺.

Example

Suppose we let 𝑉 = {𝑣1, 𝑣2, 𝑣3}, 𝐸 = {𝑒} and 𝜎1(𝑒) = {𝑣1, 𝑣2}, 𝜎2(𝑒) = {𝑣2, 𝑣3},then graph 𝐺1(𝑉,𝐸, 𝜎1) and graph 𝐺2 = (𝑉,𝐸, 𝜎2) can be drawn as

v1

v2

v3

e

v1

v2

v3

e

G1 G2

Although it is obvious that 𝑉 (𝐺2) ⊆ 𝑉 (𝐺1) , 𝐸(𝐺2) ⊆ 𝐸(𝐺1) = {𝑒}, theendpoints of 𝑒 in 𝐺2 are different from those of 𝑒 in 𝐺1. Hence 𝐺2 is not asubgraph of 𝐺1.

Ioan Despi – AMTH140 9 of 19

Page 24: Graphs - Basic Typesturing.une.edu.au/~amth140/Lectures/Lecture_10/bslides.pdf · Basic Types and Features of Graphs Definition A simple graph is a graph that has neither loops nor

Examples

Example

Graph 𝐻 and graph 𝐹 are both subgraphs of 𝐺:

v1

v2

v3

v4 v1

v2

v4v1

v2v3

v4

e1

e2

e3

e4

e1e1

e2

GH F

Note. An ordered edge list is a list of the edges using the vertices todefine the edges and to give a direction along these edges. For example, ingraph 𝐺 above, an odered edge list would be {𝑣1𝑣2, 𝑣1𝑣4, 𝑣2𝑣3, 𝑣3𝑣4}.

Ioan Despi – AMTH140 10 of 19

Page 25: Graphs - Basic Typesturing.une.edu.au/~amth140/Lectures/Lecture_10/bslides.pdf · Basic Types and Features of Graphs Definition A simple graph is a graph that has neither loops nor

Examples

Example

Graph 𝐻 and graph 𝐹 are both subgraphs of 𝐺:

v1

v2

v3

v4 v1

v2

v4v1

v2v3

v4

e1

e2

e3

e4

e1e1

e2

GH F

Note. An ordered edge list is a list of the edges using the vertices todefine the edges and to give a direction along these edges. For example, ingraph 𝐺 above, an odered edge list would be {𝑣1𝑣2, 𝑣1𝑣4, 𝑣2𝑣3, 𝑣3𝑣4}.

Ioan Despi – AMTH140 10 of 19

Page 26: Graphs - Basic Typesturing.une.edu.au/~amth140/Lectures/Lecture_10/bslides.pdf · Basic Types and Features of Graphs Definition A simple graph is a graph that has neither loops nor

Vertex’s Degree

Definition

For any vertex 𝑣 of a graph 𝐺, its degree is the number of incidences of edgesat the vertex, and is denoted by 𝛿(𝑣), or deg(𝑣).

Notice that a loop is a special case and adds two to the degree.

Example

For graph

v1

v2

v3

v4

we have 𝛿(𝑣1) = 5, 𝛿(𝑣2) = 4, 𝛿(𝑣3) = 1 and 𝛿(𝑣4) = 0.

Ioan Despi – AMTH140 11 of 19

Page 27: Graphs - Basic Typesturing.une.edu.au/~amth140/Lectures/Lecture_10/bslides.pdf · Basic Types and Features of Graphs Definition A simple graph is a graph that has neither loops nor

Vertex’s Degree

Definition

For any vertex 𝑣 of a graph 𝐺, its degree is the number of incidences of edgesat the vertex, and is denoted by 𝛿(𝑣), or deg(𝑣).

Notice that a loop is a special case and adds two to the degree.

Example

For graph

v1

v2

v3

v4

we have 𝛿(𝑣1) = 5, 𝛿(𝑣2) = 4, 𝛿(𝑣3) = 1 and 𝛿(𝑣4) = 0.

Ioan Despi – AMTH140 11 of 19

Page 28: Graphs - Basic Typesturing.une.edu.au/~amth140/Lectures/Lecture_10/bslides.pdf · Basic Types and Features of Graphs Definition A simple graph is a graph that has neither loops nor

Euler’s Theorem

Two vertices are adjacent if they are connected by an edge. We oftencall these two vertices neighbors.

Two edges are adjacent if they have a vertex in common.

Theorem

(Euler): The sum of the degrees of the vertices of a graph is twice the numberof edges.

For any graph 𝐺, if we denote by ℰ the total number of edges, and by 𝒩 thesum of the total degrees of all the vertices, then 𝒩 = 2ℰ . This is becauseevery edge will supply exactly 1 to the degrees of each of its two end vertices.Hence 𝒩 must be always even. For the graph in the above example, forinstance, we have ℰ = 5 and𝒩 = 𝛿(𝑣1) + 𝛿(𝑣2) + 𝛿(𝑣3) + 𝛿(𝑣4) = 5 + 4 + 1 + 0 = 10, i.e. we have 𝒩 = 2ℰ .

Corollary

The number of vertices of odd degree is even.

Ioan Despi – AMTH140 12 of 19

Page 29: Graphs - Basic Typesturing.une.edu.au/~amth140/Lectures/Lecture_10/bslides.pdf · Basic Types and Features of Graphs Definition A simple graph is a graph that has neither loops nor

Euler’s Theorem

Two vertices are adjacent if they are connected by an edge. We oftencall these two vertices neighbors.Two edges are adjacent if they have a vertex in common.

Theorem

(Euler): The sum of the degrees of the vertices of a graph is twice the numberof edges.

For any graph 𝐺, if we denote by ℰ the total number of edges, and by 𝒩 thesum of the total degrees of all the vertices, then 𝒩 = 2ℰ . This is becauseevery edge will supply exactly 1 to the degrees of each of its two end vertices.Hence 𝒩 must be always even. For the graph in the above example, forinstance, we have ℰ = 5 and𝒩 = 𝛿(𝑣1) + 𝛿(𝑣2) + 𝛿(𝑣3) + 𝛿(𝑣4) = 5 + 4 + 1 + 0 = 10, i.e. we have 𝒩 = 2ℰ .

Corollary

The number of vertices of odd degree is even.

Ioan Despi – AMTH140 12 of 19

Page 30: Graphs - Basic Typesturing.une.edu.au/~amth140/Lectures/Lecture_10/bslides.pdf · Basic Types and Features of Graphs Definition A simple graph is a graph that has neither loops nor

Euler’s Theorem

Two vertices are adjacent if they are connected by an edge. We oftencall these two vertices neighbors.Two edges are adjacent if they have a vertex in common.

Theorem

(Euler): The sum of the degrees of the vertices of a graph is twice the numberof edges.

For any graph 𝐺, if we denote by ℰ the total number of edges, and by 𝒩 thesum of the total degrees of all the vertices, then 𝒩 = 2ℰ . This is becauseevery edge will supply exactly 1 to the degrees of each of its two end vertices.Hence 𝒩 must be always even. For the graph in the above example, forinstance, we have ℰ = 5 and𝒩 = 𝛿(𝑣1) + 𝛿(𝑣2) + 𝛿(𝑣3) + 𝛿(𝑣4) = 5 + 4 + 1 + 0 = 10, i.e. we have 𝒩 = 2ℰ .

Corollary

The number of vertices of odd degree is even.

Ioan Despi – AMTH140 12 of 19

Page 31: Graphs - Basic Typesturing.une.edu.au/~amth140/Lectures/Lecture_10/bslides.pdf · Basic Types and Features of Graphs Definition A simple graph is a graph that has neither loops nor

Euler’s Theorem

Two vertices are adjacent if they are connected by an edge. We oftencall these two vertices neighbors.Two edges are adjacent if they have a vertex in common.

Theorem

(Euler): The sum of the degrees of the vertices of a graph is twice the numberof edges.

For any graph 𝐺, if we denote by ℰ the total number of edges, and by 𝒩 thesum of the total degrees of all the vertices, then 𝒩 = 2ℰ . This is becauseevery edge will supply exactly 1 to the degrees of each of its two end vertices.Hence 𝒩 must be always even. For the graph in the above example, forinstance, we have ℰ = 5 and𝒩 = 𝛿(𝑣1) + 𝛿(𝑣2) + 𝛿(𝑣3) + 𝛿(𝑣4) = 5 + 4 + 1 + 0 = 10, i.e. we have 𝒩 = 2ℰ .

Corollary

The number of vertices of odd degree is even.

Ioan Despi – AMTH140 12 of 19

Page 32: Graphs - Basic Typesturing.une.edu.au/~amth140/Lectures/Lecture_10/bslides.pdf · Basic Types and Features of Graphs Definition A simple graph is a graph that has neither loops nor

Paths

Definition

Let 𝑣 and 𝑤 be vertices of a graph 𝐺. Then a walk from 𝑣 to 𝑤 is a sequenceof the form

𝑣0, 𝑒1, 𝑣1, 𝑒2, · · · , 𝑣𝑛−1, 𝑒𝑛, 𝑣𝑛 or alternatively

𝑣0𝑒1→ 𝑣1

𝑒2→ · · · 𝑒𝑛−1→ 𝑣𝑛−1𝑒𝑛→ 𝑣𝑛 , or simply

𝑣0 𝑒1 𝑣2 𝑒2 · · · 𝑣𝑛−1 𝑒𝑛 𝑣𝑛,such that𝑣0 = 𝑣, 𝑣𝑛 = 𝑤 and 𝑣𝑖−1 and 𝑣𝑖 are the endpoints of 𝑒𝑖, for 𝑖 = 1, · · · , 𝑛.

The number of edges, 𝑛, is called the length of the walk.A trivial walk consists of a single vertex, and has thus a zero length.

Definition

A graph 𝐺 is connected iff every pair of vertices of 𝐺 is joined by a walk;otherwise, the graph is disconnected.A bridge is an edge whose removal will cause the graph to becomedisconnected.

Note. Some texts use the word path instead of the word walk, while othersmay use path to denote a walk with distinct edges.

Ioan Despi – AMTH140 13 of 19

Page 33: Graphs - Basic Typesturing.une.edu.au/~amth140/Lectures/Lecture_10/bslides.pdf · Basic Types and Features of Graphs Definition A simple graph is a graph that has neither loops nor

Paths

Definition

Let 𝑣 and 𝑤 be vertices of a graph 𝐺. Then a walk from 𝑣 to 𝑤 is a sequenceof the form

𝑣0, 𝑒1, 𝑣1, 𝑒2, · · · , 𝑣𝑛−1, 𝑒𝑛, 𝑣𝑛 or alternatively

𝑣0𝑒1→ 𝑣1

𝑒2→ · · · 𝑒𝑛−1→ 𝑣𝑛−1𝑒𝑛→ 𝑣𝑛 , or simply

𝑣0 𝑒1 𝑣2 𝑒2 · · · 𝑣𝑛−1 𝑒𝑛 𝑣𝑛,such that𝑣0 = 𝑣, 𝑣𝑛 = 𝑤 and 𝑣𝑖−1 and 𝑣𝑖 are the endpoints of 𝑒𝑖, for 𝑖 = 1, · · · , 𝑛.

The number of edges, 𝑛, is called the length of the walk.A trivial walk consists of a single vertex, and has thus a zero length.

Definition

A graph 𝐺 is connected iff every pair of vertices of 𝐺 is joined by a walk;otherwise, the graph is disconnected.A bridge is an edge whose removal will cause the graph to becomedisconnected.

Note. Some texts use the word path instead of the word walk, while othersmay use path to denote a walk with distinct edges.

Ioan Despi – AMTH140 13 of 19

Page 34: Graphs - Basic Typesturing.une.edu.au/~amth140/Lectures/Lecture_10/bslides.pdf · Basic Types and Features of Graphs Definition A simple graph is a graph that has neither loops nor

Paths

Definition

Let 𝑣 and 𝑤 be vertices of a graph 𝐺. Then a walk from 𝑣 to 𝑤 is a sequenceof the form

𝑣0, 𝑒1, 𝑣1, 𝑒2, · · · , 𝑣𝑛−1, 𝑒𝑛, 𝑣𝑛 or alternatively

𝑣0𝑒1→ 𝑣1

𝑒2→ · · · 𝑒𝑛−1→ 𝑣𝑛−1𝑒𝑛→ 𝑣𝑛 , or simply

𝑣0 𝑒1 𝑣2 𝑒2 · · · 𝑣𝑛−1 𝑒𝑛 𝑣𝑛,such that𝑣0 = 𝑣, 𝑣𝑛 = 𝑤 and 𝑣𝑖−1 and 𝑣𝑖 are the endpoints of 𝑒𝑖, for 𝑖 = 1, · · · , 𝑛.

The number of edges, 𝑛, is called the length of the walk.A trivial walk consists of a single vertex, and has thus a zero length.

Definition

A graph 𝐺 is connected iff every pair of vertices of 𝐺 is joined by a walk;otherwise, the graph is disconnected.A bridge is an edge whose removal will cause the graph to becomedisconnected.

Note. Some texts use the word path instead of the word walk, while othersmay use path to denote a walk with distinct edges.

Ioan Despi – AMTH140 13 of 19

Page 35: Graphs - Basic Typesturing.une.edu.au/~amth140/Lectures/Lecture_10/bslides.pdf · Basic Types and Features of Graphs Definition A simple graph is a graph that has neither loops nor

Paths

Definition

Let 𝑣 and 𝑤 be vertices of a graph 𝐺. Then a walk from 𝑣 to 𝑤 is a sequenceof the form

𝑣0, 𝑒1, 𝑣1, 𝑒2, · · · , 𝑣𝑛−1, 𝑒𝑛, 𝑣𝑛 or alternatively

𝑣0𝑒1→ 𝑣1

𝑒2→ · · · 𝑒𝑛−1→ 𝑣𝑛−1𝑒𝑛→ 𝑣𝑛 , or simply

𝑣0 𝑒1 𝑣2 𝑒2 · · · 𝑣𝑛−1 𝑒𝑛 𝑣𝑛,such that𝑣0 = 𝑣, 𝑣𝑛 = 𝑤 and 𝑣𝑖−1 and 𝑣𝑖 are the endpoints of 𝑒𝑖, for 𝑖 = 1, · · · , 𝑛.

The number of edges, 𝑛, is called the length of the walk.A trivial walk consists of a single vertex, and has thus a zero length.

Definition

A graph 𝐺 is connected iff every pair of vertices of 𝐺 is joined by a walk;otherwise, the graph is disconnected.A bridge is an edge whose removal will cause the graph to becomedisconnected.

Note. Some texts use the word path instead of the word walk, while othersmay use path to denote a walk with distinct edges.

Ioan Despi – AMTH140 13 of 19

Page 36: Graphs - Basic Typesturing.une.edu.au/~amth140/Lectures/Lecture_10/bslides.pdf · Basic Types and Features of Graphs Definition A simple graph is a graph that has neither loops nor

Paths

Example

Graph 𝐺 is disconnected, because (for instance) we can’t walk from vertex 𝑣4to vertex 𝑣1, i.e., there is no walk from 𝑣4 to 𝑣1.

v1

v2

v3

e1

e2

v4

v5v6

v7

e3

e4

e5

Obviously 𝐺 can be decomposed into three connected components, 𝐺1, 𝐺2

and 𝐺3:

𝑉 (𝐺1) = {𝑣1, 𝑣2, 𝑣3} , 𝐸(𝐺1) = {𝑒1, 𝑒2} ;𝑉 (𝐺2) = {𝑣4} , 𝐸(𝐺2) = ∅ (the empty set) ;𝑉 (𝐺3) = {𝑣5, 𝑣6, 𝑣7} , 𝐸(𝐺3) = {𝑒3, 𝑒4, 𝑒5} .

This way each of 𝐺1, 𝐺2 and 𝐺3 is a connected subgraph.

Ioan Despi – AMTH140 14 of 19

Page 37: Graphs - Basic Typesturing.une.edu.au/~amth140/Lectures/Lecture_10/bslides.pdf · Basic Types and Features of Graphs Definition A simple graph is a graph that has neither loops nor

Paths

Example

Graph 𝐺 is disconnected, because (for instance) we can’t walk from vertex 𝑣4to vertex 𝑣1, i.e., there is no walk from 𝑣4 to 𝑣1.

v1

v2

v3

e1

e2

v4

v5v6

v7

e3

e4

e5

Obviously 𝐺 can be decomposed into three connected components, 𝐺1, 𝐺2

and 𝐺3:

𝑉 (𝐺1) = {𝑣1, 𝑣2, 𝑣3} , 𝐸(𝐺1) = {𝑒1, 𝑒2} ;𝑉 (𝐺2) = {𝑣4} , 𝐸(𝐺2) = ∅ (the empty set) ;𝑉 (𝐺3) = {𝑣5, 𝑣6, 𝑣7} , 𝐸(𝐺3) = {𝑒3, 𝑒4, 𝑒5} .

This way each of 𝐺1, 𝐺2 and 𝐺3 is a connected subgraph.

Ioan Despi – AMTH140 14 of 19

Page 38: Graphs - Basic Typesturing.une.edu.au/~amth140/Lectures/Lecture_10/bslides.pdf · Basic Types and Features of Graphs Definition A simple graph is a graph that has neither loops nor

Planar Graphs

Definition

A graph is planar iff it can be drawn in a 2-dimensional plane without anyaccidental graph edges crossing.

The regions bounded by the edges of a graph G are called faces.The outside of the graph is usually called the infinite face.

We introduce without proof the following important results:

Theorem

(Euler): If G is a connected plane graph with n vertices, m edges and f faces,then:

𝑛−𝑚 + 𝑓 = 2

Theorem

(Kuratowski): A graph is nonplanar if and only if it can be obtained fromeither 𝐾5 or 𝐾3,3 by adding some, or no, vertices and edges.

Ioan Despi – AMTH140 15 of 19

Page 39: Graphs - Basic Typesturing.une.edu.au/~amth140/Lectures/Lecture_10/bslides.pdf · Basic Types and Features of Graphs Definition A simple graph is a graph that has neither loops nor

Planar Graphs

Definition

A graph is planar iff it can be drawn in a 2-dimensional plane without anyaccidental graph edges crossing.

The regions bounded by the edges of a graph G are called faces.The outside of the graph is usually called the infinite face.

We introduce without proof the following important results:

Theorem

(Euler): If G is a connected plane graph with n vertices, m edges and f faces,then:

𝑛−𝑚 + 𝑓 = 2

Theorem

(Kuratowski): A graph is nonplanar if and only if it can be obtained fromeither 𝐾5 or 𝐾3,3 by adding some, or no, vertices and edges.

Ioan Despi – AMTH140 15 of 19

Page 40: Graphs - Basic Typesturing.une.edu.au/~amth140/Lectures/Lecture_10/bslides.pdf · Basic Types and Features of Graphs Definition A simple graph is a graph that has neither loops nor

Planar Graphs

Definition

A graph is planar iff it can be drawn in a 2-dimensional plane without anyaccidental graph edges crossing.

The regions bounded by the edges of a graph G are called faces.The outside of the graph is usually called the infinite face.

We introduce without proof the following important results:

Theorem

(Euler): If G is a connected plane graph with n vertices, m edges and f faces,then:

𝑛−𝑚 + 𝑓 = 2

Theorem

(Kuratowski): A graph is nonplanar if and only if it can be obtained fromeither 𝐾5 or 𝐾3,3 by adding some, or no, vertices and edges.

Ioan Despi – AMTH140 15 of 19

Page 41: Graphs - Basic Typesturing.une.edu.au/~amth140/Lectures/Lecture_10/bslides.pdf · Basic Types and Features of Graphs Definition A simple graph is a graph that has neither loops nor

Planar Graphs

Definition

A graph is planar iff it can be drawn in a 2-dimensional plane without anyaccidental graph edges crossing.

The regions bounded by the edges of a graph G are called faces.The outside of the graph is usually called the infinite face.

We introduce without proof the following important results:

Theorem

(Euler): If G is a connected plane graph with n vertices, m edges and f faces,then:

𝑛−𝑚 + 𝑓 = 2

Theorem

(Kuratowski): A graph is nonplanar if and only if it can be obtained fromeither 𝐾5 or 𝐾3,3 by adding some, or no, vertices and edges.

Ioan Despi – AMTH140 15 of 19

Page 42: Graphs - Basic Typesturing.une.edu.au/~amth140/Lectures/Lecture_10/bslides.pdf · Basic Types and Features of Graphs Definition A simple graph is a graph that has neither loops nor

Examples

Graph (a) is planar because it can be drawn as (b) or as (c)

(b)(a) (c)

Graph (d) is nonplanar because, after removing edges 𝑒 and 𝑓 , the graphbecomes 𝐾3,3.

v2

e f

v1

(d)

Hence, Kuratowski’s Theorem implies the original graph is nonplanar.

Ioan Despi – AMTH140 16 of 19

Page 43: Graphs - Basic Typesturing.une.edu.au/~amth140/Lectures/Lecture_10/bslides.pdf · Basic Types and Features of Graphs Definition A simple graph is a graph that has neither loops nor

Examples

Graph (a) is planar because it can be drawn as (b) or as (c)

(b)(a) (c)

Graph (d) is nonplanar because, after removing edges 𝑒 and 𝑓 , the graphbecomes 𝐾3,3.

v2

e f

v1

(d)

Hence, Kuratowski’s Theorem implies the original graph is nonplanar.

Ioan Despi – AMTH140 16 of 19

Page 44: Graphs - Basic Typesturing.une.edu.au/~amth140/Lectures/Lecture_10/bslides.pdf · Basic Types and Features of Graphs Definition A simple graph is a graph that has neither loops nor

Series reduction

The removal of a vertex from a graph (and its connecting end points) iscalled series reduction.

If a graph is planar, then obviously any of its subgraphs is also planar,even if series reductions are further performed.

Hence Kuratowski’s Theorem can be rephrased as sayinga graph is nonplanar iff it contains a subgraph which, after seriesreduction, is 𝐾5 or 𝐾3,3.

The above graphs are both minimal examples of non-planarity withintheir class of graphs:

I delete any edge or vertex from either one and the resulting graph is planar.

Kuratowski’s theorem singles these two graphs out as fundamentalobstructions to planarity within any graph.

Ioan Despi – AMTH140 17 of 19

Page 45: Graphs - Basic Typesturing.une.edu.au/~amth140/Lectures/Lecture_10/bslides.pdf · Basic Types and Features of Graphs Definition A simple graph is a graph that has neither loops nor

Series reduction

The removal of a vertex from a graph (and its connecting end points) iscalled series reduction.

If a graph is planar, then obviously any of its subgraphs is also planar,even if series reductions are further performed.

Hence Kuratowski’s Theorem can be rephrased as sayinga graph is nonplanar iff it contains a subgraph which, after seriesreduction, is 𝐾5 or 𝐾3,3.

The above graphs are both minimal examples of non-planarity withintheir class of graphs:

I delete any edge or vertex from either one and the resulting graph is planar.

Kuratowski’s theorem singles these two graphs out as fundamentalobstructions to planarity within any graph.

Ioan Despi – AMTH140 17 of 19

Page 46: Graphs - Basic Typesturing.une.edu.au/~amth140/Lectures/Lecture_10/bslides.pdf · Basic Types and Features of Graphs Definition A simple graph is a graph that has neither loops nor

Series reduction

The removal of a vertex from a graph (and its connecting end points) iscalled series reduction.

If a graph is planar, then obviously any of its subgraphs is also planar,even if series reductions are further performed.

Hence Kuratowski’s Theorem can be rephrased as sayinga graph is nonplanar iff it contains a subgraph which, after seriesreduction, is 𝐾5 or 𝐾3,3.

The above graphs are both minimal examples of non-planarity withintheir class of graphs:

I delete any edge or vertex from either one and the resulting graph is planar.

Kuratowski’s theorem singles these two graphs out as fundamentalobstructions to planarity within any graph.

Ioan Despi – AMTH140 17 of 19

Page 47: Graphs - Basic Typesturing.une.edu.au/~amth140/Lectures/Lecture_10/bslides.pdf · Basic Types and Features of Graphs Definition A simple graph is a graph that has neither loops nor

Series reduction

The removal of a vertex from a graph (and its connecting end points) iscalled series reduction.

If a graph is planar, then obviously any of its subgraphs is also planar,even if series reductions are further performed.

Hence Kuratowski’s Theorem can be rephrased as sayinga graph is nonplanar iff it contains a subgraph which, after seriesreduction, is 𝐾5 or 𝐾3,3.

The above graphs are both minimal examples of non-planarity withintheir class of graphs:

I delete any edge or vertex from either one and the resulting graph is planar.

Kuratowski’s theorem singles these two graphs out as fundamentalobstructions to planarity within any graph.

Ioan Despi – AMTH140 17 of 19

Page 48: Graphs - Basic Typesturing.une.edu.au/~amth140/Lectures/Lecture_10/bslides.pdf · Basic Types and Features of Graphs Definition A simple graph is a graph that has neither loops nor

Series reduction

The removal of a vertex from a graph (and its connecting end points) iscalled series reduction.

If a graph is planar, then obviously any of its subgraphs is also planar,even if series reductions are further performed.

Hence Kuratowski’s Theorem can be rephrased as sayinga graph is nonplanar iff it contains a subgraph which, after seriesreduction, is 𝐾5 or 𝐾3,3.

The above graphs are both minimal examples of non-planarity withintheir class of graphs:

I delete any edge or vertex from either one and the resulting graph is planar.

Kuratowski’s theorem singles these two graphs out as fundamentalobstructions to planarity within any graph.

Ioan Despi – AMTH140 17 of 19

Page 49: Graphs - Basic Typesturing.une.edu.au/~amth140/Lectures/Lecture_10/bslides.pdf · Basic Types and Features of Graphs Definition A simple graph is a graph that has neither loops nor

Series reduction

The removal of a vertex from a graph (and its connecting end points) iscalled series reduction.

If a graph is planar, then obviously any of its subgraphs is also planar,even if series reductions are further performed.

Hence Kuratowski’s Theorem can be rephrased as sayinga graph is nonplanar iff it contains a subgraph which, after seriesreduction, is 𝐾5 or 𝐾3,3.

The above graphs are both minimal examples of non-planarity withintheir class of graphs:

I delete any edge or vertex from either one and the resulting graph is planar.

Kuratowski’s theorem singles these two graphs out as fundamentalobstructions to planarity within any graph.

Ioan Despi – AMTH140 17 of 19

Page 50: Graphs - Basic Typesturing.une.edu.au/~amth140/Lectures/Lecture_10/bslides.pdf · Basic Types and Features of Graphs Definition A simple graph is a graph that has neither loops nor

𝐾5 and 𝐾3,3

Ioan Despi – AMTH140 18 of 19

Page 51: Graphs - Basic Typesturing.une.edu.au/~amth140/Lectures/Lecture_10/bslides.pdf · Basic Types and Features of Graphs Definition A simple graph is a graph that has neither loops nor

The complement of a Graph

Definition

The complement (inverse) of a graph 𝐺 is a graph 𝐻 on the same verticessuch that two vertices of 𝐻 are adjacent iff they are not adjacent in 𝐺.

That is, to generate the complement of a graph

fill in all the missing edges required to form a complete graph

remove all that were previously there

The simplest non-trivial complementary graphs are the 4-vertex path graphand the 5-vertex cycle graphs:

The complement of an edgeless graph is a complete graph and vice-versa.

Ioan Despi – AMTH140 19 of 19

Page 52: Graphs - Basic Typesturing.une.edu.au/~amth140/Lectures/Lecture_10/bslides.pdf · Basic Types and Features of Graphs Definition A simple graph is a graph that has neither loops nor

The complement of a Graph

Definition

The complement (inverse) of a graph 𝐺 is a graph 𝐻 on the same verticessuch that two vertices of 𝐻 are adjacent iff they are not adjacent in 𝐺.

That is, to generate the complement of a graph

fill in all the missing edges required to form a complete graph

remove all that were previously there

The simplest non-trivial complementary graphs are the 4-vertex path graphand the 5-vertex cycle graphs:

The complement of an edgeless graph is a complete graph and vice-versa.

Ioan Despi – AMTH140 19 of 19