0% found this document useful (0 votes)
3 views

Unit 4 - Graph

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Unit 4 - Graph

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 32

Lecture

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

⚫ VERTEX – the point at which two or more sides meet.

4
Definition - Graph

Agraph is any collection of

• Dots (Vertices)

• Arcs/Lines (Edges) that join the points

5
Graphs

⚫Graphs are structures that contain vertices that are all


connected.

⚫All graphs are determined depending on the number


of edges that are connected by the vertices.

6
Undirected Graph

Directed Graph

7
Directed and Undirected Multigraphs

⚫ Directed graph – can have


⚫ Undirected Graph – has
multiple edges and loops,
but the direction must be multiple edges that can go
different for each edge in the same direction

8
DEGREE OF VERTEX

⚫ Degree
⚫ The degree of a vertex is the number of edges incident to that vertex.

⚫ For directed graph


⚫ in-degree (v) : the number of edges that have v as the head.
⚫ out-degree (v) : the number of edges that have v as the tail.

9
GRAPH TERMINOLOGY

⚫Avertex of degree 0 is called isolated, since it is not adjacent


to any vertex.
⚫Note: Avertex with a loop at it has at least degree 2 and, by
definition, is not isolated, even if it is not adjacent to any other
vertex.
⚫Avertex of degree 1 is called pendant. It is adjacent to
exactly one other vertex.

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

Solution: Vertex f is isolated, and vertices a, d and j are pendant.


The maximum degree is deg(g) = 5.
This graph is a pseudograph (undirected, loops).

14
Example of a simple graph

⚫ Computer Network ⚫ Each phone line is


consisting of computers and represented by an edge.
telephone lines between each
computer. ⚫ IF each computer is only
connected by one phone line
⚫ Each computer is then the network is
represented by a point. represented as 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

⚫ The most general type of


⚫ Another branch off the
simple graph undirected graph
⚫ They contain many loops
⚫ Has a loop
and multiple edges
⚫ Loop – a single edges going
from one vertex to itself

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

You might also like