You are on page 1of 44

1

6
5
2

Graphs
1.8

( )graphs

( vertices ) edges

( ) .
.

1.8

1.2.8

1.2.8 simple graph

852

Graphs

-8 .
.

-2 .

.simple graph

E V:
}V = {v1, v2, , v3, , , vn
}E = { (u, v) : u, vV, uv
) (u, v ).(v, u

()

. multigraph

. 1.2.2

1.2.2 multigraph

multiple edges

loops
.pseudograph

Discrte Structures

851

1.8 applications of graphs

)8 Star Topology
1.1.8 ( )
switch .hub

1.1.8
:
)(v1, v2), (v1, v3), , (v1 , vn
v1 ( )hub
v2, v3, , vn-1,vn
.

Graphs

851

)2 Ring Topology
( )

. 1.1.2

1.1.2 ring topology


)1 Hybrid

wheel

Discrte Structures

1.8

855

Complete Graphs

() .

Kn
n .


-2

Cycles

Ck

k :

856

Graphs

Cycles

Cn
v1, v2, v3, , vn-1,vn
:
:

)(v1, v2), (v2, v3), , (vn-1 , vn

.undirected graph

.directed graphs

directed graph

Discrte Structures

851

( ) ( ) ( ) ( )

( ) ( )

. directed
multgraph

1.8

handshaking theorem

-8 u v ( ) adjacent
.

-2 .

:
Deg( v ) = 2

851

Graphs

e n

)2e = deg(v1) + deg(v2) + + deg(vn


( ) C2 n=3
e=3
deg(v1) + deg(v2) + deg(v3) = 2 + 2 +2 =6
)2e = 2(3
K6

5 6
deg(v1) + deg(v2) + + deg(v6) = 6(5)= 30 = 2e
=e = 30/2 = 15

1.5 ()88
)8
() v

() e

( ) deg
:

Discrte Structures

851

)2 ( )8 (

)deg (v) = 2e

1.6 Representing Graphs

.
)8 ( )

( )Adjacency List .
: :

861

Graphs

:
Vertex Adjacency vertices


a
b, c , e
b
a
c
a, d, e
d
c, e
e
d, a, c

)2 Directed Graph
.
: :

Discrte Structures

Terminal vertices

b, c, e, d
b, d
c
b, c, d

868

Initial vertex

a
b
c
d
e

)8 Adjacency Matrix
aij .

vi vj aij = 1 .aij = 0

vi .G
: :

862

Graphs

: :

a b
b . a

: .
:

Discrte Structures

861

: adjacency matrix

aij vj vi

861

Graphs

: ( )a, b, c, d
:

c .

)Directed Graph (Digraph


aij =1

Multi graph


aij = number of edges from vi To vj
= aij
vi vj

Discrte Structures

865

Incidence Matrix

. M

vi ) ej vertex(i ). edge(j
: M :

: 5 6 .

866

Graphs

: incidence matrix

Discrte Structures

861

1.8 ()85

-8 adjacency List :
()

()

-2 -8 adjacency matrix

861

Graphs

-1 k4 .
-1 C4 .
-5 adjacency matrix

-6

-1

Discrte Structures

861

-8

-1

811

-81

-88

Graphs

Discrte Structures

818

-12 (.)6
-81 (.)1

1.1 Directed Graph

R ) (edge ( )( )a,b

:
a

a
b

b.
edge or arc

() initial vertex

)vertex

(terminal

:
})R = {(a, b), (a, d), (b, b), (b, d), (c, b), (d, b
:

-:

812

Graphs

directed graph R

( )8 reflexive loop
( )2
:

Symmetric
( )1
Anti symmetric

Discrte Structures

811

( )1 x
y y z x
.z
Transitive

.
b a a .b

antisymmetric
.b , a

811

Graphs

a c c b

a .b

reflexive symmetric

transitive ) (a, b ) (b, c


) (a,c .

1.8()86
( )8 .

Discrte Structures

815

})a) {(1,1),(1,2),(1,3
})b) {(1,2),(2,1),(2,2),(3,3
})c) {(1,1),(1,2),(1,3),(2,2),(2,3),(3,3
})d) {(1,3),(3,1
( )2 :

-1 equivalence relation
()

()

( )

816

Graphs

Discrte Structures

811

)1 poset
-

811

Graphs

1.81 Connectivity
()

.
.
.
( :

)
multigraph .

( )8 ( Path V0 )Vn
( )multigraph ( )sequence
(V0, e1, V1, e2, ,en,Vn) :

ei Vi Vi-1
( )2


)(V0, e1, V1, e2, ,en,Vn
. n

Discrte Structures

811


e1, e2, ,en
:
V0, V1, ,Vn
.
( )1 Circuit

V0 = Vn

( )1 :simple path (
) .
:
:

811

Graphs

- ) (V4,V1,V5,V2,V6
- ( )V4,V1,V2,V5,V1,V2,V3,V6

() - ( )V4,V1,V5,V2,V3,V5,V6
- () path
- V4 .V6

:
- V2 V6
. .

-
V4 . V6

- ( )V1,V2 .

Discrte Structures

818

- .
- V5 .
- ()V4,V5,V6

()V4,V1,V2,V3,V6

= ( 2 ) = 1
.
:
connected .

812

Graphs

Discrte Structures

811

1.88 Bipartite

G ( ) V

N , M G M . N

M N

Km,n m M n N

: bipartite


Complete bipartite
) K(2,4 M N :

Graphs

811

M . N
.

A G r
Vi Vj Bij :
B = Ar
:
b

d
1 a d
: adjacency matrix

B=A =AAAA

Discrte Structures

815

= A A

1 1 a d
:

)(a,b,a,b,d
)(a,b,a,c,d
)(a,b,d,b,d
)(a,b,d,c,d
)(a,c,a,b,d
)(a,c,a,c,d
)(a,c,d,b,d
)(a,c,d,c,d

Path-1:
Path-2:
Path-3:
Path-4:
Path-5:
Path-6:
Path-7:
Path-8:

1.88 ()88
( )8

816

Graphs

)a) (a,e,b,c,b
)b) (a,e,a,d,b,c,a
)c) (e,b,a,d,b,e
)d) (c,b,d,a,e,c
e , d , c , b , a :

( )2

Discrte Structures

811

( )1 n K4
a) n = 2
b) n = 4

8.13 Planner Graphs


-:
planner ( No
. )edges Crossing

Planner

( Representation )
: K4

: K4 :

: Q3

811

Graphs

: Q3

.
6 ()R1,R2,R3,R4,R5,R6

Discrte Structures

811

Unbounded
R6
Euler's Formula
(

r=ev+2

= number of regions = r
= number of edges = e

= number of vertices

=v


() .

811

Graphs

: 21 .1

:
.
)2e = deg(v
= 20 (3) = 60
e = 30
:
r = e v + 2 = 30 20 + 2 = 12

1.88 Weighted Graphs


weighed
(

Shortest Path .
: :

Discrte Structures

818

)(P,A1,A2,A5,A3,A6,Q

( )weight
3 + 3 + 3 + 2 + 1 + 2 = 14
P . Q

P,A1,A2,A3,Q

3 + 3 + 6 + 4 = 16

. Dijkstre

1.85

812

Graphs

()81

-8

-2

Discrte Structures

811

-1

-1 6 . 1

-5- a e

811

Graphs

You might also like