• Keine Ergebnisse gefunden

1.2 Contributions

2.1.1 Basic Notions

The core notion of all the upcoming models is that of a directed graph,

G= (V, E), (2.1)

which is a pair of a nite set of nodes V (sometimes also called vertices) and a directed edge relationE⊆V×V. The elements ofE, called edges, are ordered pairs of nodes. The rst component of an edge e= (v, w) is the source node ofe, denotedsource(e) =v, while the second component, here w, is the target node of e, denoted target(e) =w. We dene nodes(e)to represent the set of nodes of an edgee, i. e.,nodes(e) :={source(e),target(e)}.

q r s

t u v

Figure 2.1: A Directed (Unlabeled) Graph

Instead of(v, w)∈E we often use the inx notationv E w. Ifv E w,w is a successor of v in G while v is called a predecessor of w in G. The set of all successor nodes of v ∈V (inG) is dened byvE:={w∈V |(v, w)∈E}. Likewise, the set of all predecessor nodes ofv∈V (inG) is denoted by Ev:={u∈V |(u, v)∈E}.

Example 2.1 Consider the graphG2.1 = (V, E)with V = {q, r, s, t, u, v} and

E = {(q, r),(r, q),(r, s),(r, t),(r, u),(s, u),(t, u),(u, v)}.

A possible graphical notation of G2.1 is depicted in Figure 2.1. The nodes of G2.1 are drawn as black dots with their associated identities written next to them. In graphical representations, we represent edges as directed arrows between the nodes associated with the edge. The successor nodes of r are q, s, t, u, making up the elements of the set rE. Note thatvE=∅ sincev has no outgoing edges. Likewise, the predecessor nodes of uare

collected inEu={r, s, t}.

Let G = (V, E) be a directed graph. A path in G is a non-empty sequence of nodes π = v0v1v2. . . vk ∈V+, such that vi−1 E vi or vi E vi−1 (0 < i ≤k). Note that a path is undirected, i. e., the direction of the path components does not matter. The rst node of pathπ is denoted byfirst(π) =v0. The last node of pathπ is denoted bylast(π) =vk. We denote the set of all paths of G by Paths(G). The length of path π, denoted |π|, is dened as the number of edges it traverses, i. e., for π = v0v1. . . vk, |π| = k. A path π = v0v1. . . vk ∈ V+ is called a directed path in G i vi−1 E vi (0 < i ≤k). The set of all directed paths ofGis denoted bydiPaths(G). Let v, w∈V be two nodes of a directed graphG= (V, E). A (directed) path π ∈Paths(G) (π ∈diPaths(G), resp.) is a (directed) path betweenv andw iv =first(π) andw=last(π). Ifπ is a path between v andw, we say thatwis reachable from v (viaπ). Thus, if wis reachable fromv, then vis reachable fromw. The set of all reachable nodes from v inGis denoted by RG(v). The graphGis connected iRG(v) =V (v∈V).

Example 2.2 Reconsidering our graphG2.1 from Example 2.1, there are several paths to observe, e. g.,π1 =q r u v is a directed path from q to v. Furthermore, π2 =v u t r q is a path fromv to q, this time an undirected one. From any node butr and q, there are only undirected paths to nodesr and q. There is at least one directed path to nodev from any

other node.

A node r ∈ V of a directed graph G = (V, E) is called a root node of G i there is a directed path to any other node in the graph, i. e.,

∀v ∈V \ {r}:∃π∈diPaths(G) :|π|>0∧first(π) =r∧last(π) =v.

q r s

t u v

Figure 2.2: A Directed Tree

Thus, every node v∈V \ {r} is reachable from r, even by a directed path. G is called a rooted directed graph i it has a root node r ∈V. If a root noder has been chosen, G is sometimes denoted as a triple (V, E, r). While rooted graphs allow for undirected cycles, trees do not. A rooted graph is a tree i

∀v∈V \ {r}:|{π ∈diPaths(G)|first(π) =r∧last(π) =v}|= 1,

i. e., the directed path from root r to a nodev∈V is unique. IfG is a tree or has a root node, it is a connected graph.

Example 2.3 Regarding our running example, only nodes q and r qualify as root nodes of G2.1. In order to obtain a tree from G2.1 we could remove the edges (r, q), (r, u), and (s, u). These removals result in the tree G2.2, depicted in Figure 2.2, with root node q. Note thatris no root node anymore because there is no directed path fromrtoq inG2.2.

Distinct graphs may relate to one another. In the rest of this section, we discuss two types of structural graph comparisons. Let G = (VG, EG) and H = (VH, EH) be two directed graphs. G is a subgraph ofH, denotedG⊆H, iVG⊆VH andEG⊆EH. The subgraph relationship depends on the identity of nodes, in that every node ofGmust also be a node ofH (edges accordingly). Identity-independent, i. e., purely structural, subgraph relations may be found in the notions of homomorphisms for graphs. Instead of ⊆, functions relate the nodes of G with those of H. A graph homomorphism between G and H is an edge-preserving function η : VG → VH, i. e., if v EG w, then η(v) EH η(w). For a graph homomorphism η between Gand H,η(G) denes a subgraph ofH by

η(G) := ({η(v)|v∈VG},{(η(v), η(w))|(v, w)∈EG}), (2.2) theη-induced subgraph ofH. An injective graph homomorphism is a subgraph isomorphism.

A bijective graph homomorphism is called a graph isomorphism. Graph homomorphisms relate graphs with similar or even identical structures. While plain homomorphisms allow for mapping several nodes of Gto one node of H, (subgraph) isomorphisms are injective, i. e., every two distinct nodes ofGare mapped to distinct nodes ofH. Graph isomorphisms provide the formal device for proving that the same graphical representation identies two formally dierent graphs.

Example 2.4 The subgraph relationship is the most discriminating, compared to the other morphism-based graph relations, because nodes and edges must be identical. We exemplify four dierent graph structures in Figure 2.3, which we subsequently refer to by G(a), G(b), G(c), and G(d). It certainly holds that G(a) ⊆ G2.1. However, G(b) is not a subgraph of G2.1, although it shows high structural similarity to G(a). Function η(a)7→(b) (y7→r, x7→s, w7→u) witnesses this similarity in terms of a graph homomorphism between G(b) and G(a). In fact, η(a)7→(b) qualies as a graph isomorphism between G(b) and G(a).

r s

u (a)

w x

y (b)

r q

(c)

z (d) Figure 2.3: Related (Sub-)Graphs

Hence, it is also a subgraph isomorphism between G(b) and G2.1. The subgraph G(a) is not the only subgraph ofG2.1,G(b) is isomorphic to. Function ι(w7→u, x7→t, y7→r) is another subgraph isomorphism betweenG(b) and G2.1.

Consider now the graphs G(c) and G(d), which are neither isomorphic nor subgraph isomorphic to one another. They can, however, be related by graph homomorphismη(c)7→(d) (r 7→ z, q 7→ z). Thus, graph cycles can be reduced to simple loops via homomorphisms.

Furthermore, it can be shown that every directed graphGis homomorphic to graph G(d). The necessary graph homomorphism maps every node ofG to z.

So far, directed graphs allow us to model relationships of a single type because, beyond node identities, there is nothing that distinguishes an edge from another one. In order to permit the expression of several relationship types, usually labeled graphs are considered as more exible data structures.