Unit 4 - Graph
Unit 4 - Graph
Discrete Structure
1
Graphs
⚫ Definition
⚫ Undirected and Directed Graph
⚫ Degree of vertex
⚫ Types of Graph
⚫ Simple Graph
⚫ Multigraph
⚫ Pseudo Graph
The link structure of a website could be represented
byadirected graph. The vertices are the web pages
available at the website and a directed edge from
page Ato page Bexists if and only if Acontains a link
to B.Asimilar approach can be taken to problems in
travel, biology, computer chip design, and many
other fields.
3
⚫ Graph theory was brought about to study methods of making
a path from one point to another without retracing any steps
4
Definition - Graph
• Dots (Vertices)
5
Graphs
6
Undirected Graph
Directed Graph
7
Directed and Undirected Multigraphs
8
DEGREE OF VERTEX
⚫ Degree
⚫ The degree of a vertex is the number of edges incident to that vertex.
9
GRAPH TERMINOLOGY
10
Terms ⚫ Regular – type of graph with every vertex
⚫ Edge – any line drawn from one dot to having the same degree
another
⚫ Path – the route traveled along edges and
⚫ Vertex – Each dot that appears in a through vertices
collaboration of dots
⚫ Cycle – path that begins and ends at the
⚫ Degree – (of a vertex)The number of same vertex
edges that touch a vertex
⚫ Node – connecting point at which several
⚫ Size – of a graph is the number of vertices lines come together
that the graph has
12
Simple Graph
⚫ Thought of as G = (V
,E)
⚫ Vis a non empty set of
vertices
⚫ E is a set of unordered
pairs of distinct elements
ofVcalled edges
17
Graph Terminology
⚫Example: Which vertices in the following graph are isolated,
which are pendant, and what is the maximum degree?What type
of graph is it?
k h
d
a e
b c f j
14
Example of a simple graph
15
Multigraphs
⚫ Not every multigraph is a
⚫ Similar to a simple graph but it simple but every simple graph
more arcs from one vertex to can be a multigraph.
another.
⚫ Reasoning – there can be two
⚫ In this case multiple edges are or more edges that connect
allowed the same set of vertices
16
Pseudograph
17
Pseudograph
18
Types of Graph
⚫ Null Graph : Graph in which E is empty.
⚫ Graph consists of only isolated vertices
v1 v2
v3 v4
19
Complete graph
⚫ Denoted Kn
⚫ Every vertex connected to other vertex &there is no loop.
⚫ K4 V1 V2
V3 V4
20
Cycles
⚫ Special simple graphs that contain cycles are the basic
geometric figures
⚫ The number of cycles in each figure depends on the
number of vertices and edges.
⚫ In determining if a graph has a cycle, there must be no
edges on the inner part of the figure.
21
Special Simple Graphs
⚫ Special simple graphs are complete
graphs because there is one edge
between each pair of vertices
22
Special Graphs
⚫Definition:The cycle Cn, n 3, consists of n vertices v1,
v2,
…, vn and edges {v1, v2}, {v2, v3}, …, {vn-1, vn}, {vn, v1}.
C3 C4 C5 C6
23
Special Graphs
⚫Definition:The complete graph on n vertices, denoted
by Kn, is the simple graph that contains exactly one edge
between each pair of distinct vertices.
24
Triangle
Square
Pentagon
26
Triangle
Square
Pentagon
27
Wheels
⚫ Special simple graphs that contain wheels are graphs that
have a single point in the middle of the figure and there are
edges going from each outer vertex to the single inner vertex
28
Special Graphs
⚫Definition:We obtain the wheelWn when we add an additional
vertex to the cycle Cn, for n 3, and connect this new vertex to
each of the n vertices in Cn by adding new edges.
W3 W4 W5 W6
29
WHEEL GRAPHS
33
Cubic Graph
a cubic graph is a graph in which all vertices have degree three.
3 regular connected graph is called cubic graph.
a cubic graph has only always even number of Vertices and it must
be atleast 4
a cubic graph is a graph in which all vertices have degree three.
v4 v3
v
v5 v6
4
v1 v2
v3
v1 v2
31
Planar Graph
Agraph is said to be planar if it can be drawn on aplane in such away
that no edge cross one another, except at common vertices’
Example K4
32