graph - cs.toronto.edustacho/public/combinatorics-2011-10-31-and-1โฆย ยท graph โข graph is a pair...
TRANSCRIPT
![Page 1: Graph - cs.toronto.edustacho/public/combinatorics-2011-10-31-and-1โฆย ยท Graph โข graph is a pair (๐,๐ธ) of two sets where โ๐= set of elements called vertices (singl. vertex)](https://reader036.vdocuments.mx/reader036/viewer/2022081522/5fc9b523ba17177e0c4bb824/html5/thumbnails/1.jpg)
Graph
โข graph is a pair (๐, ๐ธ) of two sets where
โ ๐ = set of elements called vertices (singl. vertex)
โ ๐ธ = set of pairs of vertices (elements of ๐) called edges
โข Example: ๐บ = (๐, ๐ธ) where
๐ = * 1, 2, 3, 4 + ๐ธ = * *1, 2+, *1, 3+, *2, 3+, *3, 4+ +
โข Notation: โ we write ๐บ = (๐, ๐ธ) for a graph with vertex set ๐ and edge set ๐ธ
โ ๐(๐บ) is the vertex set of ๐บ, and ๐ธ(๐บ) is the edge set of ๐บ
1
2
3 4
drawing of ๐บ
![Page 2: Graph - cs.toronto.edustacho/public/combinatorics-2011-10-31-and-1โฆย ยท Graph โข graph is a pair (๐,๐ธ) of two sets where โ๐= set of elements called vertices (singl. vertex)](https://reader036.vdocuments.mx/reader036/viewer/2022081522/5fc9b523ba17177e0c4bb824/html5/thumbnails/2.jpg)
1 2 3 4
1 1 1
2 1 1
3 1 1 1
4 1
1 2 3 4
1 1 1
2 1
3 1 1
4
1 2 3 4
1 1 3
2 1 2
3 3 2 4
4 4
1 2 3 4
1 1 1
2 1 1 1
3 1 1 1 1
4 0 1
Types of graphs
โข Undirected graph
๐ธ(๐บ) = set of unordered pairs
โข Pseudograph (allows loops)
loop = edge between vertex and itself
1
2
3 4
โข Directed graph
๐ธ(๐บ) = set of ordered pairs
โข Multigraph
๐ธ(๐บ) is a multiset
(IRREFLEXIVE) RELATION SYMMETRIC & IRREFLEXIVE
SYMMETRIC ?
1
2
3 4
1
2
3 4
1
2
3 4
๐ธ = *(1,2), (2,3), (1,3), (3,1), (3,4)+
๐ธ = **1,2+, *1,3+, *1,3+, *1,3+, 2,3 , 2,3 , *3,4+, *3,4+, *3,4+, *3,4++
๐ธ = **1,2+, *1,3+, *2,3+, *3,4++
๐ธ = **1,2+, *1,3+, *2,2+, *2,3+, *3,3+, *3,4++
![Page 3: Graph - cs.toronto.edustacho/public/combinatorics-2011-10-31-and-1โฆย ยท Graph โข graph is a pair (๐,๐ธ) of two sets where โ๐= set of elements called vertices (singl. vertex)](https://reader036.vdocuments.mx/reader036/viewer/2022081522/5fc9b523ba17177e0c4bb824/html5/thumbnails/3.jpg)
โข simple graph (undirected, no loops, no parallel edges)
for edge *๐ข, ๐ฃ+๐ธ(๐บ) we say:
โ ๐ข and ๐ฃ are adjacent
โ ๐ข and ๐ฃ are neighbours
โ ๐ข and ๐ฃ are endpoints of *๐ข, ๐ฃ+
โ we write ๐ข๐ฃ๐ธ ๐บ for simplicity
โข N(๐ฃ) = set of neighbours of ๐ฃ in G
โข deg (๐ฃ) = degree of v is the number of its neighbours, ie. |N(๐ฃ)|
1
2
3
More graph terminology
1
2
3 4 N(1) = *2,3+ N(2) = *1,3+ N(3) = *1,2,4+ N(4) = *3+
1 is adjacent to 2 and 3
deg (3) = 3 deg 4 = 1 deg (1) = deg (2) = 2
1
2
3 = โ
๐บ1 = (๐1, ๐ธ1) is isomorphic to ๐บ2 = (๐2, ๐ธ2) if there exists a bijective mapping ๐: ๐1 โ ๐2 such that ๐ข๐ฃ๐ธ(๐บ1) if and only if ๐ ๐ข ๐(๐ฃ)๐ธ(๐บ2)
โ ๐(1) = 2 ๐(2) = 3 ๐(3) = 1
1
2
3
1
2
3
![Page 4: Graph - cs.toronto.edustacho/public/combinatorics-2011-10-31-and-1โฆย ยท Graph โข graph is a pair (๐,๐ธ) of two sets where โ๐= set of elements called vertices (singl. vertex)](https://reader036.vdocuments.mx/reader036/viewer/2022081522/5fc9b523ba17177e0c4bb824/html5/thumbnails/4.jpg)
1
Isomorphism
2 3
4 5 6
4
5
6
1
2
3
4
6
5
1
3
2
(3,3,3,3,3,3) (3,3,3,3,3,3) (3,3,3,3,3,3)
(3,3,3,3,2,2,2,2) (3,3,3,3,2,2,2,2)
3 3 3
3 3 3
โ
if ๐ is an isomorphism
deg (๐ข) = deg (๐(๐ข))
โ โ
degree sequence
i.e., isomorphic graphs have same degree sequences only necessary not sufficient!!!
![Page 5: Graph - cs.toronto.edustacho/public/combinatorics-2011-10-31-and-1โฆย ยท Graph โข graph is a pair (๐,๐ธ) of two sets where โ๐= set of elements called vertices (singl. vertex)](https://reader036.vdocuments.mx/reader036/viewer/2022081522/5fc9b523ba17177e0c4bb824/html5/thumbnails/5.jpg)
Isomorphism How many pairwise non-isomorphic graphs on ๐ vertices are there?
the complement of ๐บ = (๐, ๐ธ) is the graph ๐บ = (๐, ๐ธ ) where
๐ธ = ๐ข, ๐ฃ *๐ข, ๐ฃ+๐ธ+
1
2
3
1
2
3
1
2
3
1
2
3
1
2
3
1
2
3
1
2
3
1
2
3
2
1
3
4
5
๐บ
2
1
3
4
5
๐บ
๐ธ(๐บ) = **1,2+, *2,3+, *3,4+, *4,5++
๐ธ(๐บ ) = **1,3+, *1,4+, *1,5+, *2,4+, *2,5+, *3,5++
all graphs (labeled)
non-isomorphic graphs (without labels)
![Page 6: Graph - cs.toronto.edustacho/public/combinatorics-2011-10-31-and-1โฆย ยท Graph โข graph is a pair (๐,๐ธ) of two sets where โ๐= set of elements called vertices (singl. vertex)](https://reader036.vdocuments.mx/reader036/viewer/2022081522/5fc9b523ba17177e0c4bb824/html5/thumbnails/6.jpg)
Isomorphism
How many pairwise non-isomorphic graphs on ๐ vertices are there?
โ self-complementary graph
![Page 7: Graph - cs.toronto.edustacho/public/combinatorics-2011-10-31-and-1โฆย ยท Graph โข graph is a pair (๐,๐ธ) of two sets where โ๐= set of elements called vertices (singl. vertex)](https://reader036.vdocuments.mx/reader036/viewer/2022081522/5fc9b523ba17177e0c4bb824/html5/thumbnails/7.jpg)
Isomorphism
โข Are there self complementary graphs on 5 vertices ?
โข ... 6 vertices ?
No, because in a self-complementary graph ๐บ = (๐, ๐ธ)
|๐ธ| = |๐ธ | and ๐ธ + ๐ธ =|๐|2
but 62= 15 is odd
โข ... 7 vertices ?
โข ... 8 vertices ?
2
1
3
4
5
2
1
3
4
5
4
1
5
8 7
6
2
3 1 โ 4, 2 โ 6, 3 โ 1, 4 โ 7 5 โ 2, 6 โ 8, 7 โ 3, 8 โ 5
No, since 72= 21
1 โ 1, 2 โ 4, 3 โ 2 4 โ 5, 5 โ 3
1 โ 2, 2 โ 5, 3 โ 3 4 โ 1, 5 โ 4
Yes, there are 10
Yes, 2
![Page 8: Graph - cs.toronto.edustacho/public/combinatorics-2011-10-31-and-1โฆย ยท Graph โข graph is a pair (๐,๐ธ) of two sets where โ๐= set of elements called vertices (singl. vertex)](https://reader036.vdocuments.mx/reader036/viewer/2022081522/5fc9b523ba17177e0c4bb824/html5/thumbnails/8.jpg)
Handshake lemma
Lemma. Let ๐บ = (๐, ๐ธ) be a graph with ๐ edges.
deg ๐ฃ = 2๐
๐ฃโ๐
Proof. Every edge *๐ข, ๐ฃ+ connects 2 vertices and contributes to exactly 1 to deg (๐ข) and exactly 1 to deg (๐ฃ). In other words, in deg (๐ฃ)๐ฃโ๐ every edge is counted twice.
How many edges has a graph with degree sequence:
- (3,3,3,3,3,3) ?
- (3,3,3,3,3) ?
- (0,1,2,3) ?
Corollary. In any graph, the number of vertices of odd degree is even.
Corollary 2. Every graph with at least 2 vertices has 2 vertices of the same degree.
4
5
6
1
2
3
1
2
3 4
deg (1) = 2 deg (2) = 2 deg (3) = 3 deg 4 = 1
๐ = 4
![Page 9: Graph - cs.toronto.edustacho/public/combinatorics-2011-10-31-and-1โฆย ยท Graph โข graph is a pair (๐,๐ธ) of two sets where โ๐= set of elements called vertices (singl. vertex)](https://reader036.vdocuments.mx/reader036/viewer/2022081522/5fc9b523ba17177e0c4bb824/html5/thumbnails/9.jpg)
Handshake lemma
Is it possible for a self-complementary graph with 100 vertices to have exactly one vertex of degree 50 ?
Answer. No N(๐ข)
50
๐(๐บ)\N(๐ข)
49
N๐บ (๐ข)
49
๐ isomorphism between ๐บ and ๐บ
๐ฃ is a unique vertex of degree 49 in ๐บ
the degree seq. of ๐บ and ๐บ (โฆ ,โฆ ,โฆ , 50,49, โฆ ,โฆ ,โฆ )
๐ฃ
โ๐ฃ, ๐(๐ฃ) = ๐ข
we conclude ๐(๐ข) = ๐ฃ
๐ข
๐บ
๐ข
๐บ
definition of isomorphism definition of complement
๐ข๐ฃ โ ๐ธ(๐บ) ๐(๐ข)๐(๐ฃ) โ ๐ธ(๐บ ) but ๐(๐ข)๐(๐ฃ) = ๐ฃ๐ข โ ๐ธ(๐บ ) ๐ข๐ฃ โ ๐ธ(๐บ)
![Page 10: Graph - cs.toronto.edustacho/public/combinatorics-2011-10-31-and-1โฆย ยท Graph โข graph is a pair (๐,๐ธ) of two sets where โ๐= set of elements called vertices (singl. vertex)](https://reader036.vdocuments.mx/reader036/viewer/2022081522/5fc9b523ba17177e0c4bb824/html5/thumbnails/10.jpg)
Subgraphs
Let ๐บ = (๐, ๐ธ) be a graph
โข a subgraph of ๐บ is a graph ๐บโฒ = (๐โฒ, ๐ธโฒ) where ๐โฒ ๐ and ๐ธโฒ ๐ธ
โข an induced subgraph (a subgraph induced on ๐ด ๐) is a graph
๐บ,๐ด- = (๐ด, ๐ธ๐ด) where ๐ธ๐ด = ๐ธ โฉ ๐ด ร ๐ด
1
2
3 4
1
2
3 4
2
3 4
subgraph induced subgraph on ๐ด = *2,3,4+
![Page 11: Graph - cs.toronto.edustacho/public/combinatorics-2011-10-31-and-1โฆย ยท Graph โข graph is a pair (๐,๐ธ) of two sets where โ๐= set of elements called vertices (singl. vertex)](https://reader036.vdocuments.mx/reader036/viewer/2022081522/5fc9b523ba17177e0c4bb824/html5/thumbnails/11.jpg)
Walks, Paths and Cycles
Let ๐บ = (๐, ๐ธ) be a graph
โข a walk (of length ๐) in ๐บ is a sequence
๐ฃ1, ๐1, ๐ฃ2, ๐2,โฆ , ๐ฃ๐โ1, ๐๐โ1, ๐ฃ๐
where ๐ฃ1, โฆ , ๐ฃ๐ โ ๐ and ๐๐ = *๐ฃ๐ , ๐ฃ๐+1+ โ ๐ธ for all ๐ โ *1. . ๐ โ 1+
โข a path in ๐บ is a walk where ๐ฃ1, โฆ , ๐ฃ๐ are distinct (does not go through the same vertex twice)
โข a closed walk in ๐บ is a walk with ๐ฃ1 = ๐ฃ๐ (starts and ends in the same vertex)
โข a cycle in ๐บ is a closed walk where ๐ 3 and ๐ฃ1, โฆ , ๐ฃ๐โ1 are distinct
1
2
3 4
1,{1,2},2,{2,1},1,{1,3},3 is a walk (not path)
1,{1,2},2,{2,3},3,{3,1},1 is a cycle
![Page 12: Graph - cs.toronto.edustacho/public/combinatorics-2011-10-31-and-1โฆย ยท Graph โข graph is a pair (๐,๐ธ) of two sets where โ๐= set of elements called vertices (singl. vertex)](https://reader036.vdocuments.mx/reader036/viewer/2022081522/5fc9b523ba17177e0c4bb824/html5/thumbnails/12.jpg)
Special graphs
โข ๐๐ path on ๐ vertices
โข ๐ถ๐ cycle on ๐ vertices
โข ๐พ๐ complete graph on ๐ vertices
โข ๐ต๐ hypercube of dimension ๐
๐ ๐ต๐ = 0,1๐
(๐1, โฆ , ๐๐) adjacent to ๐1, โฆ , ๐๐ if ๐๐โs and ๐๐โs differ in exactly once
(0,1,0,0) adjacent to (0,1,0,1) not adjacent to (0,1,1,1)
๐๐ โ ๐๐ = 1
๐
๐=1
2
1
3
4
5
2 1 3 4 5 ๐5
๐ถ5
2
1
3
4
5
๐พ5
๐ต3
000
100 010
001
110 111
011 101
![Page 13: Graph - cs.toronto.edustacho/public/combinatorics-2011-10-31-and-1โฆย ยท Graph โข graph is a pair (๐,๐ธ) of two sets where โ๐= set of elements called vertices (singl. vertex)](https://reader036.vdocuments.mx/reader036/viewer/2022081522/5fc9b523ba17177e0c4bb824/html5/thumbnails/13.jpg)
Connectivity
โข a graph ๐บ is connected if for any two vertices ๐ข, ๐ฃ of ๐บ there exists a path (walk) in ๐บ starting in ๐ข and ending in ๐ฃ
โข a connected component of ๐บ is a maximal connected subgraph of ๐บ
1
2
3 4
1
2
3 4
connected not connected = disconnected
no path from 1 to 4
connected components 1,{1,3},3,{3,4},4 path from 1 to 4 1
3 4
![Page 14: Graph - cs.toronto.edustacho/public/combinatorics-2011-10-31-and-1โฆย ยท Graph โข graph is a pair (๐,๐ธ) of two sets where โ๐= set of elements called vertices (singl. vertex)](https://reader036.vdocuments.mx/reader036/viewer/2022081522/5fc9b523ba17177e0c4bb824/html5/thumbnails/14.jpg)
Connectivity
โข Show that the complement of a disconnected graph is connected !
โข What is the maximum number of edges in a disconnected graph ?
โข What is the minimum number of edges in a connected graph ?
๐ข ๐ฃ
๐ข
๐ฃ
๐บ ๐บ
๐2
๐ โ ๐2
max๐
๐2+๐ โ ๐2=๐ โ 12
maximum when ๐ = 1
2 1 3 4 5
path ๐๐ on ๐ vertices has ๐ โ 1 edges
cannot be less, why ? keep removing edges so long as you keep the graph connected a (spanning) tree which has ๐ โ 1 edges
๐ข
๐ค ๐บ
๐ค
![Page 15: Graph - cs.toronto.edustacho/public/combinatorics-2011-10-31-and-1โฆย ยท Graph โข graph is a pair (๐,๐ธ) of two sets where โ๐= set of elements called vertices (singl. vertex)](https://reader036.vdocuments.mx/reader036/viewer/2022081522/5fc9b523ba17177e0c4bb824/html5/thumbnails/15.jpg)
Distance, Diameter and Radius
โข length of a walk (path) is the number of edges
โข distance ๐(๐ข, ๐ฃ) from a vertex ๐ข to a vertex ๐ฃ is the length of a shortest path in ๐บ between ๐ข and ๐ฃ
โข if no path exists define ๐ ๐ข, ๐ฃ = โ
recall walk (path) is a sequence of vertices and edges ๐ฃ1, ๐1, ๐ฃ2, ๐2,โฆ , ๐ฃ๐โ1, ๐๐โ1, ๐ฃ๐
if edges are clear from context we write ๐ฃ1, ๐ฃ2, โฆ , ๐ฃ๐
1
2
3 4
๐(1,2) = 1 ๐(1,4) = 2
๐(๐ข, ๐ฃ) 1 2 3 4
1 0 1 1 2
2 1 0 1 2
3 1 1 0 1
4 2 2 1 0
matrix of distances in ๐บ distance matrix
![Page 16: Graph - cs.toronto.edustacho/public/combinatorics-2011-10-31-and-1โฆย ยท Graph โข graph is a pair (๐,๐ธ) of two sets where โ๐= set of elements called vertices (singl. vertex)](https://reader036.vdocuments.mx/reader036/viewer/2022081522/5fc9b523ba17177e0c4bb824/html5/thumbnails/16.jpg)
Distance, Diameter and Radius
โข eccentricity of a vertex ๐ข is the largest distance between ๐ข and any other vertex of ๐บ; we write ๐๐๐ ๐ข = max
๐ฃ๐(๐ข, ๐ฃ)
โข diameter of ๐บ is the largest distance between two vertices ๐๐๐๐ ๐บ = max
๐ข,๐ฃ๐ ๐ข, ๐ฃ = max
๐ฃ๐๐๐(๐ฃ)
โข radius of ๐บ is the minimum eccentricity of a vertex of ๐บ ๐๐๐ ๐บ = min
๐ฃ๐๐๐(๐ฃ)
Find radius and diameter of graphs ๐๐, ๐ถ๐, ๐พ๐, ๐ต๐ Prove that ๐๐๐(๐บ) โค ๐๐๐๐(๐บ) โค 2 โ ๐๐๐(๐บ)
1
2
3 4
๐๐๐(1) = 2 ๐๐๐(2) = 2 ๐๐๐(3) = 1 ๐๐๐(4) = 2
๐๐๐(๐บ) = 1 (as witnessed by 3
called a centre)
๐๐๐๐(๐บ) = 2 (as witnessed by 1,4
called a diametrical pair)
![Page 17: Graph - cs.toronto.edustacho/public/combinatorics-2011-10-31-and-1โฆย ยท Graph โข graph is a pair (๐,๐ธ) of two sets where โ๐= set of elements called vertices (singl. vertex)](https://reader036.vdocuments.mx/reader036/viewer/2022081522/5fc9b523ba17177e0c4bb824/html5/thumbnails/17.jpg)
Independent set and Clique
โข clique = set of pairwise adjacent vertices
โข independent set = set of pairwise non-adjacent vertices
โข clique number ๐(๐บ) = size of largest clique in ๐บ
โข independence number ๐ผ(๐บ) = size of largest indepen-dent set in ๐บ
Find ๐ผ(๐๐), ๐ผ(๐ถ๐), ๐ผ ๐พ๐ , ๐ผ(๐ต๐) ๐(๐๐), ๐(๐ถ๐), ๐(๐พ๐), ๐(๐ต๐)
1
2
3 4 ๐ผ ๐บ = 2 ๐ ๐บ = 3
*1,2,3+ is a clique
*1,4+ is an independent set
2 1 3 4 5
๐5
![Page 18: Graph - cs.toronto.edustacho/public/combinatorics-2011-10-31-and-1โฆย ยท Graph โข graph is a pair (๐,๐ธ) of two sets where โ๐= set of elements called vertices (singl. vertex)](https://reader036.vdocuments.mx/reader036/viewer/2022081522/5fc9b523ba17177e0c4bb824/html5/thumbnails/18.jpg)
Bipartite graph
โข a graph is bipartite if its vertex set ๐ can be partitioned into two independent sets ๐1, ๐2; i.e., ๐1 โช ๐2 = ๐
1
2
3 4
1
2
3 4
1 2
3 4
bipartite not bipartite
๐2 ๐1 1
2
3 4
1 โ ๐1
3 โ ๐2 but now ๐2 is not an independent set because *2,3+ โ ๐ธ(๐บ)
2 โ ๐2
![Page 19: Graph - cs.toronto.edustacho/public/combinatorics-2011-10-31-and-1โฆย ยท Graph โข graph is a pair (๐,๐ธ) of two sets where โ๐= set of elements called vertices (singl. vertex)](https://reader036.vdocuments.mx/reader036/viewer/2022081522/5fc9b523ba17177e0c4bb824/html5/thumbnails/19.jpg)
Bipartite graph
โข a graph is bipartite if its vertex set ๐ can be partitioned into two independent sets ๐1, ๐2; i.e., ๐1 โช ๐2 = ๐
๐พ1,2
๐พ3,3
๐พ4,4 ๐พ๐,๐ = complete bipartite graph
๐ ๐พ๐,๐ = *๐1โฆ๐๐ , ๐1โฆ๐๐+ ๐ธ ๐พ๐,๐ = ๐๐๐๐ ๐ โ 1. . ๐ , ๐ โ 1. .๐ +
Which of these graphs are bipartite:
๐๐, ๐ถ๐, ๐พ๐, ๐ต๐ ? ๐พ2,2
![Page 20: Graph - cs.toronto.edustacho/public/combinatorics-2011-10-31-and-1โฆย ยท Graph โข graph is a pair (๐,๐ธ) of two sets where โ๐= set of elements called vertices (singl. vertex)](https://reader036.vdocuments.mx/reader036/viewer/2022081522/5fc9b523ba17177e0c4bb824/html5/thumbnails/20.jpg)
Bipartite graph Theorem. A graph is bipartite it has no cycle of odd length.
Proof. Let ๐บ = (๐, ๐ธ). We may assume that ๐บ is connected.
โโ any cycle in a bipartite graph is of even length
โโ Assume G has no odd-length cycle. Fix a vertex ๐ข and put it in ๐1. Then repeat as long as possible:
- take any vertex in ๐1 and put its neighbours in ๐2, or
- take any vertex in ๐2 and put its neighbours in ๐1.
Afterwards ๐1 โช ๐2 = ๐ because ๐บ is connected.
If one of ๐1 or ๐2 is not an independent set, then we find in ๐บ an odd-length closed walk cycle, impossible. So, ๐บ is bipartite (as certified by the partition ๐1 โช ๐2 = ๐)
2
1
3 4
5
๐
2
1
3
2
1
3
4
5
2
1
3 4
5 6
2
3
4
1
๐ข
?
๐ odd