Lecture 3. Properties of graphs - Urząd Miasta...

79

Transcript of Lecture 3. Properties of graphs - Urząd Miasta...

Page 1: Lecture 3. Properties of graphs - Urząd Miasta Łodzimarmaj/GNT/Lectures/properties_of_graphs.pdf · Basic graph ropperties Operations on graphs Imprtanto graphs Subgraphs Connected

Basic graph properties

Lecture 3.Properties of graphs

March 06, 2019

Lecture 3. Properties of graphs 1 / 35

Page 2: Lecture 3. Properties of graphs - Urząd Miasta Łodzimarmaj/GNT/Lectures/properties_of_graphs.pdf · Basic graph ropperties Operations on graphs Imprtanto graphs Subgraphs Connected

Basic graph properties

Operations on graphsImportant graphsSubgraphsConnected graphs

Union of graphs.

De�nition

The union of two graphs G1 = (V1,E1) and G2 = (V2,E2) is the graphG = (V ,E) = G1 ∪ G2 which is the union of their vertex and edge sets:V = V1 ∪ V2 and E = E1 ∪ E2.

Lecture 3. Properties of graphs 2 / 35

Page 3: Lecture 3. Properties of graphs - Urząd Miasta Łodzimarmaj/GNT/Lectures/properties_of_graphs.pdf · Basic graph ropperties Operations on graphs Imprtanto graphs Subgraphs Connected

Basic graph properties

Operations on graphsImportant graphsSubgraphsConnected graphs

Join of graphs

De�nition

A graph G = (V ,E) is called a join of two graphs G1 = (V1,E1) andG2 = (V2,E2) (we denote a join by G1 + G2), if V = V1 ∪ V2 andE = E1 ∪ E2 ∪ {{v1, v2} : v1 ∈ V1, v2 ∈ V2}

Theorem

If G = G1 + G2, then |V | = |V1|+ |V2| and |E | = |E1|+ |E2|+ |V1| ∗ |V2|.

Lecture 3. Properties of graphs 3 / 35

Page 4: Lecture 3. Properties of graphs - Urząd Miasta Łodzimarmaj/GNT/Lectures/properties_of_graphs.pdf · Basic graph ropperties Operations on graphs Imprtanto graphs Subgraphs Connected

Basic graph properties

Operations on graphsImportant graphsSubgraphsConnected graphs

Join of graphs

De�nition

A graph G = (V ,E) is called a join of two graphs G1 = (V1,E1) andG2 = (V2,E2) (we denote a join by G1 + G2), if V = V1 ∪ V2 andE = E1 ∪ E2 ∪ {{v1, v2} : v1 ∈ V1, v2 ∈ V2}

Theorem

If G = G1 + G2, then |V | = |V1|+ |V2| and |E | = |E1|+ |E2|+ |V1| ∗ |V2|.

Lecture 3. Properties of graphs 3 / 35

Page 5: Lecture 3. Properties of graphs - Urząd Miasta Łodzimarmaj/GNT/Lectures/properties_of_graphs.pdf · Basic graph ropperties Operations on graphs Imprtanto graphs Subgraphs Connected

Basic graph properties

Operations on graphsImportant graphsSubgraphsConnected graphs

Regular graphs

De�nition

A simple graph for which every vertex has the same degree is called a regular

graph. A regular graph with vertices of degree r is called a r�regular graph

or regular graph of degree r . A 3-regular graph is called as a cubic graph.

a) b) c) d) e)

Property

A r−regular graph with n vertices possesses nr2

edges.

Lecture 3. Properties of graphs 4 / 35

Page 6: Lecture 3. Properties of graphs - Urząd Miasta Łodzimarmaj/GNT/Lectures/properties_of_graphs.pdf · Basic graph ropperties Operations on graphs Imprtanto graphs Subgraphs Connected

Basic graph properties

Operations on graphsImportant graphsSubgraphsConnected graphs

Regular graphs

De�nition

A simple graph for which every vertex has the same degree is called a regular

graph. A regular graph with vertices of degree r is called a r�regular graph

or regular graph of degree r . A 3-regular graph is called as a cubic graph.

a) b) c) d) e)

Property

A r−regular graph with n vertices possesses nr2

edges.

Lecture 3. Properties of graphs 4 / 35

Page 7: Lecture 3. Properties of graphs - Urząd Miasta Łodzimarmaj/GNT/Lectures/properties_of_graphs.pdf · Basic graph ropperties Operations on graphs Imprtanto graphs Subgraphs Connected

Basic graph properties

Operations on graphsImportant graphsSubgraphsConnected graphs

Triangular graphs

De�nition

A triangular graph Tn is the simple graph which vertices are bijectivlymapped to two-element subsets of a n−element set X and any two verticesare connected with edge if and only if the corresponding sets are not disjoint.

T2 and T3

Lecture 3. Properties of graphs 5 / 35

Page 8: Lecture 3. Properties of graphs - Urząd Miasta Łodzimarmaj/GNT/Lectures/properties_of_graphs.pdf · Basic graph ropperties Operations on graphs Imprtanto graphs Subgraphs Connected

Basic graph properties

Operations on graphsImportant graphsSubgraphsConnected graphs

Graf T4

For the set {1, 2, 3, 4} we get two−element subsets

{1, 2}, {1, 3}, {1, 4}, {2, 3}, {2, 4}, {3, 4}and we get

{1,2} {2,4}

{1,4} {3,4}

{1,3}

{2,3}

Lecture 3. Properties of graphs 6 / 35

Page 9: Lecture 3. Properties of graphs - Urząd Miasta Łodzimarmaj/GNT/Lectures/properties_of_graphs.pdf · Basic graph ropperties Operations on graphs Imprtanto graphs Subgraphs Connected

Basic graph properties

Operations on graphsImportant graphsSubgraphsConnected graphs

Triangular graphs

Properties of Tn

1 Tn possesses exactly |V | =(n2

)= n(n−1)

2vertices.

2 The degree of any vertex is 2n − 4.

Corrolary

Triangular graphs are (2n − 4)−regular graphs.

Lecture 3. Properties of graphs 7 / 35

Page 10: Lecture 3. Properties of graphs - Urząd Miasta Łodzimarmaj/GNT/Lectures/properties_of_graphs.pdf · Basic graph ropperties Operations on graphs Imprtanto graphs Subgraphs Connected

Basic graph properties

Operations on graphsImportant graphsSubgraphsConnected graphs

Triangular graphs

Properties of Tn

1 Tn possesses exactly |V | =(n2

)= n(n−1)

2vertices.

2 The degree of any vertex is 2n − 4.

Corrolary

Triangular graphs are (2n − 4)−regular graphs.

Lecture 3. Properties of graphs 7 / 35

Page 11: Lecture 3. Properties of graphs - Urząd Miasta Łodzimarmaj/GNT/Lectures/properties_of_graphs.pdf · Basic graph ropperties Operations on graphs Imprtanto graphs Subgraphs Connected

Basic graph properties

Operations on graphsImportant graphsSubgraphsConnected graphs

Complete graphs

De�nition

A simple undirected graph is called the complete graph if every pair ofdistinct vertices is connected by a unique edge. A complete graph with nvertices will be denoted by Kn.

K1 K2 K3 K4 K5

Lecture 3. Properties of graphs 8 / 35

