160 likes | 175 Views
Chap 7 Graph. Def 1: Simple graph G=(V,E) V : nonempty set of vertices E : set of unordered pairs of distinct elements of V called edges Def 2: Multigraph G=(V,E) loops are not allowed in simple or multi graphs
E N D
Chap 7 Graph Def 1: Simple graph G=(V,E) V : nonempty set of vertices E : set of unordered pairs of distinct elements of V called edges Def 2: Multigraph G=(V,E) loops are not allowed in simple or multi graphs Def 3: pseudograph (loops allowed )
Chap 7 Graph Def 4: directed graph E : ordered pairs of element of V Def 5:directed multigraph Table 1. Graph Terminology Examples
Chap 7 Graph Graph Terminology • Undirected graph Def 1: adjacent : u and v are adjacent if {u,v} is an edge ; this edge is incident with u and v; u and v are endpoints. Def 2:degree of v : number of edges incident with it ,except that a loop contributes twice to the degree. Example 1 Isolated vertex : degree 0
Chap 7 Graph Theorem 1: The handshaking theorem G=(V,E): an undirected graph with e edges 2 e = deg (v) Theorem 2: An undirected graph has an even numberof odd-degree vertices vV sd
Chap 7 Graph • Directed graph (u,v): u:initial vertex , v:end vertex Def 3:in-degree , deg-(v) : number of edges with v as end vertex out-degree , deg+(v) Theorem 3:G=(V,E) deg+ (v) = deg- (v) = |E| vV vV
Chap 7 Graph Complete graph : Kn , Example 4 Cycle : Cn ,n>= 3 , Example 5 Wheel : Wn ,n>= 3 , Example 6 n-cube :Qn , Example 7 Def 4: bipartite: its vertex set V canbe partitioned into two disjoint nonempty sets V1 and V2 such that every edge connects a vertex in V1 and a vertex V2 .
Chap 7 Graph Example 8 C6 : bipartite Example 9 K3 : not bipartite Example 11 : complete bipartite Def 5:subgraph H=(W,F) of a graph G =(V,E) , WV and F E . Example 14
Chap 7 Graph • Isomorphism of Graphs Def 1:G1 =(V1,E1) , G2 =(V2 , E2) are isomorphic if there is a one-to-one and onto function f from V1 to V2 such that a , b adjacent in G1 ,iff f(a) and f(b) are adjacent in G2 ,,for all a and b in V1 . Example 8 u1 u2 v1 v2 u3 u4 v3 v4 f(u1)= v1 , f(u2)= v4, f(u3)= v3, f(u4)= v2
Chap 7 Graph Example 9G and H are not isomorphic number of vertices , number of edges ,degrees of the vertices are invariants under isomorphism Example 10Are G and H isomorphic?
Chap 7 Graph • Connectivity Def 1: Path of length n from u to v ; circuit ; simple path / circuit Example 1 Def 2:An undirected graph is connected if there is a path between every pair of distinct vertices of the graph.
Chap 7 Graph Theorem 1 There is a simple path between every pair of distinct vertices of a connected undirected graph. • A graph that is not connected is the union of two or more connected subgraphs , each pair of which has no vertex in common. - connected components • Cut vertices • Cut edge Example 4
Chap 7 Graph Example 6 Are G and H isomorphic? H has a simple circuit of length 3 while G dosen’t - another invariant
Chap 7 Graph Example 7 Are G and H isomorphic? - satisfy all for invariants - f (u1)=v3 , f(u4)=v2, f(u3)=v1,f(u2)=v5.and f(u5)=v4
Chap 7 Graph • Euler and Hamilton Paths - Is there a simplecircuit in Figure 2 that contains every edge? Def 1 : An Euler circuit and an Euler path Example 1,2 Theorem 1 A connected multigraph has an Euler circuit if and only if each of its vertices has even degree .
Chap 7 Graph Theorem 2 A connected multigraph has an Euler paths but not an Euler circuit if and only if it has exactly two vertices of odd degree . Def .Hamilton path : A path X0,X1,…. X n-1, Xn in G=(V,E) is a Hamilton path if V={X0,X1,….X n-1,Xn } and Xi =Xj , for 0 <= i <j <=n. A circuit X0,X1,….X n-1,Xn,X0 is a Hamilton circuit if X0,X1,….X n-1,Xn is a Hamilton path . Figure 8,9 and Example 5
Chap 7 Graph • No known simple necessary and sufficient criteria for the existence of Hamilton circuits . - sufficient conditions - properties used to show that a graph has no H.C. Example 6 • Shortest path problem Example 1 Algorithm 1: Dijkstra’s algorithm Example 2