Special Graph Structures

Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

Module #22 - Graphs

SPECIAL GRAPH STRUCTURES


Module #22 - Graphs

Special Graph Structures

Special cases of undirected graph structures:


• Complete graphs Kn
• Cycles Cn
• Wheels Wn
• n-Cubes Qn
• Bipartite graphs
• Complete bipartite graphs Km,n

10/1/2020 (c)2001-2003, Michael P. Frank 2


Module #22 - Graphs

Complete Graphs

• For any nN, a complete graph on n vertices, Kn, is a simple graph


with n nodes in which every node is adjacent to every other node:
u,vV: uv{u,v}E.

𝑛(𝑛−1)
Note that Kn has edges.
2

K1 K2 K3 K4
K5 K6

3
Module #22 - Graphs

Cycles

• For any n3, a cycle on n vertices, Cn, is a simple graph where


V={v1,v2,… ,vn} and E={{v1,v2},{v2,v3},…,{vn−1,vn},{vn,v1}}.

C3 C4 C5 C6 C8
C7
How many edges are there in Cn?
10/1/2020 (c)2001-2003, Michael P. Frank 4
Module #22 - Graphs

Wheels

• For any n3, a wheel Wn, is a simple graph obtained by taking the
cycle Cn and adding one extra vertex vhub and n extra edges {{vhub,v1},
{vhub,v2},…,{vhub,vn}}.

W3 W4 W5 W6 W8
W7
How many edges are there in Wn?
10/1/2020 (c)2001-2003, Michael P. Frank 5
Module #22 - Graphs

n-cubes (hypercubes)

• For any nN, the hypercube Qn is a simple graph consisting of two


copies of Qn-1 connected together at corresponding nodes. Q0 has 1
node.

Q0
Q1 Q2 Q4
Q3
Number of vertices: 2n. Number of edges:Exercise to try!

10/1/2020 (c)2001-2003, Michael P. Frank 6


Module #22 - Graphs

n-cubes (hypercubes)

• For any nN, the hypercube Qn can be defined recursively as follows:


• Q0={{v0},} (one node and no edges)

• For any nN, if Qn=(V,E), where V={v1,…,va} and E={e1,…,eb},


then Qn+1=(V{v1´,…,va´}, E{e1´,…,eb´}{{v1,v1´},{v2,v2´},…,
{va,va´}}) where v1´,…,va´ are new vertices, and where if
ei={vj,vk} then ei´={vj´,vk´}.

10/1/2020 (c)2001-2003, Michael P. Frank 7


Module #22 - Graphs
Bipartite graphs

• In a simple graph G, if V can be partitioned into two disjoint sets V1 and V2


such that every edge in the graph connects a vertex in V1 and a vertex V2 (so
that no edge in G connects either two vertices in V1 or two vertices in V2)
Application example: Representing Relations
Representation example: V1 = {v1, v2, v3} and V2 = {v4, v5, v6},

v4
v1

v5
v2

v6
v3

V1 V2
Module #22 - Graphs

Complete Bipartite graphs

• Km,n is the graph that has its vertex set portioned into two subsets of m and
n vertices, respectively There is an edge between two vertices if and only if
one vertex is in the first subset and the other vertex is in the second
subset.
Representation example: K2,3, K3,3

K2,3 K3,3

You might also like