• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
07 - Graphs
 

07 - Graphs

on

  • 680 views

I used this set of slides for the lecture on Graphs I gave at the University of Zurich for the 1st year students following the course of Formale Grundlagen der Informatik.

I used this set of slides for the lecture on Graphs I gave at the University of Zurich for the 1st year students following the course of Formale Grundlagen der Informatik.

Statistics

Views

Total Views
680
Views on SlideShare
680
Embed Views
0

Actions

Likes
0
Downloads
3
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

CC Attribution License

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    07 - Graphs 07 - Graphs Presentation Transcript

    • Graphs www.tudorgirba.com
    • G = (V, E)E = { {u,v} | u,v ∈ V} a e c d g b f
    • G = (V, E)E = { {u,v} | u,v ∈ V} a e c d g b fV = { a, b, c, d, e, f, g }E = { {a,b}, {a,c}, {b,c}, {c,d}, {d,e}, {d,f}, {e,g}, {f,g} }
    • G = (V, E)E = { {u,v} | u,v ∈ V} a e c d g b fV = { a, b, c, d, e, f, g }E = { {a,b}, {a,c}, {b,c}, {c,d}, {d,e}, {d,f}, {e,g}, {f,g} }
    • a b c d e f ga 0 1 1 0 0 0 0b 0 0 1 0 0 0 0 a ec 0 0 0 1 0 0 0 c d gd 0 0 0 0 1 1 0e 0 0 0 0 0 0 1 b ff 0 0 0 0 0 0 1g 0 0 0 0 0 0 0
    • a b c d e f ga 0 1 1 0 0 0 0b 1 0 1 0 0 0 0 a ec 1 1 0 1 0 0 0 c d gd 0 0 1 0 1 1 0e 0 0 0 1 0 0 1 b ff 0 0 0 1 0 0 1g 0 0 0 0 1 1 0
    • a b c d e f ga 0 1 1 0 0 0 0 2 2b 1 0 1 0 0 0 0 a ec 1 1 0 1 0 0 0 c d gd 0 0 1 0 1 1 0 3 3 2e 0 0 0 1 0 0 1 b ff 0 0 0 1 0 0 1 2g 0 0 0 0 1 1 0 2 2 3 3 2 2 2 Degree of a node
    • a b c d e f ga 0 2 3 0 0 0 0b 0 0 1 0 0 0 0 a e 3 5 3c 0 0 0 2 0 0 0 2 2 c d gd 0 0 0 0 5 4 0 1 4 3e 0 0 0 0 0 0 3 b ff 0 0 0 0 0 0 3g 0 0 0 0 0 0 0 Weighted graphs
    • Not complete Complete a a c c b b a a c c b b
    • G = (V, E)∀ e={v,w} ∈ E, v ∈ V and w ∈ W. Bipartite Not bipartite
    • Path Cycle a e c d g b fPath: (b, a, c); Length (b, a, c) = 2Path: (b, d, f)Cycle: (f, g, e, d, f); Length (f, g, e, d, f) = 4
    • Path Cycle a e c d g b fPath: (b, a, c); Length (b, a, c) = 2Path: (b, d, f)Cycle: (f, g, e, d, f); Length (f, g, e, d, f) = 4
    • Path Cycle a e c d g b fPath: (b, a, c); Length (b, a, c) = 2Path: (b, d, f)Cycle: (f, g, e, d, f); Length (f, g, e, d, f) = 4
    • Loop-free Loopa e a e c d g c d gb f b f
    • a e c d gb f
    • Eulerian patha e a e c d g c d gb f b f
    • Hamiltonian path Eulerian patha e a e c d g c d gb f b f
    • Spanning tree Components ea e d g c d g fb f a G = (V, E). T ⊆ E. c
    • a Critical node e c d gb Critical edge f
    • Biconnected componentsa e c d gb f
    • G = (V, E)G1 = (V1, E1)E1 = {{u,v}∈ E | u,v ∈ V1} ⊆ E. a eSubgraph c d g Not subgraph b f
    • Weakly reachable = exists undirected path a e c d g b fStrongly reachable = exists directed path
    • 9 F E 6 2 11 D 14 C 9 15 10 A 7 B ithm i jkstr a algor Exa mple: Dhttp://scg.unibe.ch/download/lectures/ei/01ComputationalThinking.pptx
    • 9 F E 6 2 11 D14 C 9 15 10 A 7 B ithm i jkstr a algor Exa mple: D
    • ∞ 9 F∞ E 6 2 ∞ ∞ 11 D 14 C 9 15 100 A 7 B ∞ ithm i jkstr a algor Exa mple: D
    • ∞ 9 F14 E 6 2 ∞ 9 11 D 14 C 9 15 100 A 7 B 7 ithm i jkstr a algor Exa mple: D
    • ∞ 9 F14 E 6 2 7 + 15 = 22 9 < 7 + 10 11 D 14 C 9 15 100 A 7 B 7 ithm i jkstr a algor Exa mple: D
    • ∞ 9 F14 > 9 + 2 E 6 2 22 > 9 + 11 9 11 D 14 C 9 15 10 0 A 7 B 7 ithm i jkstr a algor Exa mple: D
    • 20 9 F11 E 6 2 20 9 11 D 14 C 9 15 100 A 7 B 7 ithm i jkstr a algor Exa mple: D
    • 20 < 20 + 6 9 F11 E 6 2 20 9 11 D 14 C 9 15 100 A 7 B 7 ithm i jkstr a algor Exa mple: D
    • a b c d e f g a 0 2 3 0 0 0 0a e b 0 0 1 0 0 0 0 3 5 3 2 c 0 0 0 2 0 0 02 c d g d 0 0 0 0 5 4 0 1 4 3 e 0 0 0 0 0 0 3b f f 0 0 0 0 0 0 3 g 0 0 0 0 0 0 0 Warshall : Floyd Example
    • a b c d e f g a 0 2 3 0 0 0 0 a e b 0 0 1 0 0 0 0 3 5 3 2 c 0 0 0 2 0 0 02 c d g d 0 0 0 0 5 4 0 1 4 3 e 0 0 0 0 0 0 3 b f f 0 0 0 0 0 0 3 g 0 0 0 0 0 0 0procedure FloydWarshall () for k := 1 to n for i := 1 to n for j := 1 to n path[i][j] = min ( path[i][j], path[i][k]+path[k][j] ); Warshall : Floyd E xample
    • ing sa lesman l : TraveExample
    • Tudor Gîrba www.tudorgirba.comcreativecommons.org/licenses/by/3.0/