Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
114 views88 pages

Basic Graphs PDF

The document discusses basic graph types including paths, cycles, complete graphs, and trees. It provides definitions and examples of each type. Path graphs consist of vertices connected by edges to form a linear structure. Cycle graphs are paths that form a cycle by connecting the first and last vertices. Complete graphs connect all vertices with edges. Trees are connected graphs without cycles that have n vertices and n-1 edges.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
114 views88 pages

Basic Graphs PDF

The document discusses basic graph types including paths, cycles, complete graphs, and trees. It provides definitions and examples of each type. Path graphs consist of vertices connected by edges to form a linear structure. Cycle graphs are paths that form a cycle by connecting the first and last vertices. Complete graphs connect all vertices with edges. Trees are connected graphs without cycles that have n vertices and n-1 edges.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 88

Basic Graphs

Alexander Golovnev
Outline

Paths, Cycles and Complete Graphs

Trees

Bipartite Graphs
Path Graphs

The Path Graph Pn , n ≥ 2, consists of


n vertices v1 , . . . , vn and n − 1 edges
{v1 , v2 }, . . . , {vn−1 , vn }

v1 v2 ... vn−1 vn
Path Graphs

The Path Graph Pn , n ≥ 2, consists of


n vertices v1 , . . . , vn and n − 1 edges
{v1 , v2 }, . . . , {vn−1 , vn }

The Graph P5

v1 v2 v3 v4 v5
Path Graphs

The Path Graph Pn , n ≥ 2, consists of


n vertices v1 , . . . , vn and n − 1 edges
{v1 , v2 }, . . . , {vn−1 , vn }

The Graph P2

v1 v2
Path Graphs

The Path Graph Pn , n ≥ 2, consists of


n vertices v1 , . . . , vn and n − 1 edges
{v1 , v2 }, . . . , {vn−1 , vn }

The Graph P9

v1 v2 v3 v4 v5 v6 v7 v8 v9
Path Graphs

The Path Graph Pn , n ≥ 2, consists of


n vertices v1 , . . . , vn and n − 1 edges
{v1 , v2 }, . . . , {vn−1 , vn }

The Graph P9
v8 v7
v9
v6
v1
v5
v2
v3 v4
Cycle Graphs

The Cycle Graph Cn , n ≥ 3, consists


of n vertices v1 , . . . , vn and n edges
{v1 , v2 }, . . . , {vn−1 , vn }, {vn , v1 }

v1 v2 ... vn−1 vn
Cycle Graphs

The Cycle Graph Cn , n ≥ 3, consists


of n vertices v1 , . . . , vn and n edges
{v1 , v2 }, . . . , {vn−1 , vn }, {vn , v1 }

The Graph C5

v1 v2 v3 v4 v5
Cycle Graphs

The Cycle Graph Cn , n ≥ 3, consists


of n vertices v1 , . . . , vn and n edges
{v1 , v2 }, . . . , {vn−1 , vn }, {vn , v1 }

The Graph C5
v5
v4
v1
v3
v2
Cycle Graphs

The Cycle Graph Cn , n ≥ 3, consists


of n vertices v1 , . . . , vn and n edges
{v1 , v2 }, . . . , {vn−1 , vn }, {vn , v1 }

The Graph C3

v1 v2

v3
Cycle Graphs

The Cycle Graph Cn , n ≥ 3, consists


of n vertices v1 , . . . , vn and n edges
{v1 , v2 }, . . . , {vn−1 , vn }, {vn , v1 }

The Graph C9
v8 v7
v9
v6
v1
v5
v2
v3 v4
Complete Graphs

The Complete Graph (Clique) Kn , n ≥


2, contains n vertices v1 , . . . , vn and
all edges between them (n(n − 1)/2
edges)

v6 v5

v1 v4

v2 v3
Complete Graphs

The Complete Graph (Clique) Kn , n ≥


2, contains n vertices v1 , . . . , vn and
all edges between them (n(n − 1)/2
edges)
The Graph K6

v6 v5

v1 v4

v2 v3
Complete Graphs

The Complete Graph (Clique) Kn , n ≥


2, contains n vertices v1 , . . . , vn and
all edges between them (n(n − 1)/2
edges)
The Graph K5
v5
v4
v1
v3
v2
Complete Graphs

The Complete Graph (Clique) Kn , n ≥


2, contains n vertices v1 , . . . , vn and
all edges between them (n(n − 1)/2
edges)
The Graph K3

v1 v2

v3
Complete Graphs

The Complete Graph (Clique) Kn , n ≥


2, contains n vertices v1 , . . . , vn and
all edges between them (n(n − 1)/2
edges)
The Graph K3 = C3

v1 v2

v3
Complete Graphs

The Complete Graph (Clique) Kn , n ≥


2, contains n vertices v1 , . . . , vn and
all edges between them (n(n − 1)/2
edges)
The Graph K2

v1 v2
Complete Graphs

The Complete Graph (Clique) Kn , n ≥


2, contains n vertices v1 , . . . , vn and
all edges between them (n(n − 1)/2
edges)
The Graph K2 = P2

v1 v2
Outline

Paths, Cycles and Complete Graphs

Trees

Bipartite Graphs
Trees

v6
v4 v5
v1
v3 v2
Trees

v6
v4 v5
v1
v3 v2
Trees

v6
v4 v5
v1
v3 v2
Trees

v6
v4 v5
v1
v3 v2
Trees

v6
v4 v5
v1
v3 v2
Trees

v6
v4 v5
v1
v3 v2
Trees

v6
v4 v5
v1
v3 v2
Trees

v6
v4 v5
v1
v3 v2
Trees

v6
v4 v5
v1
v3 v2
Definition

• A tree is a connected graph without cycles