Page 12: Lecture 3. Properties of graphs - Urząd Miasta Łodzimarmaj/GNT/Lectures/properties_of_graphs.pdf · Basic graph ropperties Operations on graphs Imprtanto graphs Subgraphs Connected

Basic graph properties

Operations on graphsImportant graphsSubgraphsConnected graphs

Complete graphs

Property

For every v ∈ Kn we have that deg(v) = n − 1.

Theorem

The number of edges of Kn is

|EKn | =n (n − 1)

2.

Lecture 3. Properties of graphs 9 / 35

Page 13: Lecture 3. Properties of graphs - Urząd Miasta Łodzimarmaj/GNT/Lectures/properties_of_graphs.pdf · Basic graph ropperties Operations on graphs Imprtanto graphs Subgraphs Connected

Basic graph properties

Operations on graphsImportant graphsSubgraphsConnected graphs

Empty graph

De�nition

If E = ∅ and V 6= ∅ then a graph G = (V ,E) is called the empty gaph Theempty graph with n vertices will be denoted by Nn.

N8

Property

1 Any empty graph Nn consists ofn isolated vertices.

2 An empty Nn 0−regular graph.

Lecture 3. Properties of graphs 10 / 35

Page 14: Lecture 3. Properties of graphs - Urząd Miasta Łodzimarmaj/GNT/Lectures/properties_of_graphs.pdf · Basic graph ropperties Operations on graphs Imprtanto graphs Subgraphs Connected

Basic graph properties

Operations on graphsImportant graphsSubgraphsConnected graphs

Cycle graphs

De�nition

A connected 2−regular graph is called a cycle graph or a circular graph. Acircular graph with n vertices will be denoted by Cn.

C5

Property

A graph Cn has exactly n edges.

Lecture 3. Properties of graphs 11 / 35

Page 15: Lecture 3. Properties of graphs - Urząd Miasta Łodzimarmaj/GNT/Lectures/properties_of_graphs.pdf · Basic graph ropperties Operations on graphs Imprtanto graphs Subgraphs Connected

Basic graph properties

Operations on graphsImportant graphsSubgraphsConnected graphs

Cycle graphs

De�nition

A connected 2−regular graph is called a cycle graph or a circular graph. Acircular graph with n vertices will be denoted by Cn.

C5

Property

A graph Cn has exactly n edges.

Lecture 3. Properties of graphs 11 / 35

Page 16: Lecture 3. Properties of graphs - Urząd Miasta Łodzimarmaj/GNT/Lectures/properties_of_graphs.pdf · Basic graph ropperties Operations on graphs Imprtanto graphs Subgraphs Connected

Basic graph properties

Operations on graphsImportant graphsSubgraphsConnected graphs

Cycle graphs

De�nition

A connected 2−regular graph is called a cycle graph or a circular graph. Acircular graph with n vertices will be denoted by Cn.

C5

Property

A graph Cn has exactly n edges.

Lecture 3. Properties of graphs 11 / 35

Page 17: Lecture 3. Properties of graphs - Urząd Miasta Łodzimarmaj/GNT/Lectures/properties_of_graphs.pdf · Basic graph ropperties Operations on graphs Imprtanto graphs Subgraphs Connected

Basic graph properties

Operations on graphsImportant graphsSubgraphsConnected graphs

Path graphs

De�nition

If we delete from a graph Cn exactly one edge we get a graph which is calleda path graph. A path graph with n vertices will be denoted by Pn.

P6

Property

1 Any Pn is not regular.

2 A graph Pn possesses exactly 2vertices of degree one and theremaining n − 2 vertices are ofdegree two.

Lecture 3. Properties of graphs 12 / 35

Page 18: Lecture 3. Properties of graphs - Urząd Miasta Łodzimarmaj/GNT/Lectures/properties_of_graphs.pdf · Basic graph ropperties Operations on graphs Imprtanto graphs Subgraphs Connected

Basic graph properties

Operations on graphsImportant graphsSubgraphsConnected graphs

Path graphs

De�nition

If we delete from a graph Cn exactly one edge we get a graph which is calleda path graph. A path graph with n vertices will be denoted by Pn.

P6

Property

1 Any Pn is not regular.

2 A graph Pn possesses exactly 2vertices of degree one and theremaining n − 2 vertices are ofdegree two.

Lecture 3. Properties of graphs 12 / 35

Page 19: Lecture 3. Properties of graphs - Urząd Miasta Łodzimarmaj/GNT/Lectures/properties_of_graphs.pdf · Basic graph ropperties Operations on graphs Imprtanto graphs Subgraphs Connected

Basic graph properties

Operations on graphsImportant graphsSubgraphsConnected graphs

Path graphs

De�nition

If we delete from a graph Cn exactly one edge we get a graph which is calleda path graph. A path graph with n vertices will be denoted by Pn.

P6

Property

1 Any Pn is not regular.

2 A graph Pn possesses exactly 2vertices of degree one and theremaining n − 2 vertices are ofdegree two.

Lecture 3. Properties of graphs 12 / 35

Page 20: Lecture 3. Properties of graphs - Urząd Miasta Łodzimarmaj/GNT/Lectures/properties_of_graphs.pdf · Basic graph ropperties Operations on graphs Imprtanto graphs Subgraphs Connected

Basic graph properties

Operations on graphsImportant graphsSubgraphsConnected graphs

Disks

De�nition

A disk Wn is the graph Wn = Cn−1 + N1.

W6 = C5 + N1

Lecture 3. Properties of graphs 13 / 35

Page 21: Lecture 3. Properties of graphs - Urząd Miasta Łodzimarmaj/GNT/Lectures/properties_of_graphs.pdf · Basic graph ropperties Operations on graphs Imprtanto graphs Subgraphs Connected

Basic graph properties

Operations on graphsImportant graphsSubgraphsConnected graphs

Bipartite graphs

Let G = (V ,E) be a simple graph.

De�nition

G is called bipartite if its set of vertices V is the union of two nonemptydisjoint sets V1 i V2 such that every edge of G connects a vertex from V1

with a vertex from V2.

x1

x1

x2

x2

x3 x3

y1

y1

y2

y2

y3

Lecture 3. Properties of graphs 14 / 35

Page 22: Lecture 3. Properties of graphs - Urząd Miasta Łodzimarmaj/GNT/Lectures/properties_of_graphs.pdf · Basic graph ropperties Operations on graphs Imprtanto graphs Subgraphs Connected

Basic graph properties

Operations on graphsImportant graphsSubgraphsConnected graphs

Bipartite graphs

Let G = (V ,E) be a simple graph.

De�nition

G is called bipartite if its set of vertices V is the union of two nonemptydisjoint sets V1 i V2 such that every edge of G connects a vertex from V1

with a vertex from V2.

x1

x1

x2

x2

x3 x3

y1

y1

y2

y2

y3

Lecture 3. Properties of graphs 14 / 35

Page 23: Lecture 3. Properties of graphs - Urząd Miasta Łodzimarmaj/GNT/Lectures/properties_of_graphs.pdf · Basic graph ropperties Operations on graphs Imprtanto graphs Subgraphs Connected

Basic graph properties

Operations on graphsImportant graphsSubgraphsConnected graphs

Bipartite graphs

Theorem

If G is bipartite, then every cycle in G is of even length.

