Tải bản đầy đủ (.pptx) (18 trang)

Discrrete mathematics for computer science graphs

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (2.21 MB, 18 trang )

Simple Graphs

aka “Undirected Graphs”

3/19/12

1


Types of Graphs

Simple

Directed Graph

Graph

before spring break

this week

3/19/12

Multi-Graph

2


A simple graph:

Definition:



A simple graph G consists of
a nonempty set, V, of vertices, and
a set, E, of edges such that
each edge has two distinct

endpoints in V

Write G = (V,E)

3/19/12

3


A Simple Graph

edge

vertices, V
undirected edges, E
::= { , }

“adjacent ”
3/19/12

4


A simple graph G:


V={a,b,c,d,e,f}
E={{a,d},{a,e},{b,c},{b,e},
{b,f},{c,f},{d,f},{e,f}}
d

b
c

a
f
e
3/19/12

picture of G

5


Vertex degree

degree of a vertex is
# of incident edges

deg( ) = 2

3/19/12

6



Vertex degree

degree of a vertex is
# of incident edges

deg( ) = 4

3/19/12

7


PossibleGraph
Graph?
Impossible

Is there a graph with
vertex degrees 2,2,1?
?

NO!

orphaned edge
2
1
2

3/19/12


8


Handshaking Lemma

sum of degrees is
twice # edges

2| E | = ∑ deg(v)
v∈ V
Proof:

Each edge contributes
2 to the sum on the right

3/19/12

9


Handshaking Lemma

sum of degrees is
twice # edges

2| E | = ∑ deg(v)
v∈ V
2+2+1 = odd,
so impossible
3/19/12


10


Sex in America: Men more Promiscuous?

Study claims:

Men average many more
partners than women.
Graph theory shows
this is nonsense

3/19/12

/>
/03/how-many-sex-partners-do-people-really-have/

11


Sex Partner Graph

M

F

partners
3/19/12


12


Counting pairs of partners

∑ deg(m) =E =∑ deg(f )

m∈M

f ∈F

divide by both sides by |M|

∑ deg(m)

m∈M

M

   
avg-deg(M)
3/19/12

=

F
M

∑ deg(f )


×

f ∈F

F

   
avg-deg(F)
13


Average number of partners

F
avg- deg(M) = 1.035 ×avg- deg(F)
M
Averages differ solely by
ratio of females to males.
No big difference
Nothing to do with promiscuity

3/19/12

14


Some Special Graphs




Complete graph Kn: A graph with n vertices including all possible
edges

K5:

3/19/12

15


Bipartite Graph



Graph in which vertices fall into two disjoint subsets and all
edges have one endpoint in each

3/19/12

16


Isomorphic Graphs



Graphs (V,E) and (V’,E’) such that there is a bijection f: V→V’ that
preserves edges: {v,w}∈E iff {f(v),f(w)}∈E’




Any two complete graphs of the same size are isomorphic

1

d

b

5

c
a
f
e
3/19/12

2
6
4

3

a

2

b

4


c

6

d

3

e

1

f

5
17


Finis

3/19/12

18



×