1.7k likes | 1.88k Views
Network Optimization. Chapter 1 Some Graph Theory Concepts and Trees. 1.1 Some graph theory concepts. Graphs and digraphs
E N D
Network Optimization Chapter 1 Some Graph Theory Concepts and Trees
1.1 Some graph theory concepts • Graphs and digraphs A graph G = (V,E) consists of a finite set V of vertices and a collection E of unordered pairs from V. Each pair in E is called anedge, denoted bye = {x,y}, x, y∈V. We say: x and y are adjacent, ande is incident to both x and y.
w v x y u G=(V,E) V={u,v,w,x,y}, E={{u,v},{u,x},{v,w},{v,y},{x,w},{w,y}}
x y x A loop is an edge (directed or undirected) which starts and ends on the same vertex. A simple graph is an undirected graph that has no loops and no more than one edge between any two different vertices. Any graph which is not simple is a multigraph. A graph G’=(U’,V’)is a subgraph of the graph G=(U,V) if every vertex of G’ is a vertex of G and every edge of G is an edge of G, i.e. U’U and V’ V Loop Multigraph
1.1 Some graph theory concepts A directed graph (or digraph) D=(V,A) consists of a finite set V of vertices and a collection A of ordered pairs from V, and each pair is called an arc, which is expressed as a = (x,y). We say : (i) a is an arc from vertex x to vertex y; (ii) a is incident from x; (iii) a is incident to y.
w v x y u w v G is the underlying graph of D. x y u 1.1 Some graph theory concepts D=(V,A), V={u,v,w,x, y}, A={(u,v),(u,x), (v,w), (v,y),(x,w),(w,y)} The underlying graph G of a digraph D is the graph obtained from D by replacing each arc (x,y) by an edge {x,y}.
1.1 Some graph theory concepts • If, in a digraph D, there is no loop and at most one arc from any vertex x to another vertex y , then D is a simple digraph. • If we associate one or more real numbers with each edge (or arc) of a graph (or a digraph), the resulting structure is called a network (or weighted graph).
e1 e2 e3 er-1 …… x1 x2 x3 x4 Xr-1 Xr 1.1 Some graph theory concepts • Connectivity Apath in a graph is a sequence of vertices such that between very two consecutive vertices there is an edge. A path with no repeated vertices is called a simple path,
1.1 Some graph theory concepts A simple cycle(Hamilton cycle) is a cycle in which the vertices are all distinct. In a simple graph, if a cycle has k vertices, it must visit k edges; if k is even, the cycle is called an even cycle, otherwise it is an odd cycle.
x6 x2 x2 x2 x7 x1 x1 x1 x4 x3 x4 x3 x4 x5 x3 x5 x6 1.1 Some graph theory concepts x2 =x5, < x1,x2,x3, x4, x5,x6,x1>is a cycle, but not a simple cycle. <x1,x2,x3,x4,x1> is an even cycle. x3 =x6, <x1,x2,x3,x4,x5,x6,x7 >is not a simple path.
1.1 Some graph theory concepts • Two vertices x and y are connected if there is a path between them. A graph is a connected graph if each pair of vertices in the graph is connected. • A connected subgraph H of the graph G is called a component of G, if vertices in H and vertices outside H are disconnected.
x5 x5 x2 x6 x2 x2 x5 x1 x1 x1 x3 x3 x4 x7 x4 x4 x3 G1 G2 G2 1.1 Some graph theory concepts G1 is a disconnected graph, and it has two components. G2 is a connected graph, each pair of vertices in G2 is connected.
x2 x6 x1 x3 x4 x5 G 1.1 Some graph theory concepts • An edge e in a connected graph G is called a bridge if its deletion yields a disconnected subgraph. G is connected, and it has three bridges: {x1,x2},{x2,x3},{x3,x6}.
a1 a2 ar-1 a3 …… x1 x2 x3 Xr 1.1 Some graph theory concepts • A directed path from vertex x1 to vertex xr in a digraph is a sequencex1, x2, …, xr, in which there is an arc from xi to xi+1 fori=1, …, r1. This path may be represented as x1→x2→…→xr.
x2 x1 x3 x4 D 1.1 Some graph theory concepts • Two vertices x and y in a digraph form a strongly connected pair if there is a directed path from x to y and a directed path from y to x . In D, x1andx4 form a strongly connected pair as there is a path x1→x2→x3→x4 and a path x4→x1.
x2 x2 x1 x1 x3 x4 x3 x4 1.1 Some graph theory concepts • A digraph is a strongly connected digraph if every pair of vertices is a strongly connected pair. A digraph is weakly connected if it is not strongly connected, but its underlying graph is connected. A strongly connected digraph A weakly connected digraph
x5 x5 x2 x2 x1 x1 x3 x4 x3 x4 G G 1.1 Some graph theory concepts • A simple path in a graph is called a Hamiltonian path if it passes through every vertex of the graph. A simple cycle is called a Hamiltonian cycle. In G, <x5,x1,x2,x3,x4>is a Hamiltonian path, <x1,x4,x3,x2,x5,x1>is a Hamiltonian cycle.
1.1 Some graph theory concepts • Bipartite graphs and complete graphs If the set V of vertices of a graph G = (V,E) is partitioned into two subsets X and Y such that every edge in E is between a vertex in X and a vertex in Y, then the graph is called a bipartite graph and is denoted by G = (X,Y;E).
1.1 Some graph theory concepts • A graph G = (V,E) is said to be complete if there is an edge between every pair of vertices. A bipartite graph G = (V,W;E) is complete if there is an edge between every vertex in V and every vertex in W.
X Y x2 X Y x1 x3 x4 G1 G2 G3 1.1 Some graph theory concepts G1 is a bipartite graph; G2 is a complete graph with four vertices, and is denoted by K4; G3 =(X,Y;E) is a complete bipartite graph with |X|=2 and |Y|=3, and is denoted by K2,3.
1.1 Some graph theory concepts • Theorem 1.1 A graph with three or more vertices is bipartite if and only if it has no odd cycles. • Proof :“” Let G=(X,Y;E) be a bipartite graph and C be a cycle in G. Obviously, C should have an even number of vertices which are alternatively in X and Y. Thus C must have an even number of edges, i.e., C is an even cycle.
1.1 Some graph theory concepts “” Suppose G=(V,E) has no odd cycle. Without loss of generality, assume G is connected. Let each edge have length 1, and denote by D(u,v) the length of the shortest path between vertices u and v, i.e., D(u,v) is the minimum number of edges needed to reach v from u.
1.1 Some graph theory concepts • Pick up an arbitrary vertex in G as u. Define X={x∈V: D(u,x) is even}, Y=VX. • In order to show that G=(V,E) is a bipartite graph, we only need to show that whenever vertices v and w are both in X (or in Y),there is no edge in E joining v and w.
1.1 Some graph theory concepts • Such v & w have only three cases: case 1 v ∈ X and w=u (v ≠ u) case 2 v, w ∈ X, (v ≠ u, w ≠ u) case 3 v, w ∈ Y. We can see easily that they are all impossible. • Hence each edge in E must be between one vertex in X and one vertex in Y. So G (V,E) = G (X,Y;E), i.e., G(V,E) is a bipartite graph.
1.1 Some graph theory concepts • Degrees, indegrees and outdegrees The number of edges incident to a vertex is the degree of the vertex. A vertex of G is odd if its degree is odd. A vertex of G is even if its degree is even. The degree of a vertex v in G=(V,E) is denoted by dG(v) (or d(v)). Then
1.1 Some graph theory concepts • In a digraph D=(V,A), the indegree of a vertex v is the number of arcs incident to v, denoted by d-(v); • The outdegree of a vertex v is the number of arcs incident from v, denoted by d+(v). • The degree of a vertex is the sum of its indegree and its outdegree.
1.1 Some graph theory concepts • Incidence matrices and totally unimodular matrices Suppose G=(V,E), where V={ x1,x2,x3,…,xm} and E={e1,e2,…,en}. The incidence matrix of the graph G is an mn matrix A =[aik], where each row corresponds to a vertex, and each column corresponds to an edge.
1.1 Some graph theory concepts • For a digraph D = (V,A), where V ={v1,…,vm} and A = {a1,…,an}, the incidence matrix is an mn matrix [aik] where
v1 v1 v2 v2 a2 e2 v4 v3 v4 v3 e5 a5 a1 e1 a3 e3 a4 e4 1.1 Some graph theory concepts • Examples:
1.1 Some graph theory concepts • A matrix A with integer entries is called a totally unimodular matrix (TU) if the determinant of every square submatrix B of A is either 0,1 or -1. • In fact, if A is a TU matrix and B is any nonsingular square submatrix of A, then the unique solution of the linear system Bx = C, where C is an integer vector, is xi = Pi / det (B) for all i. • As each Pi is an integer, x must be an integer vector.
1.1 Some graph theory concepts • Theorem 1.2 Suppose every element of matrix A=[aij] is 0, 1 or -1. If 1. No column of A can have more than two nonzero elements; and 2. We can partition the set I of rows of A into sets I1 and I2 such that if aij and akj are two nonzero elements in column j, then row i and row k belong to the same subset of the partition if and only if aij and akj are of opposite signs, (one of the I1 and I2 may be an empty set) , then A is a totally unimodular matrix.
1.1 Some graph theory concepts • Remark: condition 2 means that the two nonzero element in a column can be partitioned as follows: if they are in the same set, they must be 1 and -1; and if they are in the different sets, they must be either 1,1 or -1,-1.
1.1 Some graph theory concepts • Proof : Let C be any kk submatrix of A, we need to show that det C = 0,1 or -1. • We prove it by induction on k. If k=1, the theorem is obviously true. • Suppose it is true for k1. We have to prove it is true for k. There are three possibilities: (i) C has a zero column det C=0.
1.1 Some graph theory concepts (ii) C has a column with exactly one nonzero entry which could be either 1 or -1. We expand along this column : det C = det C , or = -det C where C is a (k-1)(k-1) submatrix, and hence we know that det C = 0, 1 or -1. i.e., det C = 0, 1 or -1.
1.1 Some graph theory concepts (iii) Every column of C has exactly two nonzero elements. Suppose E = {r1, r2,…, rk } is the set of the rows of C. By condition 2, these k rows can be partitioned into two subsets I1 and I2, sayI1 = { r1, r2,…, rp }, I2 = { rp+1,…, rk } with the above mentioned property. It is known from the Remark that r1+r2+…+rp = rp+1+…+rk .
1.1 Some graph theory concepts So, the rows of C are linearly dependent. det C = 0. The proof is thus completed. • Corollary 1.3a A matrix in which each element is 0 or 1 or -1 is totally unimodular if in each column there is at most one +1 and at most one -1.
1.1 Some graph theory concepts • The condition means that if there are two non-zero elements in a column, they must be 1 and -1.We may prove this corollary by applying Theorem 1.2 with I2 = Ø. • A special case of this corollary is that A is the incidence matrix of a digraph, i.e. the incidence matrix of any digraph must be a TU matrix.
1.1 Some graph theory concepts • Corollary 1.3bThe incidence matrix of any bipartite graph must be totally unimodular. • Proof: Let the bipartite graph be G=(X,Y;E) and its incidence matrix be A. We let the rows of A corresponding to the vertices in X be I1; and other rows be I2. It must satisfy the conditions of Theorem 1.2.
1.1 Some graph theory concepts • Theorem 1.4 In a graph G, the following properties are equivalent: • G is bipartite; • G has no odd cycle; • The incidence matrix A of G is TU.
1.1 Some graph theory concepts • Proof: So far we already know that (i) (ii) (Theorem 1.1),and (i) (iii) (Corollary 1.3b). • We only need to show that (iii) (ii), i.e., A is TU G has no odd cycle. We prove it by contradiction. • Suppose G has an odd cycle. Without loss of generality, assume that the cycle consists of the vertices v1,v2,…,v2k+1, and the edges {v1,v2},{v2,v3},…, {v2k,v2k+1},{v2k+1,v1}.
1.1 Some graph theory concepts • Let C be the (2k+1)(2k+1) submatrix of A corresponding to these vertices and columns:
1.1 Some graph theory concepts • Expanding by the first row, which is impossible (because A is TU). So, the theorem is proved. Question: in which step of the above proof, we used the condition ‘odd cycle’?
x2 x2 x7 x6 x6 x7 x1 x1 x4 x4 x5 x3 x9 x3 x5 x8 forest x10 tree x11 1.2 Spanning Trees • Forests and trees A graph which does not contain any cycle is called an acyclic graph or a forest. A connected acyclic graph is a tree.
Concepts used in the following proofs • There are two different paths from a to b there is a cycle • There is a cycle there are two vertices a and b, s.t. there are two path from a to b.
1.2 Spanning Trees • Theorem 1.5 A graph G is a tree if and only if there is a unique simple path between every pair of vertices in the graph. • Proof :“”If there is a unique path between every pair of vertices x and y, then G is connected and G contains no cycle. So G is a tree. • “”Suppose G is a tree. Then G is connected. There is a path between every pair of vertices x and y in the graph.
1.2 Spanning Trees Such path between x and y must be unique. If not, let P & P be two paths between them. Then we use the figures below to see that G must contain a cycle, which is impossible. { vi , vi+1 } is the first edge in P, but not in P.
1.2 Spanning Trees • Theorem 1.6 A graph G is a tree if and only if every edge is a bridge. • Proof: “” Suppose G is a tree.Consider any edge e = { x, y } in G. By Theorem 1.5, there is a unique path between x and y. So, e = { x, y } is the unique path between x and y. So, if we delete the edge e, there is no path between x and y, i.e., x and y will not be connected e is a bridge.
1.2 Spanning Trees • “” Suppose every edge in G is a bridge. It means G is connected. If G contains a cycle, and e = { x, y } is an edge of the cycle, then e cannot be a bridge (why?), a contradiction is caused. • So, G contains no cycle. G is a tree.
A concept used in the following proof • Any connected graph, |E| > |V| - 1.
1.2 Spanning Trees • Theorem 1.7 (i) A connected graph with n vertices is a tree if and only if it has n-1 edges. (ii) An acyclic graph with n vertices is a tree if and only if it has n-1 edges. • Proof(i) “” Suppose G is a tree. We prove by induction on n that G has n-1 edges. This is of course true when n=1.