Graphs-Discrete Mathematics-Lecture Slides, Slides of Discrete Mathematics

This lecture was delivered by Umar Faiz at Pakistan Institute of Engineering and Applied Sciences, Islamabad (PIEAS) for Discrete Mathematics course. It includes: Graphs, Simple, Multigraphs, Pseudographs, Adjacency, Incidence, Degree, Handshaking, Theorem

Typology: Slides

2011/2012

Uploaded on 07/11/2012

fazi
fazi 🇵🇰

4.7

(10)

15 documents

1 / 5

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
1
Graphs
Discrete Mathematics
Graph
Definition:
A simple graph G = (V, E) consists of V, a nonempty set
of vertices, and E, a set of unordered pairs of distinct
elements of V called edges.
•For each eE, e = {u, v} where u, v V.
A di td h ( t i l) ti l A
A
n
un
di
rec
t
e
d
grap
h (
no
t
s
i
mp
l
e
)
may
con
t
a
i
n
l
oops.
A
n
edge e is a loop if e = {u, u} for some uV.
v
u
(u, v)
2
Simple Graph
A simple graph is a finite undirected graph without loops
and multiple edges.
A simple graph G=(V,E) consists of:
a set V of vertices or nodes
a set E of edges / arcs / links
3
Multigraphs
A multigraph G = (V, E) consists of V, a nonempty finite
set of vertices and E, a finite multiset set of unordered
pairs of distinct elements of V called edges. Thus,
multiple edges between two vertices are allowed in a
multigraph.
4
Multiple edge
Multigraphs
Edge-labels distinguish between edges sharing same
endpoints. Labeling can be thought of as function:
e1 Æ{1,2}
e2 Æ{1,2}
e3 Æ{1,3} 1 2
e1
e2
e4 Æ{2,3}
e5 Æ{2,3}
e6 Æ{1,2}
5
3 4
e3e4
e5
e6
Pseudographs
If self-loops are allowed we get a pseudograph. Edges
may be associated with a single vertex, when the edge is
a loop
e1 Æ{1,2}
e2 Æ{1,2}
3
Æ
{1 3}
e1
e6
e
3
Æ
{1
,
3}
,
e4 Æ{2,3}
e5 Æ{2}
e6 Æ{2}
e7 Æ{4}
6
1 2
3 4
e3
e2
e4
e5e7
docsity.com
pf3
pf4
pf5

Partial preview of the text

Download Graphs-Discrete Mathematics-Lecture Slides and more Slides Discrete Mathematics in PDF only on Docsity!

Graphs

Discrete Mathematics

Graph

Definition:

  • A simple graph G = (V, E) consists of V, a nonempty set of vertices, and E, a set of unordered pairs of distinct elements of V called edges.
  • For each e∈E, e = {u, v} where u, v ∈ V.
  • AAn undirected graph (not simple) may contain loops. An di t d h ( t i l ) t i l A edge e is a loop if e = {u, u} for some u∈V. v

u

(u, v)

2

Simple Graph

  • A simple graph is a finite undirected graph without loops and multiple edges.
  • A simple graph G=(V,E) consists of:
    • a set V of vertices or nodes
    • a set E of edges / arcs / links

3

Multigraphs

  • A multigraph G = (V, E) consists of V, a nonempty finite set of vertices and E, a finite multiset set of unordered pairs of distinct elements of V called edges. Thus, multiple edges between two vertices are allowed in a multigraph.

4

Multiple edge

Multigraphs

  • Edge-labels distinguish between edges sharing same endpoints. Labeling can be thought of as function: e1 Æ {1,2} e2 Æ {1,2} e3 Æ {1,3} 1 2

e 1 e 2 e4 Æ {2,3} e5 Æ {2,3} e6 Æ {1,2}

5

3 4

e 3 e 4 e 5 e 6

Pseudographs

  • If self-loops are allowed we get a pseudograph. Edges may be associated with a single vertex, when the edge is a loop e1 Æ {1,2} e2 Æ {1,2} 3 Æ {1 3}

e 1 e^6 e3 Æ {1,3}, e4 Æ {2,3} e5 Æ {2} e6 Æ {2} e7 Æ {4}

6

