Graph Theory L-1-3
Graph Theory L-1-3
Q: How many possible graphs are there for the same set of vertices V ?
7
Simple Graphs
A: The number of subsets in the set of possible edges.
8
Definitions – Edge Type
Directed: Ordered pair of vertices. Represented as (u, v) directed from
vertex u to v.
u v
u v
Definitions – Edge Type
• Loop: A loop is an edge whose endpoints are equal i.e., an edge joining
a vertex to itself is called a loop. Represented as {u, u} = {u}
• Multiple Edges: Two or more edges joining the same pair of vertices.
Definitions – Graph Type
u v
w
Definitions – Graph Type
u
e1 e2
w
e3
v
Definitions – Graph Type
uu
ee11 w
w ee44
ee22
vv ee33
Definitions – Graph Type
Directed Graph: G(V, E), set of vertices V, and set of Edges E, that are ordered pairs of
elements of V (directed edges)
Representation Example: G(V, E), V = {u, v, w}, E = {(u, v), (v, w), (w, u)}
u v
w
Definitions – Graph Type
u
w e4
e1 e2
v e3
Definitions – Graph Type
Size of a graph: the size of a graph is the cardinality of its edge set
Terminology – Undirected graphs
• u and v are adjacent if {u, v} is an edge, e is called incident with u and v. u and v
are called endpoints of {u, v}
• Degree of Vertex (deg (v)): the number of edges incident on a vertex. A loop
contributes twice to the degree (why?).
Representation Example: For V = {u, v, w} , E = { {u, w}, {u, v} }, deg (u) = 2, deg (v) =
1, deg (w) = 1, deg (k) = 0, w and v are pendant , k is isolated
u v
k
w
Terminology – Directed graphs
• For the edge (u, v), u is adjacent to v OR v is adjacent from u, u – Initial vertex, v – Terminal vertex
Representation Example: For V = {u, v, w} , E = { (u, w), ( v, w), (u, v) }, deg- (u) = 0, deg+ (u) = 2, deg- (v) = 1,
deg+ (v) = 1, and deg- (w) = 2, deg+ (u) = 0
u v
w
Theorems: Undirected Graphs
Theorem 1
The Handshaking theorem:
2e = deg( v)
vV
Theorem 2:
An undirected graph has even number of vertices with odd degree
Pr oof V 1 is the set of even degree vertices and V2 refers to odd degree vertices
2e = deg(v) = deg(u) + deg(v)
vV u V1 v V2
u u u
v w v w v
G H1 H2
Subgraphs
26
Subgraphs
u
u
w v
w w v
G1 G2 G
Unions
28
Unions
If we assign the 2-cube faces (aka Squares) the names S1, S2, S3,
S4, S5, S6 then Q3 is the union of its faces:
Q3 = S1S2S3S4S5S6
29
Unions
30
Spanning Subgraph
• G = (V, E) be an unditected graph. Suppose that v1, v2, v3, …, vn are the vertices and
e1, e2, …, em are the edges of G. Then the incidence matrix with respect to this
ordering of V and E is the nx m matrix M = [m ij], where Can also be used to
represent :
Multiple edges: by using columns with identical entries, since these edges are
incident with the same pair of vertices
Loops: by using a column with exactly one entry equal to 1, corresponding to the
vertex that is incident with the loop
e1 e2 e3
u
v 1 0 1
e1 e2
u 1 1 0
v w w 0 1 1
e3
Representation- Adjacency Matrix
v u w
u
v 0 1 1
u 1 0 1
v w
w 1 1 0
Representation- Adjacency Matrix
v u w
u
v 0 1 0
u 0 0 1
v w
w 1 0 0
Representation- Adjacency List
u
node Adjacency List
u v,w
v w, u
v w
w u,v
Graph - Isomorphism
Application Example:
In chemistry, to find if two compounds have the same structure
Graph - Isomorphism
u1 u2 v1 v2
u3 u4 v4
v3
Thank you!
Write a closing statement or call-to-action here.