Lecture 3. Properties of graphs 15 / 35

Page 24: Lecture 3. Properties of graphs - Urząd Miasta Łodzimarmaj/GNT/Lectures/properties_of_graphs.pdf · Basic graph ropperties Operations on graphs Imprtanto graphs Subgraphs Connected

Basic graph properties

Operations on graphsImportant graphsSubgraphsConnected graphs

Complete bipartite graphs

De�nition

A bipartite graph is called complete bipartite graph, if every vertex from V1

is connected with every vertex from V2 with exactly one edge. A completebipartite graph for which |V1| = r and |V2| = s will be denoted by Kr,s .

x1

x1

x1

x1

x1

x1x2

x2

x2

x2

x2

x2x3 x3x3

x3 x3

y1

y1

y1 y1 y1y2

y2

y3

y2

y2K1,3 K2,2 K2,3

K3,3 K3,3

K2,3

y1y2 y3

Properties

1 Kr,s = Nr + Ns

2 Every Kr,s hasexactly r + svertices.

3 Every Kr,s hasexactly r · sedges.

Lecture 3. Properties of graphs 16 / 35

Page 25: Lecture 3. Properties of graphs - Urząd Miasta Łodzimarmaj/GNT/Lectures/properties_of_graphs.pdf · Basic graph ropperties Operations on graphs Imprtanto graphs Subgraphs Connected

Basic graph properties

Operations on graphsImportant graphsSubgraphsConnected graphs

Complete bipartite graphs

De�nition

A bipartite graph is called complete bipartite graph, if every vertex from V1

is connected with every vertex from V2 with exactly one edge. A completebipartite graph for which |V1| = r and |V2| = s will be denoted by Kr,s .

x1

x1

x1

x1

x1

x1x2

x2

x2

x2

x2

x2x3 x3x3

x3 x3

y1

y1

y1 y1 y1y2

y2

y3

y2

y2K1,3 K2,2 K2,3

K3,3 K3,3

K2,3

y1y2 y3

Properties

1 Kr,s = Nr + Ns

2 Every Kr,s hasexactly r + svertices.

3 Every Kr,s hasexactly r · sedges.

Lecture 3. Properties of graphs 16 / 35

Page 26: Lecture 3. Properties of graphs - Urząd Miasta Łodzimarmaj/GNT/Lectures/properties_of_graphs.pdf · Basic graph ropperties Operations on graphs Imprtanto graphs Subgraphs Connected

Basic graph properties

Operations on graphsImportant graphsSubgraphsConnected graphs

Complete bipartite graphs

De�nition

A bipartite graph is called complete bipartite graph, if every vertex from V1

is connected with every vertex from V2 with exactly one edge. A completebipartite graph for which |V1| = r and |V2| = s will be denoted by Kr,s .

x1

x1

x1

x1

x1

x1x2

x2

x2

x2

x2

x2x3 x3x3

x3 x3

y1

y1

y1 y1 y1y2

y2

y3

y2

y2K1,3 K2,2 K2,3

K3,3 K3,3

K2,3

y1y2 y3

Properties

1 Kr,s = Nr + Ns

2 Every Kr,s hasexactly r + svertices.

3 Every Kr,s hasexactly r · sedges.

Lecture 3. Properties of graphs 16 / 35

Page 27: Lecture 3. Properties of graphs - Urząd Miasta Łodzimarmaj/GNT/Lectures/properties_of_graphs.pdf · Basic graph ropperties Operations on graphs Imprtanto graphs Subgraphs Connected

Basic graph properties

Operations on graphsImportant graphsSubgraphsConnected graphs

Complete bipartite graphs

De�nition

A bipartite graph is called complete bipartite graph, if every vertex from V1

is connected with every vertex from V2 with exactly one edge. A completebipartite graph for which |V1| = r and |V2| = s will be denoted by Kr,s .

x1

x1

x1

x1

x1

x1x2

x2

x2

x2

x2

x2x3 x3x3

x3 x3

y1

y1

y1 y1 y1y2

y2

y3

y2

y2K1,3 K2,2 K2,3

K3,3 K3,3

K2,3

y1y2 y3

Properties

1 Kr,s = Nr + Ns

2 Every Kr,s hasexactly r + svertices.

3 Every Kr,s hasexactly r · sedges.

Lecture 3. Properties of graphs 16 / 35

Page 28: Lecture 3. Properties of graphs - Urząd Miasta Łodzimarmaj/GNT/Lectures/properties_of_graphs.pdf · Basic graph ropperties Operations on graphs Imprtanto graphs Subgraphs Connected

Basic graph properties

Operations on graphsImportant graphsSubgraphsConnected graphs

Complete bipartite graphs

De�nition

A bipartite graph is called complete bipartite graph, if every vertex from V1

is connected with every vertex from V2 with exactly one edge. A completebipartite graph for which |V1| = r and |V2| = s will be denoted by Kr,s .

x1

x1

x1

x1

x1

x1x2

x2

x2

x2

x2

x2x3 x3x3

x3 x3

y1

y1

y1 y1 y1y2

y2

y3

y2

y2K1,3 K2,2 K2,3

K3,3 K3,3

K2,3

y1y2 y3

Properties

1 Kr,s = Nr + Ns

2 Every Kr,s hasexactly r + svertices.

3 Every Kr,s hasexactly r · sedges.

Lecture 3. Properties of graphs 16 / 35

Page 29: Lecture 3. Properties of graphs - Urząd Miasta Łodzimarmaj/GNT/Lectures/properties_of_graphs.pdf · Basic graph ropperties Operations on graphs Imprtanto graphs Subgraphs Connected

Basic graph properties

Operations on graphsImportant graphsSubgraphsConnected graphs

BIPART(G , s;S ,T , bip)

1 Q ← 0, bip ← true, S ← ∅2 for every v ∈ V3 do

4 d(v)←∞5 d(s)← 0, s ⇒ Q6 while Q 6= ∅ and bip = true7 do

8 u ← head [Q]9 for every v ∈ Adj [u]

10 do

11 if d(v) =∞ then d(v)← d(u) + 1; v ⇒ Q12 else if d(u) = d(v) then bip ← false13 if bip = true14 then

15 for v ∈ V16 do

17 if d(v) = 0(mod2) then S ← S ∪ {v}18 T ← V \ S

Algorithm

Inputs: a connected graph G , anarbitrarily chosen vertex s of GOutputs: if G is bipartite, then bipis true and we get S i T , such thatS ∪ T = V i S ∩ T = ∅

Lecture 3. Properties of graphs 17 / 35

Page 30: Lecture 3. Properties of graphs - Urząd Miasta Łodzimarmaj/GNT/Lectures/properties_of_graphs.pdf · Basic graph ropperties Operations on graphs Imprtanto graphs Subgraphs Connected

Basic graph properties

Operations on graphsImportant graphsSubgraphsConnected graphs

Hypercubes

De�nition

A graph which vertices can be bijectively mapped to all binary sequences(a1, a2, . . . , an) and its edges are connected if and only if correspondingsequences di�er at exactly one position (one bit) is called n−hypercube andwill be denoted by Qn.

000 001

101100

110 111

010 011

Lecture 3. Properties of graphs 18 / 35

