4.3 Paths in Relations and Digraphs
A path of a finite sequence is denoted: π 1 : 1, 2, 4 π 2: 2,4,3 π 1 : 1, 2, 4 π 2: 2,4,3 A path that begins and ends at the same vertex is called a cycle. 5, 1, 2, 5 1 2 3 5 4
R = {(a,a), (a,b),(b,c), (c,e), (c,d), (d,e)} A = {a,b,c,d,e} B = A R = {(a,a), (a,b),(b,c), (c,e), (c,d), (d,e)} Reachability Relation: R2 shows line connections of length 2. Vertex a has a relation path to vertex a of length 2. a R2a since a R a and a R a a R2 b since a R a and a R b a R2 c since a R b and b R c b R2 d since b R c and c R d c R2 e since c R d and d R e Notice e doesn’t have any out going arrows. R2 = {(a,a),(a,b),(a,c),(b.e),(b,d),(c,e)} b a d c e
The connectivity relation of R is denoted R (infinity symbol) , meaning all paths that are possible. Looking at all starting and ending points, based on the arrows (a,a), (a,b), (a,c), (a,d), (a,e), (b,c),(b,d),(b,e), (c,d),(c,e), (d,e)
The matrix of the relation squared: MR2 = MR MR The matrix of a line connecting verticies of length 2 in a relation is equal to the matrix of the relation times the matrix of the relation. Just multiply it itself.
Example: R = {(a,a),(a,b),(b,c),(c,e),(c,d),(d,e)} Row a of the first matrix times column a of the second matirx: (1 ∧ 1) ∨ (1 ∧ 0) ∨(0 ∧ 0) ∨ (0 ∧ 0) ∨ (0 ∧ 0) Result is shown in (a,a) If we have anywhere in our Comparison, 1 ∧ 1, we know our Result will be 1. Continue to multiply each row with = each column. R2 = {(a,a),(a,b),(a,c),(b,d),(b,e),(c,e)} a b c d e 1 a b c d e 1 a b c d e 1
The composition of π 1 and π 2 is written π 1 π 2 2 Paths π 1 : 1, 2, 3 π 2: 3,5,6,2,4 The composition of π 1 and π 2 is written π 1 π 2 π 1 π 2 = 1,2,3,5,6,2,4 From starting point 1 to ending point 4, is length 6 Notice you only write 3 once because 3 is the ending point of the first path and the starting point of the second path. 1 2 3 4 5 6