graphs h. turgut uyar ay¸seg¨ul gencata yayımlı emre...
TRANSCRIPT
![Page 1: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/1.jpg)
Discrete MathematicsGraphs
H. Turgut Uyar Aysegul Gencata Yayımlı Emre Harmancı
2001-2016
![Page 2: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/2.jpg)
License
c© 2001-2016 T. Uyar, A. Yayımlı, E. Harmancı
You are free to:
Share – copy and redistribute the material in any medium or format
Adapt – remix, transform, and build upon the material
Under the following terms:
Attribution – You must give appropriate credit, provide a link to the license,and indicate if changes were made.
NonCommercial – You may not use the material for commercial purposes.
ShareAlike – If you remix, transform, or build upon the material, you mustdistribute your contributions under the same license as the original.
For more information:https://creativecommons.org/licenses/by-nc-sa/4.0/
Read the full license:
https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode
![Page 3: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/3.jpg)
Topics
1 GraphsIntroductionWalksTraversable GraphsPlanar Graphs
2 Graph ProblemsConnectivityGraph ColoringShortest PathTSPSearching Graphs
![Page 4: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/4.jpg)
Topics
1 GraphsIntroductionWalksTraversable GraphsPlanar Graphs
2 Graph ProblemsConnectivityGraph ColoringShortest PathTSPSearching Graphs
![Page 5: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/5.jpg)
Graphs
Definition
graph: G = (V ,E )
V : node (or vertex) set
E ⊆ V × V : edge set
e = (v1, v2) ∈ E :
v1 and v2 are endnodes of e
e is incident to v1 and v2
v1 and v2 are adjacent
![Page 6: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/6.jpg)
Graphs
Definition
graph: G = (V ,E )
V : node (or vertex) set
E ⊆ V × V : edge set
e = (v1, v2) ∈ E :
v1 and v2 are endnodes of e
e is incident to v1 and v2
v1 and v2 are adjacent
![Page 7: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/7.jpg)
Graph Example
V = {a, b, c, d , e, f }E = {(a, b), (a, c),
(a, d), (a, e),(a, f ), (b, c),(d , e), (e, f )}
![Page 8: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/8.jpg)
Directed Graphs
Definition
directed graph (digraph): D = (V ,A)
V : node set
A ⊆ V × V : arc set
a = (v1, v2) ∈ A:
v1: origin node of a
v2: terminating node of a
![Page 9: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/9.jpg)
Directed Graph Example
![Page 10: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/10.jpg)
Weighted Graphs
weighted graph: labels assigned to edges
weight
length, distance
cost, delay
probability
. . .
![Page 11: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/11.jpg)
Multigraphs
parallel edges: edges between same node pair
loop: edge starting and ending in same node
plain graph: no loops, no parallel edges
multigraph: a graph which is not plain
![Page 12: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/12.jpg)
Multigraph Example
parallel edges: (a, b)
loop: (e, e)
![Page 13: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/13.jpg)
Subgraph
Definition
G ′ = (V ′,E ′) is a subgraph of G = (V ,E ):V ′ ⊆ V ∧ E ′ ⊆ E ∧ ∀(v1, v2) ∈ E ′ [v1, v2 ∈ V ′]
![Page 14: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/14.jpg)
Incidence Matrix
rows: nodes, columns: edges
1 if edge incident on node, 0 otherwise
example
e1 e2 e3 e4 e5 e6 e7 e8
v1 1 1 1 0 1 0 0 0v2 1 0 0 1 0 0 0 0v3 0 0 1 1 0 0 1 1v4 0 0 0 0 1 1 0 1v5 0 1 0 0 0 1 1 0
![Page 15: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/15.jpg)
Adjacency Matrix
rows: nodes, columns: nodes
1 if nodes are adjacent, 0 otherwise
example
v1 v2 v3 v4 v5
v1 0 1 1 1 1v2 1 0 1 0 0v3 1 1 0 1 1v4 1 0 1 0 1v5 1 0 1 1 0
![Page 16: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/16.jpg)
Adjacency Matrix
multigraph: number of edges between nodes
example
a b c d
a 0 0 0 1b 2 1 1 0c 0 0 0 0d 0 1 1 0
![Page 17: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/17.jpg)
Adjacency Matrix
weighted graph: weight of edge
![Page 18: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/18.jpg)
Degree
degree of node: number of incident edges
Theorem
di : degree of vi
|E | =∑
i di
2
![Page 19: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/19.jpg)
Degree
degree of node: number of incident edges
Theorem
di : degree of vi
|E | =∑
i di
2
![Page 20: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/20.jpg)
Degree Example
da = 5db = 2dc = 2dd = 2de = 3df = 2
16|E | = 8
![Page 21: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/21.jpg)
Multigraph Degree Example
da = 6db = 3dc = 2dd = 2de = 5df = 2
20|E | = 10
![Page 22: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/22.jpg)
Degree in Directed Graphs
in-degree: dvi
out-degree: dvo
node with in-degree 0: source
node with out-degree 0: sink∑v∈V dv
i =∑
v∈V dvo = |A|
![Page 23: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/23.jpg)
Degree in Directed Graphs
in-degree: dvi
out-degree: dvo
node with in-degree 0: source
node with out-degree 0: sink∑v∈V dv
i =∑
v∈V dvo = |A|
![Page 24: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/24.jpg)
Degree in Directed Graphs
in-degree: dvi
out-degree: dvo
node with in-degree 0: source
node with out-degree 0: sink∑v∈V dv
i =∑
v∈V dvo = |A|
![Page 25: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/25.jpg)
Degree
Theorem
In an undirected graph, there is an even number of nodeswhich have an odd degree.
Proof.
ti : number of nodes of degree i2|E | =
∑i di = 1t1 + 2t2 + 3t3 + 4t4 + 5t5 + . . .
2|E | − 2t2 − 4t4 − · · · = t1 + t3 + t5 + · · ·+ 2t3 + 4t5 + . . .2|E | − 2t2 − 4t4 − · · · − 2t3 − 4t5 − · · · = t1 + t3 + t5 + . . .
left-hand side even ⇒ right-hand side even
![Page 26: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/26.jpg)
Degree
Theorem
In an undirected graph, there is an even number of nodeswhich have an odd degree.
Proof.
ti : number of nodes of degree i2|E | =
∑i di = 1t1 + 2t2 + 3t3 + 4t4 + 5t5 + . . .
2|E | − 2t2 − 4t4 − · · · = t1 + t3 + t5 + · · ·+ 2t3 + 4t5 + . . .2|E | − 2t2 − 4t4 − · · · − 2t3 − 4t5 − · · · = t1 + t3 + t5 + . . .
left-hand side even ⇒ right-hand side even
![Page 27: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/27.jpg)
Degree
Theorem
In an undirected graph, there is an even number of nodeswhich have an odd degree.
Proof.
ti : number of nodes of degree i2|E | =
∑i di = 1t1 + 2t2 + 3t3 + 4t4 + 5t5 + . . .
2|E | − 2t2 − 4t4 − · · · = t1 + t3 + t5 + · · ·+ 2t3 + 4t5 + . . .2|E | − 2t2 − 4t4 − · · · − 2t3 − 4t5 − · · · = t1 + t3 + t5 + . . .
left-hand side even ⇒ right-hand side even
![Page 28: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/28.jpg)
Degree
Theorem
In an undirected graph, there is an even number of nodeswhich have an odd degree.
Proof.
ti : number of nodes of degree i2|E | =
∑i di = 1t1 + 2t2 + 3t3 + 4t4 + 5t5 + . . .
2|E | − 2t2 − 4t4 − · · · = t1 + t3 + t5 + · · ·+ 2t3 + 4t5 + . . .2|E | − 2t2 − 4t4 − · · · − 2t3 − 4t5 − · · · = t1 + t3 + t5 + . . .
left-hand side even ⇒ right-hand side even
![Page 29: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/29.jpg)
Degree
Theorem
In an undirected graph, there is an even number of nodeswhich have an odd degree.
Proof.
ti : number of nodes of degree i2|E | =
∑i di = 1t1 + 2t2 + 3t3 + 4t4 + 5t5 + . . .
2|E | − 2t2 − 4t4 − · · · = t1 + t3 + t5 + · · ·+ 2t3 + 4t5 + . . .2|E | − 2t2 − 4t4 − · · · − 2t3 − 4t5 − · · · = t1 + t3 + t5 + . . .
left-hand side even ⇒ right-hand side even
![Page 30: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/30.jpg)
Degree
Theorem
In an undirected graph, there is an even number of nodeswhich have an odd degree.
Proof.
ti : number of nodes of degree i2|E | =
∑i di = 1t1 + 2t2 + 3t3 + 4t4 + 5t5 + . . .
2|E | − 2t2 − 4t4 − · · · = t1 + t3 + t5 + · · ·+ 2t3 + 4t5 + . . .2|E | − 2t2 − 4t4 − · · · − 2t3 − 4t5 − · · · = t1 + t3 + t5 + . . .
left-hand side even ⇒ right-hand side even
![Page 31: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/31.jpg)
Isomorphism
Definition
G = (V ,E ) and G ? = (V ?,E ?) are isomorphic:∃f : V → V ? [(u, v) ∈ E ⇒ (f (u), f (v)) ∈ E ?] ∧ f is bijective
G and G ? can be drawn the same way
![Page 32: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/32.jpg)
Isomorphism
Definition
G = (V ,E ) and G ? = (V ?,E ?) are isomorphic:∃f : V → V ? [(u, v) ∈ E ⇒ (f (u), f (v)) ∈ E ?] ∧ f is bijective
G and G ? can be drawn the same way
![Page 33: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/33.jpg)
Isomorphism Example
f = (a 7→ d , b 7→ e, c 7→ b, d 7→ c, e 7→ a)
![Page 34: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/34.jpg)
Isomorphism Example
f = (a 7→ d , b 7→ e, c 7→ b, d 7→ c, e 7→ a)
![Page 35: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/35.jpg)
Petersen Graph
f = (a 7→ q, b 7→ v , c 7→ u, d 7→ y , e 7→ r ,f 7→ w , g 7→ x , h 7→ t, i 7→ z , j 7→ s)
![Page 36: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/36.jpg)
Homeomorphism
Definition
G = (V ,E ) and G ? = (V ?,E ?) are homeomorphic:
G and G ? isomorphic, except that
some edges in E ? are divided with additional nodes
![Page 37: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/37.jpg)
Homeomorphism Example
![Page 38: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/38.jpg)
Regular Graphs
regular graph: all nodes have the same degree
n-regular: all nodes have degree n
examples
![Page 39: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/39.jpg)
Completely Connected Graphs
G = (V ,E ) is completely connected:∀v1, v2 ∈ V (v1, v2) ∈ E
every pair of nodes are adjacent
Kn: completely connected graph with n nodes
![Page 40: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/40.jpg)
Completely Connected Graph Examples
K4 K5
![Page 41: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/41.jpg)
Bipartite Graphs
G = (V ,E ) is bipartite: V1 ∪ V2 = V , V1 ∩ V2 = ∅∀(v1, v2) ∈ E [v1 ∈ V1 ∧ v2 ∈ V2]
example
complete bipartite: ∀v1 ∈ V1 ∀v2 ∈ V2 (v1, v2) ∈ E
Km,n: |V1| = m, |V2| = n
![Page 42: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/42.jpg)
Complete Bipartite Graph Examples
K2,3 K3,3
![Page 43: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/43.jpg)
Topics
1 GraphsIntroductionWalksTraversable GraphsPlanar Graphs
2 Graph ProblemsConnectivityGraph ColoringShortest PathTSPSearching Graphs
![Page 44: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/44.jpg)
Walk
walk: sequence of nodes and edgesfrom a starting node (v0) to an ending node (vn)
v0e1−→ v1
e2−→ v2e3−→ v3 −→ · · · −→ vn−1
en−→ vn
where ei = (vi−1, vi )
no need to write the edges if not weighted
length: number of edges
v0 = vn: closed
![Page 45: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/45.jpg)
Walk
walk: sequence of nodes and edgesfrom a starting node (v0) to an ending node (vn)
v0e1−→ v1
e2−→ v2e3−→ v3 −→ · · · −→ vn−1
en−→ vn
where ei = (vi−1, vi )
no need to write the edges if not weighted
length: number of edges
v0 = vn: closed
![Page 46: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/46.jpg)
Walk Example
c(c,b)−−−→ b
(b,a)−−−→ a(a,d)−−−→ d
(d ,e)−−−→ e(e,f )−−−→ f
(f ,a)−−−→ a(a,b)−−−→ b
c → b → a→ d → e→ f → a→ b
length: 7
![Page 47: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/47.jpg)
Trail
trail: edges not repeated
circuit: closed trail
spanning trail: covers all edges
![Page 48: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/48.jpg)
Trail Example
c(c,b)−−−→ b
(b,a)−−−→ a(a,e)−−−→ e
(e,d)−−−→ d(d ,a)−−−→ a
(a,f )−−−→ f
c → a→ e → d → a→ f
![Page 49: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/49.jpg)
Path
path: nodes not repeated
cycle: closed path
spanning path: visits all nodes
![Page 50: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/50.jpg)
Path Example
c(c,b)−−−→ b
(b,a)−−−→ a(a,d)−−−→ d
(d ,e)−−−→ e(e,f )−−−→ f
c → b → a→ d → e → f
![Page 51: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/51.jpg)
Connected Graphs
connected: a path between every pair of nodes
a disconnected graph can be dividedinto connected components
![Page 52: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/52.jpg)
Connected Components Example
disconnected:no path between a and c
connected components:a, d , eb, cf
![Page 53: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/53.jpg)
Distance
distance between vi and vj :length of shortest path between vi and vj
diameter of graph: largest distance in graph
![Page 54: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/54.jpg)
Distance Example
distance between a and e: 2
diameter: 3
![Page 55: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/55.jpg)
Cut-Points
G − v : delete v and all its incident edges from G
v is a cut-point for G :G is connected but G − v is not
![Page 56: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/56.jpg)
Cut-Point Example
G G − d
![Page 57: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/57.jpg)
Directed Walks
ignoring directions on arcs: semi-walk, semi-trail, semi-path
if between every pair of nodes there is:
a semi-path: weakly connected
a path from one to the other: unilaterally connected
a path: strongly connected
![Page 58: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/58.jpg)
Directed Graph Examples
weakly unilaterally strongly
![Page 59: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/59.jpg)
Topics
1 GraphsIntroductionWalksTraversable GraphsPlanar Graphs
2 Graph ProblemsConnectivityGraph ColoringShortest PathTSPSearching Graphs
![Page 60: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/60.jpg)
Bridges of Konigsberg
cross each bridge exactly onceand return to the starting point
![Page 61: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/61.jpg)
Graphs
![Page 62: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/62.jpg)
Traversable Graphs
G is traversable: G contains a spanning trail
a node with an odd degree must be either the starting nodeor the ending node of the trail
all nodes except the starting node and the ending nodemust have even degrees
![Page 63: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/63.jpg)
Bridges of Konigsberg
all nodes have odd degrees: not traversable
![Page 64: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/64.jpg)
Traversable Graph Example
a, b, c: even
d , e: odd
start from d , end at e:d → b → a→ c → e→ d → c → b → e
![Page 65: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/65.jpg)
Euler Graphs
Euler graph: contains closed spanning trail
G is an Euler graph ⇔ all nodes in G have even degrees
![Page 66: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/66.jpg)
Euler Graph Examples
Euler not Euler
![Page 67: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/67.jpg)
Hamilton Graphs
Hamilton graph: contains a closed spanning path
![Page 68: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/68.jpg)
Hamilton Graph Examples
Hamilton not Hamilton
![Page 69: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/69.jpg)
Topics
1 GraphsIntroductionWalksTraversable GraphsPlanar Graphs
2 Graph ProblemsConnectivityGraph ColoringShortest PathTSPSearching Graphs
![Page 70: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/70.jpg)
Planar Graphs
Definition
G is planar:G can be drawn on a plane without intersecting its edges
a map of G : a planar drawing of G
![Page 71: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/71.jpg)
Planar Graph Example
![Page 72: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/72.jpg)
Regions
map divides plane into regions
degree of region: length of closed trail that surrounds region
Theorem
dri : degree of region ri
|E | =∑
i dri
2
![Page 73: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/73.jpg)
Regions
map divides plane into regions
degree of region: length of closed trail that surrounds region
Theorem
dri : degree of region ri
|E | =∑
i dri
2
![Page 74: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/74.jpg)
Region Example
dr1 = 3dr2 = 3dr3 = 5dr4 = 4dr5 = 3
= 18|E | = 9
![Page 75: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/75.jpg)
Euler’s Formula
Theorem (Euler’s Formula)
G = (V ,E ): planar, connected graphR: set of regions in a map of G
|V | − |E |+ |R| = 2
![Page 76: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/76.jpg)
Euler’s Formula Example
|V | = 6, |E | = 9, |R| = 5
![Page 77: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/77.jpg)
Planar Graph Theorems
Theorem
G = (V ,E ): connected, planar graph where |V | ≥ 3|E | ≤ 3|V | − 6
Proof.
sum of region degrees: 2|E |degree of a region ≥ 3⇒ 2|E | ≥ 3|R| ⇒ |R| ≤ 2
3 |E ||V | − |E |+ |R| = 2⇒ |V | − |E |+ 2
3 |E | ≥ 2 ⇒ |V | − 13 |E | ≥ 2
⇒ 3|V | − |E | ≥ 6 ⇒ |E | ≤ 3|V | − 6
![Page 78: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/78.jpg)
Planar Graph Theorems
Theorem
G = (V ,E ): connected, planar graph where |V | ≥ 3|E | ≤ 3|V | − 6
Proof.
sum of region degrees: 2|E |degree of a region ≥ 3⇒ 2|E | ≥ 3|R| ⇒ |R| ≤ 2
3 |E ||V | − |E |+ |R| = 2⇒ |V | − |E |+ 2
3 |E | ≥ 2 ⇒ |V | − 13 |E | ≥ 2
⇒ 3|V | − |E | ≥ 6 ⇒ |E | ≤ 3|V | − 6
![Page 79: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/79.jpg)
Planar Graph Theorems
Theorem
G = (V ,E ): connected, planar graph where |V | ≥ 3|E | ≤ 3|V | − 6
Proof.
sum of region degrees: 2|E |degree of a region ≥ 3⇒ 2|E | ≥ 3|R| ⇒ |R| ≤ 2
3 |E ||V | − |E |+ |R| = 2⇒ |V | − |E |+ 2
3 |E | ≥ 2 ⇒ |V | − 13 |E | ≥ 2
⇒ 3|V | − |E | ≥ 6 ⇒ |E | ≤ 3|V | − 6
![Page 80: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/80.jpg)
Planar Graph Theorems
Theorem
G = (V ,E ): connected, planar graph where |V | ≥ 3|E | ≤ 3|V | − 6
Proof.
sum of region degrees: 2|E |degree of a region ≥ 3⇒ 2|E | ≥ 3|R| ⇒ |R| ≤ 2
3 |E ||V | − |E |+ |R| = 2⇒ |V | − |E |+ 2
3 |E | ≥ 2 ⇒ |V | − 13 |E | ≥ 2
⇒ 3|V | − |E | ≥ 6 ⇒ |E | ≤ 3|V | − 6
![Page 81: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/81.jpg)
Planar Graph Theorems
Theorem
G = (V ,E ): connected, planar graph where |V | ≥ 3|E | ≤ 3|V | − 6
Proof.
sum of region degrees: 2|E |degree of a region ≥ 3⇒ 2|E | ≥ 3|R| ⇒ |R| ≤ 2
3 |E ||V | − |E |+ |R| = 2⇒ |V | − |E |+ 2
3 |E | ≥ 2 ⇒ |V | − 13 |E | ≥ 2
⇒ 3|V | − |E | ≥ 6 ⇒ |E | ≤ 3|V | − 6
![Page 82: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/82.jpg)
Planar Graph Theorems
Theorem
G = (V ,E ): connected, planar graph where |V | ≥ 3|E | ≤ 3|V | − 6
Proof.
sum of region degrees: 2|E |degree of a region ≥ 3⇒ 2|E | ≥ 3|R| ⇒ |R| ≤ 2
3 |E ||V | − |E |+ |R| = 2⇒ |V | − |E |+ 2
3 |E | ≥ 2 ⇒ |V | − 13 |E | ≥ 2
⇒ 3|V | − |E | ≥ 6 ⇒ |E | ≤ 3|V | − 6
![Page 83: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/83.jpg)
Planar Graph Theorems
Theorem
G = (V ,E ): connected, planar graph where |V | ≥ 3|E | ≤ 3|V | − 6
Proof.
sum of region degrees: 2|E |degree of a region ≥ 3⇒ 2|E | ≥ 3|R| ⇒ |R| ≤ 2
3 |E ||V | − |E |+ |R| = 2⇒ |V | − |E |+ 2
3 |E | ≥ 2 ⇒ |V | − 13 |E | ≥ 2
⇒ 3|V | − |E | ≥ 6 ⇒ |E | ≤ 3|V | − 6
![Page 84: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/84.jpg)
Planar Graph Theorems
Theorem
G = (V ,E ): connected, planar graph where |V | ≥ 3|E | ≤ 3|V | − 6
Proof.
sum of region degrees: 2|E |degree of a region ≥ 3⇒ 2|E | ≥ 3|R| ⇒ |R| ≤ 2
3 |E ||V | − |E |+ |R| = 2⇒ |V | − |E |+ 2
3 |E | ≥ 2 ⇒ |V | − 13 |E | ≥ 2
⇒ 3|V | − |E | ≥ 6 ⇒ |E | ≤ 3|V | − 6
![Page 85: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/85.jpg)
Planar Graph Theorems
Theorem
G = (V ,E ): connected, planar graph where |V | ≥ 3|E | ≤ 3|V | − 6
Proof.
sum of region degrees: 2|E |degree of a region ≥ 3⇒ 2|E | ≥ 3|R| ⇒ |R| ≤ 2
3 |E ||V | − |E |+ |R| = 2⇒ |V | − |E |+ 2
3 |E | ≥ 2 ⇒ |V | − 13 |E | ≥ 2
⇒ 3|V | − |E | ≥ 6 ⇒ |E | ≤ 3|V | − 6
![Page 86: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/86.jpg)
Planar Graph Theorems
Theorem
G = (V ,E ): connected, planar graph where |V | ≥ 3|E | ≤ 3|V | − 6
Proof.
sum of region degrees: 2|E |degree of a region ≥ 3⇒ 2|E | ≥ 3|R| ⇒ |R| ≤ 2
3 |E ||V | − |E |+ |R| = 2⇒ |V | − |E |+ 2
3 |E | ≥ 2 ⇒ |V | − 13 |E | ≥ 2
⇒ 3|V | − |E | ≥ 6 ⇒ |E | ≤ 3|V | − 6
![Page 87: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/87.jpg)
Planar Graph Theorems
Theorem
G = (V ,E ): connected, planar graph where |V | ≥ 3:∃v ∈ V [dv ≤ 5]
Proof.
assume: ∀v ∈ V [dv ≥ 6]⇒ 2|E | ≥ 6|V |⇒ |E | ≥ 3|V |⇒ |E | > 3|V | − 6
![Page 88: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/88.jpg)
Planar Graph Theorems
Theorem
G = (V ,E ): connected, planar graph where |V | ≥ 3:∃v ∈ V [dv ≤ 5]
Proof.
assume: ∀v ∈ V [dv ≥ 6]⇒ 2|E | ≥ 6|V |⇒ |E | ≥ 3|V |⇒ |E | > 3|V | − 6
![Page 89: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/89.jpg)
Planar Graph Theorems
Theorem
G = (V ,E ): connected, planar graph where |V | ≥ 3:∃v ∈ V [dv ≤ 5]
Proof.
assume: ∀v ∈ V [dv ≥ 6]⇒ 2|E | ≥ 6|V |⇒ |E | ≥ 3|V |⇒ |E | > 3|V | − 6
![Page 90: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/90.jpg)
Planar Graph Theorems
Theorem
G = (V ,E ): connected, planar graph where |V | ≥ 3:∃v ∈ V [dv ≤ 5]
Proof.
assume: ∀v ∈ V [dv ≥ 6]⇒ 2|E | ≥ 6|V |⇒ |E | ≥ 3|V |⇒ |E | > 3|V | − 6
![Page 91: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/91.jpg)
Planar Graph Theorems
Theorem
G = (V ,E ): connected, planar graph where |V | ≥ 3:∃v ∈ V [dv ≤ 5]
Proof.
assume: ∀v ∈ V [dv ≥ 6]⇒ 2|E | ≥ 6|V |⇒ |E | ≥ 3|V |⇒ |E | > 3|V | − 6
![Page 92: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/92.jpg)
Nonplanar Graphs
Theorem
K5 is not planar.
Proof.
|V | = 5
3|V | − 6 = 3 · 5− 6 = 9
|E | ≤ 9 should hold
but |E | = 10
![Page 93: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/93.jpg)
Nonplanar Graphs
Theorem
K5 is not planar.
Proof.
|V | = 5
3|V | − 6 = 3 · 5− 6 = 9
|E | ≤ 9 should hold
but |E | = 10
![Page 94: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/94.jpg)
Nonplanar Graphs
Theorem
K5 is not planar.
Proof.
|V | = 5
3|V | − 6 = 3 · 5− 6 = 9
|E | ≤ 9 should hold
but |E | = 10
![Page 95: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/95.jpg)
Nonplanar Graphs
Theorem
K5 is not planar.
Proof.
|V | = 5
3|V | − 6 = 3 · 5− 6 = 9
|E | ≤ 9 should hold
but |E | = 10
![Page 96: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/96.jpg)
Nonplanar Graphs
Theorem
K5 is not planar.
Proof.
|V | = 5
3|V | − 6 = 3 · 5− 6 = 9
|E | ≤ 9 should hold
but |E | = 10
![Page 97: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/97.jpg)
Nonplanar Graphs
Theorem
K3,3 is not planar. Proof.
|V | = 6, |E | = 9
if planar then |R| = 5
degree of a region ≥ 4⇒
∑r∈R dr ≥ 20
|E | ≥ 10 should hold
but |E | = 9
![Page 98: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/98.jpg)
Nonplanar Graphs
Theorem
K3,3 is not planar. Proof.
|V | = 6, |E | = 9
if planar then |R| = 5
degree of a region ≥ 4⇒
∑r∈R dr ≥ 20
|E | ≥ 10 should hold
but |E | = 9
![Page 99: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/99.jpg)
Nonplanar Graphs
Theorem
K3,3 is not planar. Proof.
|V | = 6, |E | = 9
if planar then |R| = 5
degree of a region ≥ 4⇒
∑r∈R dr ≥ 20
|E | ≥ 10 should hold
but |E | = 9
![Page 100: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/100.jpg)
Nonplanar Graphs
Theorem
K3,3 is not planar. Proof.
|V | = 6, |E | = 9
if planar then |R| = 5
degree of a region ≥ 4⇒
∑r∈R dr ≥ 20
|E | ≥ 10 should hold
but |E | = 9
![Page 101: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/101.jpg)
Nonplanar Graphs
Theorem
K3,3 is not planar. Proof.
|V | = 6, |E | = 9
if planar then |R| = 5
degree of a region ≥ 4⇒
∑r∈R dr ≥ 20
|E | ≥ 10 should hold
but |E | = 9
![Page 102: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/102.jpg)
Nonplanar Graphs
Theorem
K3,3 is not planar. Proof.
|V | = 6, |E | = 9
if planar then |R| = 5
degree of a region ≥ 4⇒
∑r∈R dr ≥ 20
|E | ≥ 10 should hold
but |E | = 9
![Page 103: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/103.jpg)
Kuratowski’s Theorem
Theorem
G contains a subgraph homeomorphic to K5 or K3,3.⇔
G is not planar.
![Page 104: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/104.jpg)
Platonic Solids
regular polyhedron: a 3-dimensional solidwhere faces are identical regular polygons
projection of a regular polyhedron onto the plane:a planar graph
corners: nodes
sides: edges
faces: regions
![Page 105: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/105.jpg)
Platonic Solid Example
![Page 106: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/106.jpg)
Platonic Solids
|V |: number of corners (nodes)
|E |: number of sides (edges)
|R|: number of faces (regions)
n: number of faces meeting at a corner (node degree)
m: number of sides of a face (region degree)
m, n ≥ 3
2|E | = n · |V |2|E | = m · |R|
![Page 107: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/107.jpg)
Platonic Solids
|V |: number of corners (nodes)
|E |: number of sides (edges)
|R|: number of faces (regions)
n: number of faces meeting at a corner (node degree)
m: number of sides of a face (region degree)
m, n ≥ 3
2|E | = n · |V |2|E | = m · |R|
![Page 108: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/108.jpg)
Platonic Solids
from Euler’s formula:
2 = |V |−|E |+|R| = 2|E |n−|E |+2|E |
m= |E |
(2m −mn + 2n
mn
)> 0
|E |,m, n > 0:
2m −mn + 2n > 0⇒ mn − 2m − 2n < 0
⇒ mn − 2m − 2n + 4 < 4⇒ (m − 2)(n − 2) < 4
only 5 solutions
![Page 109: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/109.jpg)
Platonic Solids
from Euler’s formula:
2 = |V |−|E |+|R| = 2|E |n−|E |+2|E |
m= |E |
(2m −mn + 2n
mn
)> 0
|E |,m, n > 0:
2m −mn + 2n > 0⇒ mn − 2m − 2n < 0
⇒ mn − 2m − 2n + 4 < 4⇒ (m − 2)(n − 2) < 4
only 5 solutions
![Page 110: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/110.jpg)
Platonic Solids
from Euler’s formula:
2 = |V |−|E |+|R| = 2|E |n−|E |+2|E |
m= |E |
(2m −mn + 2n
mn
)> 0
|E |,m, n > 0:
2m −mn + 2n > 0⇒ mn − 2m − 2n < 0
⇒ mn − 2m − 2n + 4 < 4⇒ (m − 2)(n − 2) < 4
only 5 solutions
![Page 111: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/111.jpg)
Platonic Solids
from Euler’s formula:
2 = |V |−|E |+|R| = 2|E |n−|E |+2|E |
m= |E |
(2m −mn + 2n
mn
)> 0
|E |,m, n > 0:
2m −mn + 2n > 0⇒ mn − 2m − 2n < 0
⇒ mn − 2m − 2n + 4 < 4⇒ (m − 2)(n − 2) < 4
only 5 solutions
![Page 112: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/112.jpg)
Platonic Solids
from Euler’s formula:
2 = |V |−|E |+|R| = 2|E |n−|E |+2|E |
m= |E |
(2m −mn + 2n
mn
)> 0
|E |,m, n > 0:
2m −mn + 2n > 0⇒ mn − 2m − 2n < 0
⇒ mn − 2m − 2n + 4 < 4⇒ (m − 2)(n − 2) < 4
only 5 solutions
![Page 113: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/113.jpg)
Tetrahedron
m = 3, n = 3
![Page 114: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/114.jpg)
Hexahedron
m = 4, n = 3
![Page 115: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/115.jpg)
Octahedron
m = 3, n = 4
![Page 116: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/116.jpg)
Dodecahedron
m = 5, n = 3
![Page 117: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/117.jpg)
Icosahedron
m = 3, n = 5
![Page 118: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/118.jpg)
Topics
1 GraphsIntroductionWalksTraversable GraphsPlanar Graphs
2 Graph ProblemsConnectivityGraph ColoringShortest PathTSPSearching Graphs
![Page 119: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/119.jpg)
Connectivity Matrix
A: adjacency matrix of G = (V ,E )
Akij : number of walks of length k between vi and vj
maximum distance between two nodes: |V | − 1
connectivity matrix:C = A1 + A2 + A3 + · · ·+ A|V |−1
connected: all elements of C are non-zero
![Page 120: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/120.jpg)
Connectivity Matrix
A: adjacency matrix of G = (V ,E )
Akij : number of walks of length k between vi and vj
maximum distance between two nodes: |V | − 1
connectivity matrix:C = A1 + A2 + A3 + · · ·+ A|V |−1
connected: all elements of C are non-zero
![Page 121: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/121.jpg)
Warshall’s Algorithm
very expensive to compute the connectivity matrix
easier to find whether there is a walk between two nodesrather than finding the number of walks
for each node:
from all nodes which can reach the current node(rows that contain 1 in current column)
to all nodes which can be reached from the current node(columns that contain 1 in current row)
![Page 122: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/122.jpg)
Warshall’s Algorithm
very expensive to compute the connectivity matrix
easier to find whether there is a walk between two nodesrather than finding the number of walks
for each node:
from all nodes which can reach the current node(rows that contain 1 in current column)
to all nodes which can be reached from the current node(columns that contain 1 in current row)
![Page 123: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/123.jpg)
Warshall’s Algorithm Example
a b c d
a 0 1 0 0b 0 1 0 0c 0 0 0 1d 1 0 1 0
![Page 124: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/124.jpg)
Warshall’s Algorithm Example
a b c d
a 0 1 0 0b 0 1 0 0c 0 0 0 1d 1 1 1 0
![Page 125: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/125.jpg)
Warshall’s Algorithm Example
a b c d
a 0 1 0 0b 0 1 0 0c 0 0 0 1d 1 1 1 0
![Page 126: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/126.jpg)
Warshall’s Algorithm Example
a b c d
a 0 1 0 0b 0 1 0 0c 0 0 0 1d 1 1 1 1
![Page 127: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/127.jpg)
Warshall’s Algorithm Example
a b c d
a 0 1 0 0b 0 1 0 0c 1 1 1 1d 1 1 1 1
![Page 128: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/128.jpg)
Topics
1 GraphsIntroductionWalksTraversable GraphsPlanar Graphs
2 Graph ProblemsConnectivityGraph ColoringShortest PathTSPSearching Graphs
![Page 129: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/129.jpg)
Graph Coloring
G = (V ,E ), C : set of colors
proper coloring of G : find an f : V → C , such that∀(vi , vj) ∈ E [f (vi ) 6= f (vj)]
chromatic number of G : χ(G )minimum |C |finding χ(G ) is a very difficult problem
χ(Kn) = n
![Page 130: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/130.jpg)
Graph Coloring
G = (V ,E ), C : set of colors
proper coloring of G : find an f : V → C , such that∀(vi , vj) ∈ E [f (vi ) 6= f (vj)]
chromatic number of G : χ(G )minimum |C |finding χ(G ) is a very difficult problem
χ(Kn) = n
![Page 131: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/131.jpg)
Graph Coloring
G = (V ,E ), C : set of colors
proper coloring of G : find an f : V → C , such that∀(vi , vj) ∈ E [f (vi ) 6= f (vj)]
chromatic number of G : χ(G )minimum |C |finding χ(G ) is a very difficult problem
χ(Kn) = n
![Page 132: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/132.jpg)
Chromatic Number Example
Herschel graph: χ(G ) = 2
![Page 133: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/133.jpg)
Graph Coloring Solution
pick a node and assign a color
assign same color to all nodes with no conflict
pick an uncolored node and assign a second color
assign same color to all uncolored nodes with no conflict
pick an uncolored node and assign a third color
. . .
![Page 134: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/134.jpg)
Heuristic Solutions
heuristic solution: based on intuition
greedy solution: doesn’t look ahead
doesn’t produce optimal results
![Page 135: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/135.jpg)
Graph Coloring Example
a company produces chemical compounds
some compounds cannot be stored together
such compounds must be placed in separate storage areas
store compounds using minimum number of storage areas
![Page 136: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/136.jpg)
Graph Coloring Example
a company produces chemical compounds
some compounds cannot be stored together
such compounds must be placed in separate storage areas
store compounds using minimum number of storage areas
![Page 137: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/137.jpg)
Graph Coloring Example
every compound is a node
two compounds that cannot be stored together are adjacent
![Page 138: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/138.jpg)
Graph Coloring Example
![Page 139: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/139.jpg)
Graph Coloring Example
![Page 140: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/140.jpg)
Graph Coloring Example
![Page 141: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/141.jpg)
Graph Coloring Example
![Page 142: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/142.jpg)
Graph Coloring Example: Sudoku
every cell is a node
cells of the same roware adjacent
cells of the same columnare adjacent
cells of the same 3× 3 blockare adjacent
every number is a color
problem: properly color a graphthat is partially colored
![Page 143: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/143.jpg)
Graph Coloring Example: Sudoku
every cell is a node
cells of the same roware adjacent
cells of the same columnare adjacent
cells of the same 3× 3 blockare adjacent
every number is a color
problem: properly color a graphthat is partially colored
![Page 144: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/144.jpg)
Region Coloring
coloring a map by assigning different colors to adjacent regions
Theorem (Four Color Theorem)
The regions in a map can be colored using four colors.
![Page 145: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/145.jpg)
Topics
1 GraphsIntroductionWalksTraversable GraphsPlanar Graphs
2 Graph ProblemsConnectivityGraph ColoringShortest PathTSPSearching Graphs
![Page 146: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/146.jpg)
Shortest Path
finding shortest paths from a starting nodeto all other nodes: Dijkstra’s algorithm
![Page 147: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/147.jpg)
Dijkstra’s Algorithm Example
starting node: c
a (∞,−)
b (∞,−)
c (0,−)
f (∞,−)
g (∞,−)
h (∞,−)
![Page 148: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/148.jpg)
Dijkstra’s Algorithm Example
from c: base distance=0
c → f : 6, 6 <∞c → h : 11, 11 <∞
a (∞,−)
b (∞,−)
c (0,−)√
f (6, cf )
g (∞,−)
h (11, ch)
closest node: f
![Page 149: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/149.jpg)
Dijkstra’s Algorithm Example
from c: base distance=0
c → f : 6, 6 <∞c → h : 11, 11 <∞
a (∞,−)
b (∞,−)
c (0,−)√
f (6, cf )
g (∞,−)
h (11, ch)
closest node: f
![Page 150: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/150.jpg)
Dijkstra’s Algorithm Example
from c: base distance=0
c → f : 6, 6 <∞c → h : 11, 11 <∞
a (∞,−)
b (∞,−)
c (0,−)√
f (6, cf )
g (∞,−)
h (11, ch)
closest node: f
![Page 151: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/151.jpg)
Dijkstra’s Algorithm Example
from f : base distance=6
f → a : 6 + 11, 17 <∞f → g : 6 + 9, 15 <∞f → h : 6 + 4, 10 < 11
a (17, cfa)
b (∞,−)
c (0,−)√
f (6, cf )√
g (15, cfg)
h (10, cfh)
closest node: h
![Page 152: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/152.jpg)
Dijkstra’s Algorithm Example
from f : base distance=6
f → a : 6 + 11, 17 <∞f → g : 6 + 9, 15 <∞f → h : 6 + 4, 10 < 11
a (17, cfa)
b (∞,−)
c (0,−)√
f (6, cf )√
g (15, cfg)
h (10, cfh)
closest node: h
![Page 153: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/153.jpg)
Dijkstra’s Algorithm Example
from f : base distance=6
f → a : 6 + 11, 17 <∞f → g : 6 + 9, 15 <∞f → h : 6 + 4, 10 < 11
a (17, cfa)
b (∞,−)
c (0,−)√
f (6, cf )√
g (15, cfg)
h (10, cfh)
closest node: h
![Page 154: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/154.jpg)
Dijkstra’s Algorithm Example
from h: base distance=10
h→ a : 10 + 11, 21 ≮ 17
h→ g : 10 + 4, 14 < 15
a (17, cfa)
b (∞,−)
c (0,−)√
f (6, cf )√
g (14, cfhg)
h (10, cfh)√
closest node: g
![Page 155: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/155.jpg)
Dijkstra’s Algorithm Example
from h: base distance=10
h→ a : 10 + 11, 21 ≮ 17
h→ g : 10 + 4, 14 < 15
a (17, cfa)
b (∞,−)
c (0,−)√
f (6, cf )√
g (14, cfhg)
h (10, cfh)√
closest node: g
![Page 156: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/156.jpg)
Dijkstra’s Algorithm Example
from h: base distance=10
h→ a : 10 + 11, 21 ≮ 17
h→ g : 10 + 4, 14 < 15
a (17, cfa)
b (∞,−)
c (0,−)√
f (6, cf )√
g (14, cfhg)
h (10, cfh)√
closest node: g
![Page 157: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/157.jpg)
Dijkstra’s Algorithm Example
from g : base distance=14
g → a : 14 + 17, 31 ≮ 17
a (17, cfa)
b (∞,−)
c (0,−)√
f (6, cf )√
g (14, cfhg)√
h (10, cfh)√
closest node: a
![Page 158: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/158.jpg)
Dijkstra’s Algorithm Example
from g : base distance=14
g → a : 14 + 17, 31 ≮ 17
a (17, cfa)
b (∞,−)
c (0,−)√
f (6, cf )√
g (14, cfhg)√
h (10, cfh)√
closest node: a
![Page 159: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/159.jpg)
Dijkstra’s Algorithm Example
from g : base distance=14
g → a : 14 + 17, 31 ≮ 17
a (17, cfa)
b (∞,−)
c (0,−)√
f (6, cf )√
g (14, cfhg)√
h (10, cfh)√
closest node: a
![Page 160: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/160.jpg)
Dijkstra’s Algorithm Example
from a: base distance=17
a→ b : 17 + 5, 22 <∞a (17, cfa)
√
b (22, cfab)
c (0,−)√
f (6, cf )√
g (14, cfhg)√
h (10, cfh)√
last node: b
![Page 161: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/161.jpg)
Dijkstra’s Algorithm Example
from a: base distance=17
a→ b : 17 + 5, 22 <∞a (17, cfa)
√
b (22, cfab)
c (0,−)√
f (6, cf )√
g (14, cfhg)√
h (10, cfh)√
last node: b
![Page 162: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/162.jpg)
Dijkstra’s Algorithm Example
from a: base distance=17
a→ b : 17 + 5, 22 <∞a (17, cfa)
√
b (22, cfab)
c (0,−)√
f (6, cf )√
g (14, cfhg)√
h (10, cfh)√
last node: b
![Page 163: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/163.jpg)
Topics
1 GraphsIntroductionWalksTraversable GraphsPlanar Graphs
2 Graph ProblemsConnectivityGraph ColoringShortest PathTSPSearching Graphs
![Page 164: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/164.jpg)
Traveling Salesperson Problem
start from a home town
visit every city exactly once
return to the home town
minimum total distance
find Hamiltonian cycle
very difficult problem
![Page 165: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/165.jpg)
Traveling Salesperson Problem
start from a home town
visit every city exactly once
return to the home town
minimum total distance
find Hamiltonian cycle
very difficult problem
![Page 166: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/166.jpg)
TSP Solution
heuristic: nearest-neighbor
![Page 167: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/167.jpg)
Topics
1 GraphsIntroductionWalksTraversable GraphsPlanar Graphs
2 Graph ProblemsConnectivityGraph ColoringShortest PathTSPSearching Graphs
![Page 168: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/168.jpg)
Searching Graphs
searching nodes of graph G = (V ,E ) starting from node v1
depth-first
breadth-first
![Page 169: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/169.jpg)
Depth-First Search
1 v ← v1,T = ∅, D = {v1}2 find smallest i in 2 ≤ i ≤ |V | such that (v , vi ) ∈ E and vi /∈ D
if no such i : go to step 3if found: T = T ∪ {(v , vi )}, D = D ∪ {vi}, v ← vi ,go to step 2
3 if v = v1: result is T
4 if v 6= v1: v ← backtrack(v), go to step 2
![Page 170: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/170.jpg)
Depth-First Search
1 v ← v1,T = ∅, D = {v1}2 find smallest i in 2 ≤ i ≤ |V | such that (v , vi ) ∈ E and vi /∈ D
if no such i : go to step 3if found: T = T ∪ {(v , vi )}, D = D ∪ {vi}, v ← vi ,go to step 2
3 if v = v1: result is T
4 if v 6= v1: v ← backtrack(v), go to step 2
![Page 171: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/171.jpg)
Depth-First Search
1 v ← v1,T = ∅, D = {v1}2 find smallest i in 2 ≤ i ≤ |V | such that (v , vi ) ∈ E and vi /∈ D
if no such i : go to step 3if found: T = T ∪ {(v , vi )}, D = D ∪ {vi}, v ← vi ,go to step 2
3 if v = v1: result is T
4 if v 6= v1: v ← backtrack(v), go to step 2
![Page 172: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/172.jpg)
Depth-First Search
1 v ← v1,T = ∅, D = {v1}2 find smallest i in 2 ≤ i ≤ |V | such that (v , vi ) ∈ E and vi /∈ D
if no such i : go to step 3if found: T = T ∪ {(v , vi )}, D = D ∪ {vi}, v ← vi ,go to step 2
3 if v = v1: result is T
4 if v 6= v1: v ← backtrack(v), go to step 2
![Page 173: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/173.jpg)
Breadth-First Search
1 T = ∅, D = {v1}, Q = (v1)
2 if Q empty: result is T
3 if Q not empty: v ← front(Q), Q ← Q − vfor 2 ≤ i ≤ |V | check edges (v , vi ) ∈ E :
if vi /∈ D : Q = Q + vi , T = T ∪ {(v , vi )}, D = D ∪ {vi}go to step 3
![Page 174: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/174.jpg)
Breadth-First Search
1 T = ∅, D = {v1}, Q = (v1)
2 if Q empty: result is T
3 if Q not empty: v ← front(Q), Q ← Q − vfor 2 ≤ i ≤ |V | check edges (v , vi ) ∈ E :
if vi /∈ D : Q = Q + vi , T = T ∪ {(v , vi )}, D = D ∪ {vi}go to step 3
![Page 175: Graphs H. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre ...nlp.jbnu.ac.kr/~nash/DM/slides/ch10_graphs.pdfH. Turgut Uyar Ay¸seg¨ul Gencata Yayımlı Emre Harmancı 2001-2016. License](https://reader036.vdocuments.site/reader036/viewer/2022062510/61217e2e03d73557471edc84/html5/thumbnails/175.jpg)
References
Required Reading: Grimaldi
Chapter 11: An Introduction to Graph Theory
Chapter 7: Relations: The Second Time Around
7.2. Computer Recognition: Zero-One Matricesand Directed Graphs
Chapter 13: Optimization and Matching
13.1. Dijkstra’s Shortest Path Algorithm