Page 31: Lecture 3. Properties of graphs - Urząd Miasta Łodzimarmaj/GNT/Lectures/properties_of_graphs.pdf · Basic graph ropperties Operations on graphs Imprtanto graphs Subgraphs Connected

Basic graph properties

Operations on graphsImportant graphsSubgraphsConnected graphs

Hypercubes

De�nition

A graph which vertices can be bijectively mapped to all binary sequences(a1, a2, . . . , an) and its edges are connected if and only if correspondingsequences di�er at exactly one position (one bit) is called n−hypercube andwill be denoted by Qn.

000 001

101100

110 111

010 011

Lecture 3. Properties of graphs 18 / 35

Page 32: Lecture 3. Properties of graphs - Urząd Miasta Łodzimarmaj/GNT/Lectures/properties_of_graphs.pdf · Basic graph ropperties Operations on graphs Imprtanto graphs Subgraphs Connected

Basic graph properties

Operations on graphsImportant graphsSubgraphsConnected graphs

The performance of professor Abracadabrus

Professor Abracadabrus gives his assistant a collection of n coins and leavesthe stage.Assistant asks an arbitrary person from the audience to put n coins on thetable in a row in an arbitrary way (heads or tails up).The audience says a number from the set {1, ..., n} and the assistant �ipsone coin upside down (he knows which!).Then professor Abracadabrus comes back to the stage.For which number n of coins professor could guess the number given by theaudience?

Lecture 3. Properties of graphs 19 / 35

Page 33: Lecture 3. Properties of graphs - Urząd Miasta Łodzimarmaj/GNT/Lectures/properties_of_graphs.pdf · Basic graph ropperties Operations on graphs Imprtanto graphs Subgraphs Connected

Basic graph properties

Operations on graphsImportant graphsSubgraphsConnected graphs

The performance of professor Abracadabrus

Professor Abracadabrus gives his assistant a collection of n coins and leavesthe stage.Assistant asks an arbitrary person from the audience to put n coins on thetable in a row in an arbitrary way (heads or tails up).The audience says a number from the set {1, ..., n} and the assistant �ipsone coin upside down (he knows which!).Then professor Abracadabrus comes back to the stage.For which number n of coins professor could guess the number given by theaudience?

Lecture 3. Properties of graphs 19 / 35

Page 34: Lecture 3. Properties of graphs - Urząd Miasta Łodzimarmaj/GNT/Lectures/properties_of_graphs.pdf · Basic graph ropperties Operations on graphs Imprtanto graphs Subgraphs Connected

Basic graph properties

Operations on graphsImportant graphsSubgraphsConnected graphs

The performance of professor Abracadabrus

Professor Abracadabrus gives his assistant a collection of n coins and leavesthe stage.Assistant asks an arbitrary person from the audience to put n coins on thetable in a row in an arbitrary way (heads or tails up).The audience says a number from the set {1, ..., n} and the assistant �ipsone coin upside down (he knows which!).Then professor Abracadabrus comes back to the stage.For which number n of coins professor could guess the number given by theaudience?

Lecture 3. Properties of graphs 19 / 35

Page 35: Lecture 3. Properties of graphs - Urząd Miasta Łodzimarmaj/GNT/Lectures/properties_of_graphs.pdf · Basic graph ropperties Operations on graphs Imprtanto graphs Subgraphs Connected

Basic graph properties

Operations on graphsImportant graphsSubgraphsConnected graphs

The performance of professor Abracadabrus

Professor Abracadabrus gives his assistant a collection of n coins and leavesthe stage.Assistant asks an arbitrary person from the audience to put n coins on thetable in a row in an arbitrary way (heads or tails up).The audience says a number from the set {1, ..., n} and the assistant �ipsone coin upside down (he knows which!).Then professor Abracadabrus comes back to the stage.For which number n of coins professor could guess the number given by theaudience?

Lecture 3. Properties of graphs 19 / 35

Page 36: Lecture 3. Properties of graphs - Urząd Miasta Łodzimarmaj/GNT/Lectures/properties_of_graphs.pdf · Basic graph ropperties Operations on graphs Imprtanto graphs Subgraphs Connected

Basic graph properties

Operations on graphsImportant graphsSubgraphsConnected graphs

The performance of professor Abracadabrus

Professor Abracadabrus gives his assistant a collection of n coins and leavesthe stage.Assistant asks an arbitrary person from the audience to put n coins on thetable in a row in an arbitrary way (heads or tails up).The audience says a number from the set {1, ..., n} and the assistant �ipsone coin upside down (he knows which!).Then professor Abracadabrus comes back to the stage.For which number n of coins professor could guess the number given by theaudience?

Lecture 3. Properties of graphs 19 / 35

Page 37: Lecture 3. Properties of graphs - Urząd Miasta Łodzimarmaj/GNT/Lectures/properties_of_graphs.pdf · Basic graph ropperties Operations on graphs Imprtanto graphs Subgraphs Connected

Basic graph properties

Operations on graphsImportant graphsSubgraphsConnected graphs

Line graphs

De�nition

A line graph L(G) of a undirected graph G is a graph which verticescorrespond bijectively to the edges of G and every two vertices of L(G) areadjacent if and only if the corresponding edges in G are adjacent

Lecture 3. Properties of graphs 20 / 35

Page 38: Lecture 3. Properties of graphs - Urząd Miasta Łodzimarmaj/GNT/Lectures/properties_of_graphs.pdf · Basic graph ropperties Operations on graphs Imprtanto graphs Subgraphs Connected

Basic graph properties

Operations on graphsImportant graphsSubgraphsConnected graphs

Line graphs

De�nition

A line graph L(G) of a undirected graph G is a graph which verticescorrespond bijectively to the edges of G and every two vertices of L(G) areadjacent if and only if the corresponding edges in G are adjacent

Lecture 3. Properties of graphs 20 / 35

Page 39: Lecture 3. Properties of graphs - Urząd Miasta Łodzimarmaj/GNT/Lectures/properties_of_graphs.pdf · Basic graph ropperties Operations on graphs Imprtanto graphs Subgraphs Connected

Basic graph properties

Operations on graphsImportant graphsSubgraphsConnected graphs

Complement graph

De�nition

A complement or an inverse of a graph G = (V ,E) is the graph G whichset of vertices is identical with the set of vertices of G and every vertices areadjacent if and only if they are not adjacent in G .

u

y

x w

v

u

y

x w

v

Property

1 A complement of Kn is the empty graph Nn.

2 A complement of bipartite graph Kr,s is the union of Kr i Ks .

Lecture 3. Properties of graphs 21 / 35

Page 40: Lecture 3. Properties of graphs - Urząd Miasta Łodzimarmaj/GNT/Lectures/properties_of_graphs.pdf · Basic graph ropperties Operations on graphs Imprtanto graphs Subgraphs Connected

Basic graph properties

Operations on graphsImportant graphsSubgraphsConnected graphs

Complement graph

De�nition

A complement or an inverse of a graph G = (V ,E) is the graph G whichset of vertices is identical with the set of vertices of G and every vertices areadjacent if and only if they are not adjacent in G .

u

y

x w

v

u

y

x w

v

Property

1 A complement of Kn is the empty graph Nn.

2 A complement of bipartite graph Kr,s is the union of Kr i Ks .

Lecture 3. Properties of graphs 21 / 35