1 2

3 4

e 3

e 2 e 4 e^5 e 7

docsity.com

Types of Graphs: Summary

T er m

E d g e ty p e

M u ltip le ed g es o k?

S elf- lo o p s o k? S im p le g rap h U n d ir. N o N o M u ltig rap h U n d ir. Y es N o P seu d o g rap h U n d ir. Y es Y es D irected g rap h D irected N o Y es D irected m u ltig rap hD irected m u ltig rap h D irectedD irected Y esY es Y esY es

7

Adjacency

  • Two vertices u and v in an undirected graph G are called adjacent (or neighbors) in G if {u, v} is an edge in G.
  • The vertices u and v are called endpoints of the edge {u, v}.

8

1 2

3 4

e 1

e 3

e 2 e 4 e 5 e 6

Adjacency

Example: Which vertices are adjacent to 1, 2, 3, 4?

1 2

e 1

e 3

e 2 e 4 e 5

Solution: Vertex1 is adjacent to 2 and 3 Vertex2 is adjacent to 1 and 3 Vertex3 is adjacent to 1 and 2 Vertex4 is not adjacent to any vertex 9

3^ e^64

Incidence

If e = {u, v}, the edge e is called incident with the vertices u and v. The edge e is also said to connect u and v.

Example:

  • Which edges are incident to vertices 1, 2, 3, 4?

10

1 2

3 4

e 1

e 3

e 2 e 4 e 5 e 6

Incidence

1 2

3 4

e 1

e 3

e 2 e 4 e 5 e 6

Solution: e1, e2, e3, e6 are incident with Vertex Vertex2 is incident with e1, e2, e4, e5, e Vertex3 is incident with e3, e4, e Vertex4 is not incident with any edge

11

Degree of a Graph

  • The degree of a vertex in an undirected graph is the number of edges incident with it, except that a loop at a vertex contributes twice to the degree of that vertex.
  • In other words, you can determine the degree of a vertex in a displayed graph by counting the lines that touch it.touch it.
  • The degree of the vertex v is denoted by deg(v).

12

docsity.com

Handshaking Theorem

Example:

  • How many edges are there in a graph with 10 vertices, each of degree 6? Solution:
  • The sum of the degrees of the vertices is 6⋅10 = 60. AAccording to the Handshaking Theorem, it follows that di t th H d h ki Th it f ll th t 2e = 60, so there are 30 edges.

19

Weighted Graph

  • If each edge in G is assigned a weight, it is called a weighted graph

Islamabad (^980) Karachi

Lahore

280 750

20

Directed Graph (digraph)

  • If each edge in E has a direction, it is called a directed edge. A directed graph is a graph where every edges is a directed edge.

Directed edge

Lahore

Islamabad (^980)

(^280 )

Karachi

21

Directed Multigraphs

  • Like directed graphs, but there may be more than one arc from a node to another.
  • A directed multigraph G=(V, E, f ) consists of a set V of vertices, a set E of edges, and a function f:E→V×V.
  • For example: VV=web pages b E=hyperlinks. The WWW is a directed multigraph.

22

Degree of a Directed Graph

Definition:

  • In a graph with directed edges, the in-degree of v, deg−(v), is the number of edges going to v.
  • The out-degree of v, deg+(v), is the number of edges coming from v.
  • Question: How does adding a loop to a vertex change the in-degree and out-degree of that vertex?
  • Answer: It increases both the in-degree and the out- degree by one.

23

Degree of a Directed Graph

Example:

  • What are the in-degrees and out-degrees of the vertices a, b, c, d in this graph:

deg a (^) b ‐(a) = 1 deg‐(b) = 4

24

a (^) b

d c

deg+^ (a) = 2 deg+^ (b) = 2

deg‐(d) = 2 deg+^ (d) = 1

deg‐(c) = 0 deg+^ (c) = 2

docsity.com

Degree of a Directed Graph

Theorem:

  • Let G = (V, E) be a graph with directed edges. Then:
    • = |E|
    • This is easy to see, because every new edge increases

deg ( v ) deg( v ) vV vV

− ∑∈ ∑ =

both the sum of in-degrees and the sum of out- degrees by one.

25

docsity.com