Definition

• A tree is a connected graph without cycles

• A tree is a connected graph on n vertices with


n − 1 edges
Definition

• A tree is a connected graph without cycles

• A tree is a connected graph on n vertices with


n − 1 edges

• A graph is a tree if and only if there is a unique


simple path between any pair of its vertices
Trees: Examples
Trees: Examples
Trees: Examples
Trees: Examples

v1 v2 v3 v4 v5
Trees: Examples

v1 v2 v3 v4 v5
Trees: Examples
v5

v4

v3

v2

v1
Drawing a Tree
v5 v6

v4 v10

v3 v9

v1 v2 v7 v8
Drawing a Tree
v5 v6

v4 v10

Root
v3 v9

v1 v2 v7 v8
Drawing a Tree
v5 v6

v4 v10

v3 v9

v1 v2 v7 v8
Drawing a Tree
v5 v6
v3
v4 v10

v3 v9

v1 v2 v7 v8
Drawing a Tree
v5 v6
v3
v4 v10
v4 v1 v2 v9
v3 v9

v1 v2 v7 v8
Drawing a Tree
v5 v6
v3
v4 v10
v4 v1 v2 v9
v3 v9
v5 v6
v1 v2 v7 v8
Drawing a Tree
v5 v6
v3
v4 v10
v4 v1 v2 v9
v3 v9
v5 v6 v7 v8 v10
v1 v2 v7 v8
Drawing a Tree

v3

v4 v1 v2 v9

v5 v6 v7 v8 v10
Drawing a Tree

Connected; the number of edges is n − 1


v3

v4 v1 v2 v9

v5 v6 v7 v8 v10
Make a Tree

v5
v4

v1

v3
v2
Make a Tree

Remove any edge, keeping the


graph connected

v5
v4

v1

v3
v2
Make a Tree

Remove any edge, keeping the


graph connected
Stop when only n − 1 edges left

v5
v4

v1

v3
v2
Make a Tree

Remove any edge, keeping the


graph connected
Stop when only n − 1 edges left

v5
v4

v1

v3
v2
Make a Tree

Remove any edge, keeping the


graph connected
Stop when only n − 1 edges left

v5
v4

v1

v3
v2
Make a Tree

Remove any edge, keeping the


graph connected
Stop when only n − 1 edges left

v5
v4

v1

v3
v2
Make a Tree

Remove any edge, keeping the


graph connected
Stop when only n − 1 edges left

v5
v4

v1

v3
v2
Make a Tree

Remove any edge, keeping the


graph connected
Stop when only n − 1 edges left

v5
v4

v1

v3
v2
Make a Tree

Remove any edge, keeping the


graph connected
Stop when only n − 1 edges left

v5
v4

v1

v3
v2
Make a Tree

Remove any edge, keeping the


graph connected
Stop when only n − 1 edges left

v5
v4

v1

v3
v2
Make a Tree

Remove any edge, keeping the


graph connected
Stop when only n − 1 edges left

v5
v4

v1

v3
v2
Make a Tree

Remove any edge, keeping the


graph connected
Stop when only n − 1 edges left

v5
v4

v1

v3
v2
Make a Tree

Remove any edge, keeping the


graph connected
Stop when only n − 1 edges left

v5
v4

v1

v3
v2
Make a Tree

Remove any edge, keeping the


graph connected
Stop when only n − 1 edges left

v5
v4

v1

v3
v2
Outline

Paths, Cycles and Complete Graphs

Trees

Bipartite Graphs
Bipartite Graphs

• A graph G is Bipartite if its vertices can be


partitioned into two disjoint sets L and R such
that
Bipartite Graphs

• A graph G is Bipartite if its vertices can be


partitioned into two disjoint sets L and R such
that
• Every edge of G connects a vertex in L to
a vertex in R
Bipartite Graphs

• A graph G is Bipartite if its vertices can be


partitioned into two disjoint sets L and R such
that
• Every edge of G connects a vertex in L to
a vertex in R
• I.e., no edge connects two vertices from
the same part
Bipartite Graphs

• A graph G is Bipartite if its vertices can be


partitioned into two disjoint sets L and R such
that
• Every edge of G connects a vertex in L to
a vertex in R
• I.e., no edge connects two vertices from
the same part
• L and R are called the parts of G
Bipartite Graphs: Examples
Bipartite Graphs: Examples
Bipartite Graphs: Examples
Bipartite Graphs: Examples
v3

v2 v6

v1 v5 v9

v4 v8

v7
Bipartite Graphs: Examples
v3

v2 v6

v1 v5 v9

v4 v8

v7
Bipartite Graphs: Examples
v3

v2 v6

v1 v5 v9

v4 v8

v7
Bipartite Graphs: Examples
v3

v2 v6

v1 v5 v9

v4 v8

v7
Bipartite Graphs: Examples
v3

v2 v6

v1 v5 v9

v4 v8

v7
Bipartite Graphs: Examples
v3
v9 v8
v2 v6
v6
v7
v1 v5 v9 v4
v5
v2
v4 v8
v3 v1
v7
Bipartite Graphs: Examples
v3
v9 v8
v2 v6
v6
v7
v1 v5 v9 v4
v5
v2
v4 v8
v3 v1
v7
Complete Bipartite Graphs
Complete Bipartite Graphs

Complete bipartite graph


Complete Bipartite Graphs

Complete bipartite graph K2,3


Complete Bipartite Graphs
Complete Bipartite Graphs

Complete bipartite graph K4,3


Cycle Graphs

For even n, Cn is bipartite


Cycle Graphs

For odd n > 2, Cn is not bipartite


Trees are bipartite
Trees are bipartite
Trees are bipartite
Trees are bipartite
Trees are bipartite

You might also like