Page 41: Lecture 3. Properties of graphs - Urząd Miasta Łodzimarmaj/GNT/Lectures/properties_of_graphs.pdf · Basic graph ropperties Operations on graphs Imprtanto graphs Subgraphs Connected

Basic graph properties

Operations on graphsImportant graphsSubgraphsConnected graphs

Complement graph

De�nition

A complement or an inverse of a graph G = (V ,E) is the graph G whichset of vertices is identical with the set of vertices of G and every vertices areadjacent if and only if they are not adjacent in G .

u

y

x w

v

u

y

x w

v

Property

1 A complement of Kn is the empty graph Nn.

2 A complement of bipartite graph Kr,s is the union of Kr i Ks .

Lecture 3. Properties of graphs 21 / 35

Page 42: Lecture 3. Properties of graphs - Urząd Miasta Łodzimarmaj/GNT/Lectures/properties_of_graphs.pdf · Basic graph ropperties Operations on graphs Imprtanto graphs Subgraphs Connected

Basic graph properties

Operations on graphsImportant graphsSubgraphsConnected graphs

Complement graph

De�nition

A complement or an inverse of a graph G = (V ,E) is the graph G whichset of vertices is identical with the set of vertices of G and every vertices areadjacent if and only if they are not adjacent in G .

u

y

x w

v

u

y

x w

v

Property

1 A complement of Kn is the empty graph Nn.

2 A complement of bipartite graph Kr,s is the union of Kr i Ks .

Lecture 3. Properties of graphs 21 / 35

Page 43: Lecture 3. Properties of graphs - Urząd Miasta Łodzimarmaj/GNT/Lectures/properties_of_graphs.pdf · Basic graph ropperties Operations on graphs Imprtanto graphs Subgraphs Connected

Basic graph properties

Operations on graphsImportant graphsSubgraphsConnected graphs

Subgraphs of a graph

De�nition

A graph H = (VH ,EH) is called a subgraph of a graph G = (VG ,EG ) if andonly if:

VH ⊂ VG

EH ⊂ EG

G G’1 G’2x1

x1x2

x3

x3

x3

x4

x4

x4

x5 x5

x5

a

ab

b

c

cd

d

e

e

f

f

g

g

Lecture 3. Properties of graphs 22 / 35

Page 44: Lecture 3. Properties of graphs - Urząd Miasta Łodzimarmaj/GNT/Lectures/properties_of_graphs.pdf · Basic graph ropperties Operations on graphs Imprtanto graphs Subgraphs Connected

Basic graph properties

Operations on graphsImportant graphsSubgraphsConnected graphs

Subgraphs of a graph

De�nition

A graph H = (VH ,EH) is called a subgraph of a graph G = (VG ,EG ) if andonly if:

VH ⊂ VG

EH ⊂ EG

G G’1 G’2x1

x1x2

x3

x3

x3

x4

x4

x4

x5 x5

x5

a

ab

b

c

cd

d

e

e

f

f

g

g

Lecture 3. Properties of graphs 22 / 35

Page 45: Lecture 3. Properties of graphs - Urząd Miasta Łodzimarmaj/GNT/Lectures/properties_of_graphs.pdf · Basic graph ropperties Operations on graphs Imprtanto graphs Subgraphs Connected

Basic graph properties

Operations on graphsImportant graphsSubgraphsConnected graphs

Subgraphs properties

Property

1 Each graph is its own subgraph.

2 A subgraph G ′′ of a graph G ′, which is a subgraph of G , is a subgraphof G i.e (

G ′ ⊂ G ∧ G ′′ ⊂ G ′)⇒ G ′′ ⊂ G .

(being a subgraph is a transitive relation)

3 A single vertex of the graph G is a subgraph of G .

4 A single edge of G together with its ends is a subgraph of G .

5 Every simple graph G with n vertices is a subgraph of Kn.

6 The total number of di�erent simple graph containing n vertices is equalto

2n(n−1)

2

Lecture 3. Properties of graphs 23 / 35

Page 46: Lecture 3. Properties of graphs - Urząd Miasta Łodzimarmaj/GNT/Lectures/properties_of_graphs.pdf · Basic graph ropperties Operations on graphs Imprtanto graphs Subgraphs Connected

Basic graph properties

Operations on graphsImportant graphsSubgraphsConnected graphs

Subgraphs properties

Property

1 Each graph is its own subgraph.

2 A subgraph G ′′ of a graph G ′, which is a subgraph of G , is a subgraphof G i.e (

G ′ ⊂ G ∧ G ′′ ⊂ G ′)⇒ G ′′ ⊂ G .

(being a subgraph is a transitive relation)

3 A single vertex of the graph G is a subgraph of G .

4 A single edge of G together with its ends is a subgraph of G .

5 Every simple graph G with n vertices is a subgraph of Kn.

6 The total number of di�erent simple graph containing n vertices is equalto

2n(n−1)

2

Lecture 3. Properties of graphs 23 / 35

Page 47: Lecture 3. Properties of graphs - Urząd Miasta Łodzimarmaj/GNT/Lectures/properties_of_graphs.pdf · Basic graph ropperties Operations on graphs Imprtanto graphs Subgraphs Connected

Basic graph properties

Operations on graphsImportant graphsSubgraphsConnected graphs

Subgraphs properties

Property

1 Each graph is its own subgraph.

2 A subgraph G ′′ of a graph G ′, which is a subgraph of G , is a subgraphof G i.e (

G ′ ⊂ G ∧ G ′′ ⊂ G ′)⇒ G ′′ ⊂ G .

(being a subgraph is a transitive relation)

3 A single vertex of the graph G is a subgraph of G .

4 A single edge of G together with its ends is a subgraph of G .

5 Every simple graph G with n vertices is a subgraph of Kn.

6 The total number of di�erent simple graph containing n vertices is equalto

2n(n−1)

2

Lecture 3. Properties of graphs 23 / 35

Page 48: Lecture 3. Properties of graphs - Urząd Miasta Łodzimarmaj/GNT/Lectures/properties_of_graphs.pdf · Basic graph ropperties Operations on graphs Imprtanto graphs Subgraphs Connected

Basic graph properties

Operations on graphsImportant graphsSubgraphsConnected graphs

Subgraphs properties

Property

1 Each graph is its own subgraph.

2 A subgraph G ′′ of a graph G ′, which is a subgraph of G , is a subgraphof G i.e (

G ′ ⊂ G ∧ G ′′ ⊂ G ′)⇒ G ′′ ⊂ G .

(being a subgraph is a transitive relation)

3 A single vertex of the graph G is a subgraph of G .

4 A single edge of G together with its ends is a subgraph of G .

5 Every simple graph G with n vertices is a subgraph of Kn.

6 The total number of di�erent simple graph containing n vertices is equalto

2n(n−1)

2

Lecture 3. Properties of graphs 23 / 35

Page 49: Lecture 3. Properties of graphs - Urząd Miasta Łodzimarmaj/GNT/Lectures/properties_of_graphs.pdf · Basic graph ropperties Operations on graphs Imprtanto graphs Subgraphs Connected

Basic graph properties

Operations on graphsImportant graphsSubgraphsConnected graphs

Subgraphs properties

Property

1 Each graph is its own subgraph.

