1. Trang chủ
  2. » Giáo án - Bài giảng

Discrrete mathematics for computer science digraphs

18 92 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 18
Dung lượng 222,5 KB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

Lemma: The shortest walk between two vertices is a path!. Proof: by contradiction suppose path from u to v crossed itself: c Walks & Paths... Proof: by contradiction suppose path from u

Trang 1

Directed Graphs

Trang 2

Normal Person’s Graph

y

y = f(x)

Trang 3

Computer Scientist’s Graph

a

f

e

c

d

b

Trang 4

• a set, V, of vertices

aka “nodes”

• a set, EV×V

of directed edges

(v,w) ∈ E

notation: v→w

Trang 5

Relations and Graphs

a

c

b

d

V= {a,b,c,d}

E = {(a,b), (a,c), (c,b)}

Trang 6

Formally, a digraph with vertices

V is the same as a binary relation

on V

Digraphs

Trang 7

Walks & Paths

Walk : follow successive edges

length: 5 edges

( not the 6 vertices )

Trang 8

Walks & Paths

Path : walk thru vertices without repeat vertex

length: 4 edges

Trang 9

Lemma:

The shortest walk between two vertices is a path!

Proof: (by contradiction) suppose

path from u to v crossed itself:

c Walks & Paths

Trang 10

Proof: (by contradiction) suppose path from u to v

crossed itself:

then path without c -c is

shorter !

Lemma:

The shortest walk between two vertices is a path!

Walks & Paths

Trang 11

Walks & Paths

Digraph G defines walk

relation G+

u G+ v iff ∃walk u to v

(the positive walk relation)

“+” means 1 or more

Trang 12

Walks & Paths

Digraph G defines walk

relation G*

u G* v iff u to v∃ walk

1 2 3

Trang 13

A cycle is a walk whose

only repeat vertex is its

start & end

(a single vertex is a

length 0 cycle)

Trang 14

v0

v0

vi

vi+1

Cycles

Trang 15

Closed walk starts & ends at the

same vertex.

Lemma: The shortest positive

length closed walk containing a

vertex is a positive length cycle!

Proof: similar

Closed Walks & Cycles

Trang 16

has no positive length cycle

D irected A cyclic G raph

DAG

Trang 17

< relation on integers

⊊ relation on sets

prerequisite on classes

D irected A cyclic G raph

DAG

Trang 18

Example: Tournament Graph

• Every team plays every other

H

Ngày đăng: 22/03/2019, 11:32