Lecture 2 - Graph Basics - I
Lecture 2 - Graph Basics - I
Contents
a. What is a Graph? a. Testing for Planarity
b. Definitions and Examples b. Thickness
2. Eulerian Graphs c. Duality
a. Eulerian Trails and Circuits 7. Coloring Graphs
a. Dominant Sets, independence and Cliques
b. Postman Problems
b. Vertex coloring, edge coloring
3. Hamiltonian Graphs c. Chromatic polynomial
a. Elementary Existence Theorems d. Coloring Maps
b. The Traveling Salesperson Problem e. 4-color theorem, 5-color theorem
4. Path Algorithms 8. Connectivity
a. Edge Connectivity
a. The shortest Path Algorithms
b. Vertex Connectivity
b. The Longest Path Algorithms c. Menger’s Theorems and Connectivity
c. Transitive Closure Algorithm 9. Networks and Flows
d. Biconnectivity a. Networks and Flows
e. Depth-Fist Search b. Maximum flow Problem
c. Multi-Commodity Flow Problem
f. Breadth-First Search
d. Minimum Cost Flow Algorithm
5. Trees e. Circulation Problem
a. Spanning Trees 10. Matchings
b. Centers and Bicenters a. Definitions
c. Binary Trees b. Maximum Matchings
c. Maximum Weight Matchings
d. Counting Trees
d. factor
e. Searching Trees 11. Graph and Np-Completeness
6. Planar Graph a. NP-Completeness
a. Euler’s Formula b. NP-Complete Problems in Graph 4
b. Genus
What is a Graph?
A set of Objects
Relations between pairs of Objects
A Graph G=(V,E)
A set V of Vertices/Nodes
A set E of Edges
5
Vocabulary
e Connects u and v
6
How about drawing these shapes?
7
The Königsberg Bridge problem
8
Abstract connection
Abstract
land
9
History of Graph Theory
Definitions: Two or more edges joining the same pair of vertices are
called multiple edges and an edge joining a vertex to itself is called a
loop. A graph with no loops or multiple edges is called a simple graph.
11
Definition: A subgraph of a graph G is a graph whose vertex set is a
subset of that of G, and whose adjacency relation is a subset of that of
G restricted to this subset. In the other direction, a supergraph of a
graph G is a graph of which G is a subgraph.
2 2
4 4
1 1
3 3
G A subgraph of G
(ex)
2
deg(1)=2, deg(2)=4,
4 deg(3)=4, deg(4)=2
1
3
12
G
A regular graph is a graph where each vertex has the same number of
neighbors, i.e. every vertex has the same degree or valency.
A regular graph with vertices of degree k is called a k-regular graph or
regular graph of degree k.
2 3 2 2
2
4
1 1 1
3 3 3 1
3
13
Walk
A walk is an alternating sequence of vertices and edges, beginning and
ending with a vertex, where each vertex is incident to both the edge
that precedes it and the edge that follows it in the sequence, and where
the vertices that precede and follow an edge are the end vertices of that
edge.
A walk is closed if its first and last vertices are the same, and open if
they are different.
The length l of a walk is the number of edges that it uses. For an open
walk, l = n–1, where n is the number of vertices visited (a vertex is
counted each time it is visited). For a closed walk, l = n
w z
(u,v,w,x,v,w,x,y,z,x): open walk, length=9
u v x y
w
v x
(u,v,w,x,y,w,x,y,u): closed walk, length=8
u 14
y
Trail, Path, Circuit, Cycle
Definition: If all the edges (but not necessarily all the vertices) of a
walk are different, then the walk is called a trail. If, in addition, all the
vertices are different, then the trails is called a path.
w z
(u,v,w,x,y,z,x): trail
u v x y (u,v,w,x,y,z) : path (simple path)
1
3
16
Handshaking Lemma
Handshaking Lemma: Every finite undirected graph has an even
number of vertices with odd degree.
In more colloquial terms, in a party of people some of whom shake
hands, an even number of people must have shaken an odd number of
other people's hands.
In any graph, the sum of all the vertex-degrees is equal to twice the
number of edges.
[proof]
Since each edge has two ends, it must contribute exactly 2 to the sum
of the degrees. The result follows immediately.
It is a consequence of the degree sum formula (also sometimes called
the handshaking lemma).
deg( v) 2 E
vV
17
(ex)
18
Practice
Problem 1
Determine the number of edges in a graph having
6 Vertices
2 having degree of 4
4 having degree of 2
Draw a graph for the information above with the number of edges det
ermined using handshaking lemma.
Problem 2
A graph contains 21 edges and 3 vertices of degree 4, and all the othe
r vertices of degree 2. Find total number of vertices.
Problem 3
A simple graph G has 24 edges and degree of each vertex is 4. Find th
e number of vertices.
Problem 4
A graph has 24 edges and degree of each vertex is k, then which of th
e following is possible no of vertices 19
20 - 15 -10 - 8
Isomorphic Graphs
1 2 3 1 b 3
?
=
a b c a 2 c
G H
21
An injective function (not a bijection): 단사함수
if x1, x2∈X with f(x1) = f(x2) then x1 = x2
A non-injective function
(this one happens to be a surjection(onto)
surjective(전사함수):
if y ∈Y, then there exists at least one x∈X such
that f(x) = y.
ƒ(a) = 1, ƒ(b) = 6
ƒ(c) = 8, ƒ(d) = 3
ƒ(g) = 5, ƒ(h) = 2
G ƒ(i) = 4, ƒ(j) = 7 H
24
Practice
Problem 1
How many simple non isomorphic graphs are possible with 3 vertices.
Problem 2
How many simple non isomorphic graphs are possible with 4 vertices and
2 edges.
Determine whether these graphs are isomorphic
Problem 3
Problem 4
25
Directed Graphs (Digraphs)
Definition: An ordered pair G = (V, A) with V a set whose elements are
called vertices or nodes, and A a set of ordered pairs of vertices, called
arcs, directed edges, or arrows. 1
2 3
x y
2 3
2 3 2 3 27
Underlying graph
Let D be a digraph with vertex-set V(D) and arc-list A(D). A
subdigraph of D is a digraph all of whose vertices belong to V(D) and
all of whose arcs belong to A(D).
1 4 1 4 4
2 3 2 3 2 3
D
subdigraphs
4
C and D are isomorphic.
z w 3
C D
28
Definitions: A digraph D is connected if its underlying graph is a
connected graph, and disconnected otherwise. If it is strongly connected
if there is a path in D from any vertex to any other.
(ex)
1 5 1 5 1 5
2 3 7 3 7 2 3 6 7
6 2 6
4 8 4 8 4 8
A B C
Digraph A is disconnected since its underlying graph is a disconnected
graph.
Digraph B is connected but not strongly connected since there is no path
from 6 to 3.
Digraph C is strongly connected since there are paths joining all pairs of
vertices.
29
Definition: A graph D is orientable if it is the underyling graph of a
strongly connected digraph – that is, if it is possible to ‘direct’ the edges
of G in such a way that the resulting digraph is strongly connected.
(Ex)
A B
In (A) , we see that the edges of the complete graph K5 can be
‘directed’ in such a way that the resulting digraph is strongly
connected →orientable.
But, (B) can not be. – a bridge exists.
A directed graph G is called symmetric if, for every arc that belongs to
G, the corresponding inverted arc also belongs to G. A symmetric
loopless directed graph is equivalent to an undirected graph with the
pairs of inverted arcs replaced with edges; thus the number of edges is
equal to the number of arcs halved.
1 1
=
2 3 2 3
31
Definition: Let D be a digraph and let v be a vertex of D. The out-
degree of v is the number of arcs incident from v, and is denoted by
outdeg(v). Similarly, The in-degree of v is the number of arcs incident
to v, and is denoted by indeg(v).
1
outdeg(1)=1, indeg(3)=2 3 G
2
4
The Handshaking Di-Lemma. In any digraph, the sum of all the out-
degrees and the sum of all the in-degrees are each equal to the number
of arcs.
In G, sum of out-degrees = 1+2+1+1=5, sum of in-degrees =
1+1+2+1=5, the number of arcs=5.
32
Summary
Covered the vocabulary and definitions of basic concepts of graphs
Discussed handshaking theorem and isomorphic graphs
Understood directed graphs and its concepts
33
Thanks
Next Lecture:
Graph Basics - II
34