2 A subgraph G ′′ of a graph G ′, which is a subgraph of G , is a subgraphof G i.e (

G ′ ⊂ G ∧ G ′′ ⊂ G ′)⇒ G ′′ ⊂ G .

(being a subgraph is a transitive relation)

3 A single vertex of the graph G is a subgraph of G .

4 A single edge of G together with its ends is a subgraph of G .

5 Every simple graph G with n vertices is a subgraph of Kn.

6 The total number of di�erent simple graph containing n vertices is equalto

2n(n−1)

2

Lecture 3. Properties of graphs 23 / 35

Page 50: Lecture 3. Properties of graphs - Urząd Miasta Łodzimarmaj/GNT/Lectures/properties_of_graphs.pdf · Basic graph ropperties Operations on graphs Imprtanto graphs Subgraphs Connected

Basic graph properties

Operations on graphsImportant graphsSubgraphsConnected graphs

Subgraphs properties

Property

1 Each graph is its own subgraph.

2 A subgraph G ′′ of a graph G ′, which is a subgraph of G , is a subgraphof G i.e (

G ′ ⊂ G ∧ G ′′ ⊂ G ′)⇒ G ′′ ⊂ G .

(being a subgraph is a transitive relation)

3 A single vertex of the graph G is a subgraph of G .

4 A single edge of G together with its ends is a subgraph of G .

5 Every simple graph G with n vertices is a subgraph of Kn.

6 The total number of di�erent simple graph containing n vertices is equalto

2n(n−1)

2

Lecture 3. Properties of graphs 23 / 35

Page 51: Lecture 3. Properties of graphs - Urząd Miasta Łodzimarmaj/GNT/Lectures/properties_of_graphs.pdf · Basic graph ropperties Operations on graphs Imprtanto graphs Subgraphs Connected

Basic graph properties

Operations on graphsImportant graphsSubgraphsConnected graphs

Subgraphs of a graph

Let G = (V ,E) be a graph and let e ∈ E .

G − e denotes a subgraph obtained from the graph G by removing the edgee.

Let F be any subset of edges of a graph G (F ⊂ E) then G − F stands for asubgraph of G derived by removing all the edges which belong to F

x xx yy

y

z zz u uu

v vv

a aa

b c cc

dd

e eef ff

g gg

G G - b G - {d,b}

Lecture 3. Properties of graphs 24 / 35

Page 52: Lecture 3. Properties of graphs - Urząd Miasta Łodzimarmaj/GNT/Lectures/properties_of_graphs.pdf · Basic graph ropperties Operations on graphs Imprtanto graphs Subgraphs Connected

Basic graph properties

Operations on graphsImportant graphsSubgraphsConnected graphs

Subgraphs of a graph

Let G = (V ,E) be a graph and let e ∈ E .

G − e denotes a subgraph obtained from the graph G by removing the edgee.

Let F be any subset of edges of a graph G (F ⊂ E) then G − F stands for asubgraph of G derived by removing all the edges which belong to F

x xx yy

y

z zz u uu

v vv

a aa

b c cc

dd

e eef ff

g gg

G G - b G - {d,b}

Lecture 3. Properties of graphs 24 / 35

Page 53: Lecture 3. Properties of graphs - Urząd Miasta Łodzimarmaj/GNT/Lectures/properties_of_graphs.pdf · Basic graph ropperties Operations on graphs Imprtanto graphs Subgraphs Connected

Basic graph properties

Operations on graphsImportant graphsSubgraphsConnected graphs

Subgraphs of a graph

Let G = (V ,E) be a graph and let e ∈ E .

G − e denotes a subgraph obtained from the graph G by removing the edgee.

Let F be any subset of edges of a graph G (F ⊂ E) then G − F stands for asubgraph of G derived by removing all the edges which belong to F

x xx yy

y

z zz u uu

v vv

a aa

b c cc

dd

e eef ff

g gg

G G - b G - {d,b}

Lecture 3. Properties of graphs 24 / 35

Page 54: Lecture 3. Properties of graphs - Urząd Miasta Łodzimarmaj/GNT/Lectures/properties_of_graphs.pdf · Basic graph ropperties Operations on graphs Imprtanto graphs Subgraphs Connected

Basic graph properties

Operations on graphsImportant graphsSubgraphsConnected graphs

Subgraphs of a graph

Let G = (V ,E) be a graph and let e ∈ E .

G − e denotes a subgraph obtained from the graph G by removing the edgee.

Let F be any subset of edges of a graph G (F ⊂ E) then G − F stands for asubgraph of G derived by removing all the edges which belong to F

x xx yy

y

z zz u uu

v vv

a aa

b c cc

dd

e eef ff

g gg

G G - b G - {d,b}

Lecture 3. Properties of graphs 24 / 35

Page 55: Lecture 3. Properties of graphs - Urząd Miasta Łodzimarmaj/GNT/Lectures/properties_of_graphs.pdf · Basic graph ropperties Operations on graphs Imprtanto graphs Subgraphs Connected

Basic graph properties

Operations on graphsImportant graphsSubgraphsConnected graphs

Subgraphs of a graph

Let G = (V ,E) be a graph and let v ∈ V .

G − v stands for a subgraph G derived from G by removing the vertex v andall the edges incident with v .

If S is any subset of V (S ⊂ V ∧ S 6= V ), then G − S stands for a graphwhich we obtain from the graph G by removing all vertices belonging to theset S and all the edges incident to any vertex of S .

x xy y y

u u

v vva a

ef

gg

G - z G - {z,u} G - {z,x}

Lecture 3. Properties of graphs 25 / 35

Page 56: Lecture 3. Properties of graphs - Urząd Miasta Łodzimarmaj/GNT/Lectures/properties_of_graphs.pdf · Basic graph ropperties Operations on graphs Imprtanto graphs Subgraphs Connected

Basic graph properties

Operations on graphsImportant graphsSubgraphsConnected graphs

Subgraphs of a graph

Let G = (V ,E) be a graph and let v ∈ V .

G − v stands for a subgraph G derived from G by removing the vertex v andall the edges incident with v .

If S is any subset of V (S ⊂ V ∧ S 6= V ), then G − S stands for a graphwhich we obtain from the graph G by removing all vertices belonging to theset S and all the edges incident to any vertex of S .

x xy y y

u u

v vva a

ef

gg

G - z G - {z,u} G - {z,x}

Lecture 3. Properties of graphs 25 / 35

Page 57: Lecture 3. Properties of graphs - Urząd Miasta Łodzimarmaj/GNT/Lectures/properties_of_graphs.pdf · Basic graph ropperties Operations on graphs Imprtanto graphs Subgraphs Connected

Basic graph properties

Operations on graphsImportant graphsSubgraphsConnected graphs

Subgraphs of a graph

Let G = (V ,E) be a graph and let v ∈ V .

G − v stands for a subgraph G derived from G by removing the vertex v andall the edges incident with v .

If S is any subset of V (S ⊂ V ∧ S 6= V ), then G − S stands for a graphwhich we obtain from the graph G by removing all vertices belonging to theset S and all the edges incident to any vertex of S .

x xy y y

u u

v vva a

ef

gg

G - z G - {z,u} G - {z,x}

Lecture 3. Properties of graphs 25 / 35

Page 58: Lecture 3. Properties of graphs - Urząd Miasta Łodzimarmaj/GNT/Lectures/properties_of_graphs.pdf · Basic graph ropperties Operations on graphs Imprtanto graphs Subgraphs Connected

