15.08.2013 Views

General Computer Science 320201 GenCS I & II Lecture ... - Kwarc

General Computer Science 320201 GenCS I & II Lecture ... - Kwarc

General Computer Science 320201 GenCS I & II Lecture ... - Kwarc

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

defined a directed graph to be a set of pairs over a base set (of nodes). These objects we have seen<br />

in the beginning of this course and called them relations. So directed graphs are special relations.<br />

We will now introduce some nomenclature based on this intuition.<br />

Directed Graphs<br />

Idea: Directed Graphs are nothing else than relations<br />

Definition 365 Let G = 〈V, E〉 be a directed graph, then we call a node v ∈ V<br />

initial, iff there is no w ∈ V such that 〈w, v〉 ∈ E. (no predecessor)<br />

terminal, iff there is no w ∈ V such that 〈v, w〉 ∈ E. (no successor)<br />

In a graph G, node v is also called a source (sink) of G, iff it is initial (terminal) in G.<br />

Example 366 The node 2 is initial, and the nodes 1 and 6 are terminal in<br />

1<br />

2<br />

3<br />

c○: Michael Kohlhase 217<br />

For mathematically defined objects it is always very important to know when two representations<br />

are equal. We have already seen this for sets, where {a, b} and {b, a, b} represent the same set:<br />

the set with the elements a and b. In the case of graphs, the condition is a little more involved:<br />

we have to find a bijection of nodes that respects the edges.<br />

Graph Isomorphisms<br />

Definition 367 A graph isomorphism between two graphs G = 〈V, E〉 and G ′ = 〈V ′ , E ′ 〉<br />

is a bijective function ψ : V → V ′ with<br />

directed graphs undirected graphs<br />

〈a, b〉 ∈ E ⇔ 〈ψ(a), ψ(b)〉 ∈ E ′ {a, b} ∈ E ⇔ {ψ(a), ψ(b)} ∈ E ′<br />

Definition 368 Two graphs G and G ′ are equivalent iff there is a graph-isomorphism ψ<br />

between G and G ′ .<br />

Example 369 G1 and G2 are equivalent as there exists a graph isomorphism ψ :=<br />

{a ↦→ 5, b ↦→ 6, c ↦→ 2, d ↦→ 4, e ↦→ 1, f ↦→ 3} between them.<br />

1<br />

2<br />

3<br />

5<br />

4<br />

6<br />

c○: Michael Kohlhase 218<br />

Note that we have only marked the circular nodes in the diagrams with the names of the elements<br />

118<br />

5<br />

4<br />

a<br />

b<br />

6<br />

c<br />

d<br />

e<br />

f

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!