CIT 596 Theory of Computtion 1 A grph G = (V (G), E(G)) onsists of two finite sets: V (G), the vertex set of the grph, often enote y just V, whih is nonempty set of elements lle verties, n E(G), the ege set of the grph, often enote y just E, whih is possily empty set of elements lle eges, suh tht eh ege e in E is ssigne n unorere pir (u, v) of verties, lle the en verties of e. Sometimes, it is onvenient to enote (u, v) y simply uv, or equivlently, vu.
CIT 596 Theory of Computtion 2 Consier the grph G = (V, E) suh tht V = {,,,, e} n E = {e 1, e 2, e 3, e 4, e 5, e 6, e 7, e 8 }, where e 1 (, ) e 2 (, ) e 3 (, ) e 4 (, ) e 5 (, ) e 6 (, e) e 7 (, e) e 8 (, e)
CIT 596 Theory of Computtion 3 A grph is often represente y igrm in whih verties re rwn s irles n eges s line or urve segments joining the irles representing the en verties of the ege. e 8 e 1 e e 7 e 2 e 5 e 6 e 3 e 4
CIT 596 Theory of Computtion 4 Verties re lso lle points, noes, or just ots. If e is n ege with en verties u n v then e is si to join u n v. Note tht the efinition of grph llows the possiility of the ege e hving ietil en verties, i.e., it is possile to hve vertex u joine to itself y n ege suh n ege is lle loop. If two (or more) eges hve the sme en verties then eges re lle prllel. A grph is lle simple is it hs no loops n no prllel eges.
CIT 596 Theory of Computtion 5 For n exmple of simple grph, onsier the grph G = (V, E) suh tht V = {,,, } n E = {e 1, e 2, e 3, e 4 }, where e 1 (, ) e 2 (, ) e 3 (, ) e 4 (, ) Some uthors use the term multigrph for grphs with loops n prllel eges, n reserve the term grph for simple grphs only. Sine we will el with grphs with loops very often, it is more onvenient not to mke this istintion.
CIT 596 Theory of Computtion 6 A pitoril representtion of the simple grph G in the previous slie: e 1 e 2 e 3 e 4
CIT 596 Theory of Computtion 7 The numer of verties in G is lle the orer of G. The numer of eges in G is lle the size of G. Two verties u n v of grph G re si to e jent if uv E(G). If uv E(G) then we sy tht u n v re non-jent verties. An ege e of grph G is si to e inient with or inient to the vertex v if v is n en vertex of e. In this se, we lso sy tht v is inient with or inient to e. Two eges e n f whih re inient with ommon vertex v re si to e jent.
CIT 596 Theory of Computtion 8 Let v e vertex of the grph G. The egree (v) of v is the numer of eges of G inient to v, ounting eh loop twie, i.e., it is the numer of times v is n en vertex of n ege. e For exmple, () = 1, () = 3, () = 3, () = 3, n (e) = 4 in the grph ove.
CIT 596 Theory of Computtion 9 The First Theorem of Grph Theory. For ny grph G with n e eges n n v verties v 1,..., v nv, we hve tht Chek y yourself: n v i=1 (v i ) = 2 n e. e
CIT 596 Theory of Computtion 10 A wlk in grph G is finite sequene W = v 0 e 1 v 1 e 2 v 2... v k 1 e k v k whose terms re lterntely verties n eges suh tht, for 1 i k, the ege e i hs en verties v i 1 n v i. We sy tht the ove wlk is v 0 v k wlk or wlk from v 0 to v k. The integer k, the numer of eges of the wlk, is lle the length of W. A trivil wlk is one ontining no eges.
CIT 596 Theory of Computtion 11 The sequene e 2 e 8 f e 6 e 3 e 4 e e 4 is wlk of length 6 in the grph elow. e 1 e 2 e 3 e 8 e 4 e 7 e 6 e 5 f e In simple grph, wlk is etermine y the sequene of verties only: f e.
CIT 596 Theory of Computtion 12 Given two verties u n v of grph G, u v wlk is lle lose or open epening on whether u = v or u v. If the eges e 1, e 2,..., e k of the wlk v 0 e 1 v 1 e 2 v 2... v k 1 e k v k re istint then W is lle tril. If the verties v 0, v 1,..., v k of the wlk v 0 e 1 v 1 e 2 v 2... v k 1 e k v k re istint then W is lle pth. For the grph in the previous slie, f e is f tril, ut not pth! The sequene f e is f e pth.
CIT 596 Theory of Computtion 13 A vertex u is si to e onnete to vertex v in grph G if there is pth in G from u to v. A grph G is onnete if every two verties of G re onnete; otherwise, G is isonnete. M N Connete Disonnete
CIT 596 Theory of Computtion 14 A nontrivil lose tril C = v 1 v 2... v n v 1 in grph G is lle yle if the verties v 2... v n re ll istint. A yle of length k, i.e., yle with k eges, is lle k-yle. For exmple, f is 3-yle in the grph elow: e 1 e 2 e 3 e 8 e 4 e 7 e 6 e 5 f e
CIT 596 Theory of Computtion 15 A grph G is si to e yli if it ontins no yles. A grph G is lle tree if it is onnete n yli. e The verties of egree (t most) 1 in tree re lle the leves of the tree.
CIT 596 Theory of Computtion 16 A irete grph (or simply igrph) D = (V (D), A(D)) onsists of two finite sets: V (D), the vertex set of the igrph, often enote y just V, whih is nonempty set of elements lle verties, n A(D), the r set of the igrph, often enote y just A, whih is possily empty set of elements lle rs, suh tht eh r in A is ssigne (orere) pir (u, v) of verties. If is n r in D with ssoite orere pir of verties (u, v), then is si to join u to v, u is lle the initil vertex of, n v is lle the terminl vertex of.
CIT 596 Theory of Computtion 17 For exmple, onsier the igrph D = (V (D), A(D)) suh tht V (D) = {,,,, e} n A(D) = {e 1, e 2, e 3, e 4, e 5, e 6 }, suh tht e 1 (, ), e 2 (, ), e 3 (, ), e 3 (, e), e 4 (e, ), n e 6 (e, e). e 6 e e 1 e 5 e 4 e 2 e 3
CIT 596 Theory of Computtion 18 Let D e igrph. Then irete wlk in D is finite sequene W = v 0 1 v 1... k v k, whose terms re lterntely verties n rs suh tht for 1 i k, the initil vertex of the r i is v i 1 n its terminl vertex is v i. The numer k of rs is the length of W. The wlk W given in the efinition ove is si to e v 0 v k irete wlk or irete wlk from v 0 to v k. There re similr efinitions for irete trils, irete pths, n irete yles.
CIT 596 Theory of Computtion 19 For exmple, onsier the igrph D elow: e 6 e e 1 e 5 e 4 e 2 e 3 The sequene e 1 e 3 e 4 e is e irete wlk, e irete tril, n e irete pth in D.
CIT 596 Theory of Computtion 20 A vertex v of the igrph D is si to e rehle from vertex u if there is irete pth from u to v. Given ny igrph D = (V (D), A(D)), we n otin grph G = (V (G), E(G)) from D s follows: Let V (G) = V (D) n E(G) = {e (, ) (, ) A(D)}. The grph G is the unerlying grph of D. A igrph D is si to e wekly onnete (or simply onnete) if its unerlying grph is onnete. A igrph D is si to e strongly onnete (or ionnete) if for ny pir of verties u n v in D there is irete pth from u to v.
CIT 596 Theory of Computtion 21 e 6 e 6 e e e 1 e 5 e 4 e 5 e 1 e 4 e 2 e 2 e 3 e 3 A igrph Its unerlying grph Is the ove irete grph onnete? If so, is it strongly onnete?
CIT 596 Theory of Computtion 22 Let v e vertex in igrph D. The inegree i(v) of v is the numer of rs of D tht hve v s the terminl vertex, i.e., the numer of rs tht go to to v. Similrly, the outegree o(v) of v is the numer of rs of D tht hve v s the initil vertex, i.e., the numer of rs tht go out of v. The First Theorem of Digrph Theory. Let D e igrph with n verties n q rs. If v 1,..., v n is the set of verties of D, then we hve tht n i=1 i(v i ) = n i=1 Cn you figure out the proof for this one? o(v i ) = q.