Basic graph properties

Operations on graphsImportant graphsSubgraphsConnected graphs

Subgraphs of a graph

Let G = (V ,E) be a graph and let v ∈ V .

G − v stands for a subgraph G derived from G by removing the vertex v andall the edges incident with v .

If S is any subset of V (S ⊂ V ∧ S 6= V ), then G − S stands for a graphwhich we obtain from the graph G by removing all vertices belonging to theset S and all the edges incident to any vertex of S .

x xy y y

u u

v vva a

ef

gg

G - z G - {z,u} G - {z,x}

Lecture 3. Properties of graphs 25 / 35

Page 59: Lecture 3. Properties of graphs - Urząd Miasta Łodzimarmaj/GNT/Lectures/properties_of_graphs.pdf · Basic graph ropperties Operations on graphs Imprtanto graphs Subgraphs Connected

Basic graph properties

Operations on graphsImportant graphsSubgraphsConnected graphs

Graf cz¦±ciowy

De�nition

A graph H is called the spanning graph of a graph G if H is a subgraph of Gand VH = VG .

Gx1 x2

x3x4

x5

x4

Hx1 x2

x3

x5

Lecture 3. Properties of graphs 26 / 35

Page 60: Lecture 3. Properties of graphs - Urząd Miasta Łodzimarmaj/GNT/Lectures/properties_of_graphs.pdf · Basic graph ropperties Operations on graphs Imprtanto graphs Subgraphs Connected

Basic graph properties

Operations on graphsImportant graphsSubgraphsConnected graphs

Graf cz¦±ciowy

De�nition

A graph H is called the spanning graph of a graph G if H is a subgraph of Gand VH = VG .

Gx1 x2

x3x4

x5

x4

Hx1 x2

x3

x5

Lecture 3. Properties of graphs 26 / 35

Page 61: Lecture 3. Properties of graphs - Urząd Miasta Łodzimarmaj/GNT/Lectures/properties_of_graphs.pdf · Basic graph ropperties Operations on graphs Imprtanto graphs Subgraphs Connected

Basic graph properties

Operations on graphsImportant graphsSubgraphsConnected graphs

Clique

De�nition

A clique is a subgraph of some graph for which every two vertices areincident.

Lecture 3. Properties of graphs 27 / 35

Page 62: Lecture 3. Properties of graphs - Urząd Miasta Łodzimarmaj/GNT/Lectures/properties_of_graphs.pdf · Basic graph ropperties Operations on graphs Imprtanto graphs Subgraphs Connected

Basic graph properties

Operations on graphsImportant graphsSubgraphsConnected graphs

Clique

De�nition

A clique is a subgraph of some graph for which every two vertices areincident.

Lecture 3. Properties of graphs 27 / 35

Page 63: Lecture 3. Properties of graphs - Urząd Miasta Łodzimarmaj/GNT/Lectures/properties_of_graphs.pdf · Basic graph ropperties Operations on graphs Imprtanto graphs Subgraphs Connected

Basic graph properties

Operations on graphsImportant graphsSubgraphsConnected graphs

Clique

De�nition

A clique is called maximal, if it is impossible to add any vertex so that thenew graph also is a clique.A clique is called the largest, if there is not any clique in a graph with alarger number of vertices.The largest clique number of vertices is denoted by ω(G).

Lecture 3. Properties of graphs 28 / 35

Page 64: Lecture 3. Properties of graphs - Urząd Miasta Łodzimarmaj/GNT/Lectures/properties_of_graphs.pdf · Basic graph ropperties Operations on graphs Imprtanto graphs Subgraphs Connected

Basic graph properties

Operations on graphsImportant graphsSubgraphsConnected graphs

Clique

De�nition

A clique is called maximal, if it is impossible to add any vertex so that thenew graph also is a clique.A clique is called the largest, if there is not any clique in a graph with alarger number of vertices.The largest clique number of vertices is denoted by ω(G).

Lecture 3. Properties of graphs 28 / 35

Page 65: Lecture 3. Properties of graphs - Urząd Miasta Łodzimarmaj/GNT/Lectures/properties_of_graphs.pdf · Basic graph ropperties Operations on graphs Imprtanto graphs Subgraphs Connected

Basic graph properties

Operations on graphsImportant graphsSubgraphsConnected graphs

Clique

De�nition

A clique is called maximal, if it is impossible to add any vertex so that thenew graph also is a clique.A clique is called the largest, if there is not any clique in a graph with alarger number of vertices.The largest clique number of vertices is denoted by ω(G).

Lecture 3. Properties of graphs 28 / 35

Page 66: Lecture 3. Properties of graphs - Urząd Miasta Łodzimarmaj/GNT/Lectures/properties_of_graphs.pdf · Basic graph ropperties Operations on graphs Imprtanto graphs Subgraphs Connected

Basic graph properties

Operations on graphsImportant graphsSubgraphsConnected graphs

Clique

De�nition

A clique is called maximal, if it is impossible to add any vertex so that thenew graph also is a clique.A clique is called the largest, if there is not any clique in a graph with alarger number of vertices.The largest clique number of vertices is denoted by ω(G).

Lecture 3. Properties of graphs 28 / 35

Page 67: Lecture 3. Properties of graphs - Urząd Miasta Łodzimarmaj/GNT/Lectures/properties_of_graphs.pdf · Basic graph ropperties Operations on graphs Imprtanto graphs Subgraphs Connected

Basic graph properties

Operations on graphsImportant graphsSubgraphsConnected graphs

Clique

De�nition

A clique is called maximal, if it is impossible to add any vertex so that thenew graph also is a clique.A clique is called the largest, if there is not any clique in a graph with alarger number of vertices.The largest clique number of vertices is denoted by ω(G).

Lecture 3. Properties of graphs 29 / 35

Page 68: Lecture 3. Properties of graphs - Urząd Miasta Łodzimarmaj/GNT/Lectures/properties_of_graphs.pdf · Basic graph ropperties Operations on graphs Imprtanto graphs Subgraphs Connected

Basic graph properties

Operations on graphsImportant graphsSubgraphsConnected graphs

Induced subgraphs

De�nition

Let G = (V ,E) be a graph and let A ⊂ V . A graph H = (A,EH) = G(A) iscalled the subgraph induced by the set A ifEH = {{u, v} : u, v ∈ A and {u, v} ∈ E}.

Induced subgraphs G [1, 2, 3, 5, 7, 10]

Lecture 3. Properties of graphs 30 / 35

Page 69: Lecture 3. Properties of graphs - Urząd Miasta Łodzimarmaj/GNT/Lectures/properties_of_graphs.pdf · Basic graph ropperties Operations on graphs Imprtanto graphs Subgraphs Connected

Basic graph properties

Operations on graphsImportant graphsSubgraphsConnected graphs

Induced subgraphs

De�nition

Let G = (V ,E) be a graph and let A ⊂ V . A graph H = (A,EH) = G(A) iscalled the subgraph induced by the set A ifEH = {{u, v} : u, v ∈ A and {u, v} ∈ E}.

Induced subgraphs G [1, 2, 3, 5, 7, 10]

Lecture 3. Properties of graphs 30 / 35

Page 70: Lecture 3. Properties of graphs - Urząd Miasta Łodzimarmaj/GNT/Lectures/properties_of_graphs.pdf · Basic graph ropperties Operations on graphs Imprtanto graphs Subgraphs Connected

Basic graph properties

Operations on graphsImportant graphsSubgraphsConnected graphs

Connected component

De�nition

Any connected subgraph G1 of the graph G (G1 ⊂ G), which is notcontained in any larger (in terms of a number of vertices and edges)connected subgraph of G is called the connected component of G .

x2x10 x8 x7x9x1

x6 x3 x4x5

x11 x2x10 x8 x7x9x1

x6 x3 x4x5

x11

a b

c d

x y

zw

It is obvious that any isolated vertex in the graph is its connected component.

Lecture 3. Properties of graphs 31 / 35

Page 71: Lecture 3. Properties of graphs - Urząd Miasta Łodzimarmaj/GNT/Lectures/properties_of_graphs.pdf · Basic graph ropperties Operations on graphs Imprtanto graphs Subgraphs Connected

Basic graph properties

Operations on graphsImportant graphsSubgraphsConnected graphs

Connected component

De�nition

Any connected subgraph G1 of the graph G (G1 ⊂ G), which is notcontained in any larger (in terms of a number of vertices and edges)connected subgraph of G is called the connected component of G .

x2x10 x8 x7x9x1

x6 x3 x4x5

x11 x2x10 x8 x7x9x1

x6 x3 x4x5

x11

a b

c d

x y

zw

It is obvious that any isolated vertex in the graph is its connected component.

Lecture 3. Properties of graphs 31 / 35

Page 72: Lecture 3. Properties of graphs - Urząd Miasta Łodzimarmaj/GNT/Lectures/properties_of_graphs.pdf · Basic graph ropperties Operations on graphs Imprtanto graphs Subgraphs Connected

Basic graph properties

Operations on graphsImportant graphsSubgraphsConnected graphs

Connected component

De�nition

Any connected subgraph G1 of the graph G (G1 ⊂ G), which is notcontained in any larger (in terms of a number of vertices and edges)connected subgraph of G is called the connected component of G .

x2x10 x8 x7x9x1

x6 x3 x4x5

x11 x2x10 x8 x7x9x1

x6 x3 x4x5

x11

a b

c d

x y

zw

It is obvious that any isolated vertex in the graph is its connected component.

Lecture 3. Properties of graphs 31 / 35

Page 73: Lecture 3. Properties of graphs - Urząd Miasta Łodzimarmaj/GNT/Lectures/properties_of_graphs.pdf · Basic graph ropperties Operations on graphs Imprtanto graphs Subgraphs Connected

Basic graph properties

Operations on graphsImportant graphsSubgraphsConnected graphs

Theorem

A connected graph with n vertices has at least n − 1 edges.

Theorem

The number m of edges in any simple and connected graph with n verticessatis�es the following property

n − 1 ≤ m ≤ n(n − 1)

2

Theorem

Let G be a simple graph with n vertices. If a graph G has k components,then the number m of edges satis�es the inequality

n − k ≤ m ≤ 1

2(n − k) (n − k + 1)

Every simple graph with n vertices and at least (n−1)(n−2)2

edges is connected.

Lecture 3. Properties of graphs 32 / 35

Page 74: Lecture 3. Properties of graphs - Urząd Miasta Łodzimarmaj/GNT/Lectures/properties_of_graphs.pdf · Basic graph ropperties Operations on graphs Imprtanto graphs Subgraphs Connected

Basic graph properties

Operations on graphsImportant graphsSubgraphsConnected graphs

Theorem

A connected graph with n vertices has at least n − 1 edges.

Theorem

The number m of edges in any simple and connected graph with n verticessatis�es the following property

n − 1 ≤ m ≤ n(n − 1)

2

Theorem

Let G be a simple graph with n vertices. If a graph G has k components,then the number m of edges satis�es the inequality

n − k ≤ m ≤ 1

2(n − k) (n − k + 1)

Every simple graph with n vertices and at least (n−1)(n−2)2

edges is connected.

Lecture 3. Properties of graphs 32 / 35

Page 75: Lecture 3. Properties of graphs - Urząd Miasta Łodzimarmaj/GNT/Lectures/properties_of_graphs.pdf · Basic graph ropperties Operations on graphs Imprtanto graphs Subgraphs Connected

Basic graph properties

Operations on graphsImportant graphsSubgraphsConnected graphs

Theorem

A connected graph with n vertices has at least n − 1 edges.

Theorem

The number m of edges in any simple and connected graph with n verticessatis�es the following property

n − 1 ≤ m ≤ n(n − 1)

2

Theorem

Let G be a simple graph with n vertices. If a graph G has k components,then the number m of edges satis�es the inequality

n − k ≤ m ≤ 1

2(n − k) (n − k + 1)

Every simple graph with n vertices and at least (n−1)(n−2)2

edges is connected.

Lecture 3. Properties of graphs 32 / 35

Page 76: Lecture 3. Properties of graphs - Urząd Miasta Łodzimarmaj/GNT/Lectures/properties_of_graphs.pdf · Basic graph ropperties Operations on graphs Imprtanto graphs Subgraphs Connected

Basic graph properties

Operations on graphsImportant graphsSubgraphsConnected graphs

Lemma

Acyclic graph with n vertices has at most n − 1 edges.

Theorem

Let G be a graph with n vertices. Then any two conditions imply the third

1 G is connected

2 G is acyclic

3 G has exactly n − 1 edges

Lecture 3. Properties of graphs 33 / 35

Page 77: Lecture 3. Properties of graphs - Urząd Miasta Łodzimarmaj/GNT/Lectures/properties_of_graphs.pdf · Basic graph ropperties Operations on graphs Imprtanto graphs Subgraphs Connected

Basic graph properties

Operations on graphsImportant graphsSubgraphsConnected graphs

Lemma

Acyclic graph with n vertices has at most n − 1 edges.

Theorem

Let G be a graph with n vertices. Then any two conditions imply the third

1 G is connected

2 G is acyclic

3 G has exactly n − 1 edges

Lecture 3. Properties of graphs 33 / 35

Page 78: Lecture 3. Properties of graphs - Urząd Miasta Łodzimarmaj/GNT/Lectures/properties_of_graphs.pdf · Basic graph ropperties Operations on graphs Imprtanto graphs Subgraphs Connected

Basic graph properties

Operations on graphsImportant graphsSubgraphsConnected graphs

Testing of connectivity

Inputs: a graph G = (V ,E)

Connected(G)

1 for every v ∈ V2 do

3 visited [v ] = false

4 v - any vertex5 S ← v6 while there is a vertex in S such that visited [v ] = false7 do

8 N ← the set of all neighbours of v9 S ← S ∪ N

10 visited [v ] = true11 if S = V12 then the graph is connected13 else the graph is disconnected

Lecture 3. Properties of graphs 34 / 35

Page 79: Lecture 3. Properties of graphs - Urząd Miasta Łodzimarmaj/GNT/Lectures/properties_of_graphs.pdf · Basic graph ropperties Operations on graphs Imprtanto graphs Subgraphs Connected

Basic graph properties

Operations on graphsImportant graphsSubgraphsConnected graphs

Thank you for your attention!

Lecture 3. Properties of graphs 35 / 35