GRAPH ALGORITHMS Week 3 (16-21 October 2017)

Size: px
Start display at page:

Download "GRAPH ALGORITHMS Week 3 (16-21 October 2017)"

Transcription

1 GRAPH ALGORITHMS Week 3 (16-21 October 2017) C. Croitoru croitoru@info.uaic.ro FII October 15, / 63

2 OUTLINE Graph Theory Vocabulary 1 Definition of a Graph 2 Variations in the Definition of a Graph 3 Degrees 4 Subgraphs 5 Graph Operations 6 Graph Classes 7 Paths and Circuits 8 Associated Matrices 9 Data Structures Path Problems in (Di)Graphs 1 (Di)Graph Traversal 2 Shortest Paths Problems 3 Connectivity Exercises for the next week Seminar (23-28 October 2017) 2 / 63

3 Vocabulary 7. Path and Circuits G = (V, E) graph Walk of length r from v to w in G: any sequence of vertices and edges of the form (v =)v 0, v 0 v 1, v 1,..., v r 1, v r 1 v r, v r (= w). v and w are the extremities of the walk. Trail: a walk with distinct edges. Path: a walk with distinct vertices. Remark. A vertex is walk (trail, path) of length 0. 3 / 63

4 Vocabulary 7. Path and Circuits G = (V, E) graph Walk of length r from v to w in G: any sequence of vertices and edges of the form (v =)v 0, v 0 v 1, v 1,..., v r 1, v r 1 v r, v r (= w). v and w are the extremities of the walk. Trail: a walk with distinct edges. Path: a walk with distinct vertices. Remark. A vertex is walk (trail, path) of length 0. Example mers M: 4 parcurs 1 T: drum P: / 63

5 Vocabulary 7. Path and Circuits G = (V, E) graph Closed walk: a walk from v to v. Circuit (Cycle, Closed path): a walk with distinct vertices except their extremities which are equal. A circuit is even or odd depending on the parity of its length. The length of the shortest circuit (if any) is the girth, g(g), of G. The maximum length of a circuit is the circumference, c(g), of G. 5 / 63

6 Vocabulary 7. Path and Circuits G = (V, E) graph Closed walk: a walk from v to v. Circuit (Cycle, Closed path): a walk with distinct vertices except their extremities which are equal. A circuit is even or odd depending on the parity of its length. The length of the shortest circuit (if any) is the girth, g(g), of G. The maximum length of a circuit is the circumference, c(g), of G. Example circuite impare : circuit par : / 63

7 Vocabulary 7. Path and Circuits G = (V, E) graph Distance in G from v to w, d G (v, w): the length of the shortest path in G from v to w. Diameter of the graph G, d(g): d(g) = max{d G (v, w) v, w V (G)}. d(g)=3 d(g)=4 7 / 63

8 Vocabulary 7. Path and Circuits G = (V, E) graph Distance in G from v to w, d G (v, w): the length of the shortest path in G from v to w. Diameter of the graph G, d(g): d(g) = max{d G (v, w) v, w V (G)}. d(g)=3 d(g)=4 D = (V, E) digraph All the above definitions are preserved by considering directed edges (arcs) instead of edges. 8 / 63

9 Vocabulary 7. Path and Circuits G = (V, E) graph Connected graph: there is a path between every pair of vertices. Otherwise, the graph is disconnected. Connected component of a graph G: a maximal connected subgraph H of G (there is no connected subgraph H of G, H H, and H is a subgraph of H ). Every graph can be expressed as a disjoint union of its connected components. If ρ V V, given by (v, w) ρ if and only if there is a path in G from v to w, then ρ is an equivalence relation, and the connected components of G are the subgraphs induced by the equivalence classes of ρ. Example. 4 connected components 9 / 63

10 Vocabulary 7. Path and Circuits D = (V, E) digraph Connected digraph (weakly connected): its support graph G(D) is connected. Unilaterally connected digraph: there is a path from v to w or from w to v, for any two vertices v and w. Strongly connected digraph: there is a path from v to w, for any two vertices v and w. Unilateral conex Tare conex Conex 10 / 63

11 Vocabulary 7. Path and Circuits A Tree is a connected graph without circuits. A graph whose connected components are trees is a forest. Cut vertex: a vertex v, in the connected graph G, such that G v is not connected. Vertex cutset: a set S V (G), in the connected graph G, such that G S is not connected. Pct. de articulatie Fara pcte. de articulatie Multime de articulatie Fara multimi de articulatie 11 / 63

12 Vocabulary 7. Path and Circuits G = (V, E) graph For p Z >0, G is a p-connected graph if V (G) = p and G = K p or V (G) p + 1 and G has no vertex cutset of cardinality less than p. Clearly, G is 1-connected if and only if it is connected. The vertex-connectivity number, k(g), of the graph G is k(g) = max{p Z >0 G is p-connected}. k(g)=3 k(g)=4 12 / 63

13 Vocabulary 7. Path and Circuits G = (V, E) graph Cut edge: an edge e, in the connected graph G, such that G e is not connected. Edge-cutset: a set S E(G), in the connected graph G, such that G S is not connected. For p Z >0, G is a p-edge-connected graph if G has no edge-cutset of cardinality less than p. The edge-connectivity number, λ(g), of G: λ(g) = max{p Z >0 G is p-edge-connected}. Punte Multime separatoare de muchii lambda(g)=3 13 / 63

14 Vocabulary 7. Path and Circuits G (di)graph is Eulerian if there is a closed trail in G passing through each edge of G. Hamiltonian if there is a circuit in G passing through each vertex of G. Polynomial time recognition of Eulerian (di)graphs (Euler, 1736). 14 / 63

15 Vocabulary 7. Path and Circuits G (di)graph is Eulerian if there is a closed trail in G passing through each edge of G. Hamiltonian if there is a circuit in G passing through each vertex of G. Polynomial time recognition of Eulerian (di)graphs (Euler, 1736). Examples Graf Eulerian Graf care nu-i hamiltonian Graf hamiltonian 15 / 63

16 Vocabulary 7. Path and Circuits Hamiltonian problems HAM Instance: G a graph. Question: Is G hamiltonian? NP-complete (Karp, 1972). NH Instance: G a graph. Question: Is it true that G is not hamiltonian? NH NP? 16 / 63

17 Vocabulary 7. Path and Circuits Hamiltonian problems HAM Instance: G a graph. Question: Is G hamiltonian? NP-complete (Karp, 1972). NH Instance: G a graph. Question: Is it true that G is not hamiltonian? NH NP? Non-hamiltonian graph: 3-conex, planar, si nehamiltonian (Tutte) 17 / 63

18 Vocabulary 8. Associated Matrices Adjacency Matrix Let G = ({v 1,..., v n }, {e 1,..., e m }) be a graph with a fixed ordering of vertex/edge set. The adjacency matrix of G is the matrix A = (a ij ) n n, where { 1 if v i and v j are adjacent a ij = 0 otherwise. 18 / 63

19 Vocabulary 8. Associated Matrices Adjacency Matrix Let G = ({v 1,..., v n }, {e 1,..., e m }) be a graph with a fixed ordering of vertex/edge set. The adjacency matrix of G is the matrix A = (a ij ) n n, where { 1 if v i and v j are adjacent a ij = 0 otherwise. Example. A graph and its adjacency matrix A = / 63

20 Vocabulary 8. Associated Matrices Incidency Matrix Let G = ({v 1,..., v n }, {e 1,..., e m }) be a graph with a fixed ordering of vertex/edge set. The incidency matrix of G is the matrix B = (b ij ) n m, where { 1 if e j is incident with v i and e j b ij = 0 otherwise. 20 / 63

21 Vocabulary 8. Associated Matrices Incidency Matrix Let G = ({v 1,..., v n }, {e 1,..., e m }) be a graph with a fixed ordering of vertex/edge set. The incidency matrix of G is the matrix B = (b ij ) n m, where { 1 if e j is incident with v i and e j b ij = 0 otherwise. Example. A graph and its incidency matrix B = / 63

22 Vocabulary 8. Associated Matrices Digraphs For digraphs, similar matrices can be defined with entries in { 1, 0, 1} in order to point out the direction of edges. 22 / 63

23 Vocabulary 8. Associated Matrices Digraphs For digraphs, similar matrices can be defined with entries in { 1, 0, 1} in order to point out the direction of edges. Spectral theory The eigenvalues, eigenvectors and the characteristic polynomial of the adjacency matrix are called eigenvalues, eigenvectors, respectively characteristic polynomial of the graph. 23 / 63

24 Vocabulary 9. Data Structures Adjacency matrix Let G = (V, E) be a (di)graph with V = {1, 2,..., n} and E = e. If A = (a ij ) n n is the adjacency matrix of G then, representing it as a 2-dimensional array, we need O(n 2 ) time for initialization. Hence any algorithm that represents G with the adjacency matrix has Ω(n 2 ) time (and space) complexity. Testing if two vertices are adjacent is done in O(1) time, but passing through the set of neighbors N G (v) (or N + G (v)), for an arbitrary vertex v V, needs Ω(n) time unpractical in large sparse (di)graphs. 24 / 63

25 Vocabulary 9. Data Structures Adjacency List Let G = (V, E) be a (di)graph with V = {1, 2,..., n} and E = e. Every vertex v V has a list A(v) of its neighbors in G. If G is a graph then A(v) contains N G (v) = {w w V and vw E} and if G is a digraph then A(v) contains N + G (v) = {w w V and vw E}. If G is a graph then each edge vw E generates 2 nodes in the adjacency lists (one in A(v) and the other in A(w)): the space needed is O(n + 2e). If G is a digraph then the space needed is O(n + e). Adjacency lists can be implemented using linked lists or using arrays. Testing if a vertex v is adjacent to another vertex w in G needs Ω(d G (v)) time, but passing through the set of neighbors N G (v) (or N + G (v)), for an arbitrary vertex v V, can be done in Ω(d G (v)) time (and not in O(n) time as in the case of adjacency matrix). 25 / 63

26 Vocabulary 9. Data Structures Adjacency List Example. Adjacency list representation of the digraph below. 1 A(1) A(2) A(3) 6 A(5) A(6) 26 / 63

27 PATH PROBLEMS IN (DI)GRAPHS 27 / 63

28 Path Problems Graph traversal Graph traversal Graph traversal or graph search is an algorithmic paradigm specifying a systematic method to pass through the set of vertices reachable by paths starting from a specified vertex in a (di)graph. Given a (di)graph G = ({1,..., n}, E) and s V (G), generate efficiently the set S = {v v V (G) and there is a path from s to v}. G is represented with adjacency lists, because, during the visiting process, we need to handle in a efficient way the set of neighbors of the current vertex. 28 / 63

29 Path Problems Graph traversal BFS Breadth-First Search G = ({1,..., n} ( d i ) graph, s {1,..., n} Each vertex v has an integer label label(v) < 0 label(s) 0 ; parent(s) 0 ; create queue Q containing s ; while Q do { let v be the top vertex in the queue Q ; delete the top vertex in Q ; for w A(v) do if label(w) < 0 then { label(w) label(v) + 1 ; parent(w) v ; insert w into the queue Q } } 29 / 63

30 Path Problems Graph traversal BFS Breadth-First Search Properties. It is not difficult to prove that: S = {v V label(v) 0}. v V label(v) = d G (s, v) (distance in G from s to v); Variable parent defines the bfs-tree associated to the search from s: if G is a graph then the bfs-tree is a spanning tree of the connected component containing s; if G is a digraph then the bfs-tree is an arborescence (directed rooted tree in which all edges point away from the root s). The time complexity of BFS(s) is O(n S + m S ), where n S = S V = n, and m S = E([S] G ) E (this follows easily by observing that each node in the adjacency list of a vertex from S is accessed exactly once). 30 / 63

31 Path Problems Graph traversal BFS Breadth-First Search Example: 1 A(1) A(2) A(3) 6 A(5) A(6) 31 / 63

32 Path Problems Graph traversal DFS Depth-First Search G = ({1,..., n} ( d i ) graph, s {1,..., n} Each vertex v has an integer label label(v) < 0 Each adjacency list A(v) will be traversed using an iterator next[a(v)] label(s) 0 ; parent(s) 0 ; create stack S containing s ; n S 0 ; while S do { let v be the top vertex in the stack S ; w next[a(v)] ; if w exists then if label(w) < 0 then { label(w) n S ; n S ++ ; parent(w) v ; insert w into the stack S } else NOP can be used!! else delete v from (the top of) S the search from v is finished } 32 / 63

33 Path Problems Graph traversal DFS Depth-First Search Properties. It is not difficult to prove that: {v V label(v) 0} is exactly the set S of the vertices reachable by paths from s in G. v V label(v) = visiting time of v (s has visiting time 0); Variable parent defines the dfs-tree associated to the search from s. The time complexity of DFS(s) is O(n S + m S ), where n S = S V = n, and m S = E([S] G ) E (this follows easily by observing that each node in the adjacency list of a vertex from S is accessed exactly once). 33 / 63

34 Path Problems Graph traversal DFS Depth-First Search Example: 1 A(1) A(2) A(3) 6 A(5) A(6) 34 / 63

35 Path Problems Shortest Paths Notations Let G = (V, E) be a digraph, with V = {1,..., n}. Each directed edge e E has associated a cost a(e) R (weight, length,...). If G is represented with adjacency lists, then a(ij) is a field in the node of adjacency list of i (reprenting ij). For ease of notation we will use the representation of G with the cost-adjacency matrix A = (a ij ) n n, { a(ij) if ij E a ij = otherwise Here, denotes a big real number with respect to actual edge costs (e.g., > n max ij E a(ij)) and we suppose that a =, + =. (It is also possible to use as an unsuccessful access to the data structure used to represent the matix A). 35 / 63

36 Path Problems Shortest Paths Notations For i, j V, the set of all paths in G from i to j is denoted by P ij : P ij = {P ij P ij path in G from i to j}. If P ij P ij, P ij : (i =)v 0, v 0 v 1, v 1,..., v r 1, v r 1 v r, v r (= j), its set of vertices is V (P ij ) = {v 0, v 1,..., v r } and its set of arcs (directed edges) is E(P ij ) = {v 0 v 1, v 1 v 2,..., v r 1 v r }. Any vertex k V (P ij ), k i, j, splits P ij in two paths P ik P ik and P kj P kj. We denote P ij = P ik P kj. The cost of a path P ij P ij is a(p ij ) = 0 + In particular, we have a(p ii ) = 0. uv E(P ij ) a uv. 36 / 63

37 Path Problems Shortest Paths Main Shortest Path Problems Single-pair shortest path problem. P1: Given G digraph; a : E(G) R; s, t V (G), s t. Find P st P st, such that a(p st) = min{a(p st ) P st P st }. Single-source shortest path problem. P2: Given G digraph; a : E(G) R; s V (G). Find P si P si, i V (G), such that a(p si ) = min{a(p si) P si P si }. All-pairs shortest path problem. P3: Given G digraph; a : E(G) R. Find P ij P ij i, j V (G), such that a(p ij ) = min{a(p ij) P ij P ij }. 37 / 63

38 Path Problems Shortest Paths Main Shortest Path Problems Remarks. 1 The cost-adjacency matrix representation of the pair G, a implies that P ij i, j V : if a(p ij ) < then P ij is a true path in G and if a(p ij ) = then P ij is not a path in G but it is a path in the complete symmetric digraph obtained from G by adding all missing arcs (with costs). It follows that all sets over which a minimum cost element is required in the problems P1-P3 are non-empty and finite and all minimum paths required are well-defined. 2 The algorithms for solving the problem P1 are obtained from those solving the problem P2 by adding an (obvious) stopping test. 3 The problem P3 can be solved by iterating any algorithm for the problem P2. We ll see that there are more efficient solutions. 38 / 63

39 Path Problems Shortest Paths Applications 1. Communication Networks. The digraph G = (V, E) represents a communication network between the nodes in V and with E modeling the set of directed links between nodes. If a(e) 0 (for all e E) represents the length of the direct connection between the extremities of e, then the problems P1-P3 are natural shortest paths problems. If a(e) 0 (for all e E) represents the time needed for the direct connection between the extremities of e, then the problems P1-P3 are natural fastest paths problems. If a(e) (0, 1] (for all e E) represents the probability that the direct connection between the extremities of e works properly, and we suppose that edges works properly independent of each other, then the problems P1-P3 become most reliable paths problems: 39 / 63

40 Path Problems Shortest Paths Applications If P ij P ij for some pair i, j V, then the probability that this path works properly is (by the independence assumption) Prob(P ij ) = By taking a (e) := log(a(e)), log(prob(p ij )) = log( e E(P ij ) e E(P ij ) a(e). a(e)) = e E(P ij ) a (e). By the monotony of the log function it follows that the problems P1-P3, with costs a, give the most reliable paths in the communication network. 40 / 63

41 Path Problems Shortest Paths Applications 2. PERT Networks Critical Path Method (CPM). PERT (Project Evaluation and Review Technique) is a method to analyze (especially) the completion time of each task in a given complex project. Let P = {A 1,..., A n } be the set of atomic activities of a large project P (n is big). (P, <) is a partially ordered set, where A i < A j if i j and activity A j can be started only after the activity A i was finished. For each activity A i, its completion time t i is given (estimated). Find a scheduling of the activities of the project to minimize its total completion (calendar) time. We can associate a directed acyclic graph to the problem in this way: to each activity A p (p {1,..., n} we add an arc i p j p with cost a(i p j p ) = t p. The node i p corresponds to the beginning event of A p and the node j p is associated to the finishing event of it. If an activity A k can start immediately after the activity A p we add the arc j p i k (dummy activity). 41 / 63

42 Path Problems Shortest Paths Applications The construction of digraph is finished after adding a node s corresponding to the start event of the project linked by arcs si p for each activity A p with no incoming arcs, and a node t corresponding to the terminal event of the project linked by arcs j p t for each activity A p with no outgoing arcs. In the digraph obtained, the maximum cost of a path from s to t is equal to the minimum completion time of the project. A maximum cost path is called a critical path since any delay of an activity on this path infers a delay of the whole project. Start A1: t1 A2: t2 A3: t3 0 A4: t A5: t5 A6: t6 A7: t A8: t8 A9: t9 0 0 A10:t10 0 End 0 42 / 63

43 Path Problems Shortest Paths Applications Knapsack Problem (0-1) We are given a knapsack of size b Z +, and n objects of sizes a 1,..., a n Z +. Also is known the profit p i Z + of inserting the object i (i {1,..., n} into the knapsack. We are asked to choose a filling of the knapsack of maximum total profit. Let x i {0, 1}, for i {1,..., n}, be a boolean variable having the meaning that x i = 1 if and only if the object i is inserted into the knapsack. Then the knapsack problem can be stated as max { n p i x i i=1 n a i x i b, x i {0, 1} i = 1, n }. i=1 Let G = (V, E) the digraph with V = {s} V 1 V 2... V n {t}, where the set V i = {i 0, i 1,..., i b } is associated to object i, i = 1, n. 43 / 63

44 Path Problems Shortest Paths Applications The arcs of G and their costs are: s1 0 and s1 a 1 with a(s1 0 ) = 0 and a(s1 a 1 ) = p 1 ( either the object 1 is inserted in the knapsack with profit p 1 and filling level a 1, or it is not inserted, with the profit and fitting level 0). i = 2, n j = 0, b: (i 1) j i j with a((i 1) j i j ) = 0 (the object i is not inserted into knapsack: from the filling with the first i 1 objects and filling level j, we pass to a filling with the first i objects, without object i; the filling level remains j and the additional profit is 0). If j a i 0 then we have also the arc (i 1) j a i i j with a ( (i 1) j a i i j) = p i (we can arrive at the filling level j by inseting the object i to a filling with the first i 1 objects, with the filling level j a i ). j = 0, b: n j t with a(n j t) = / 63

45 Path Problems Shortest Paths Applications Remark. Each path from s to t in G corresponds to a subset of objects with the filling level b and with the total profit equal to the cost of the path. Since, conversely, to each filling of the knapsack corresponds a path from s to t in G, it follows that the knapsack problem can be solved by finding a path of maximum cost in the directed acyclic graph G. a 0 0 s 1:0 2:0 n:0 p2 0 p1 1:1 2:1 n: :a2 n: :a1 2:a1 t p2 2:a1+a :b 2:b n:b a The static description given above for G can be transformed into a procedural one, giving the usual dynamic programming solution. Note that the problem is NP-hard (the order of G could be exponential in the input size of 45 / 63

46 Path Problems Shortest Paths Solving P2 P2: Given G digraph; a : E(G) R; s V (G). Find P si P si, i V (G), s.t. a(p si ) = min{a(p si) P si P si }. 46 / 63

47 Path Problems Shortest Paths Solving P2 P2: Given G digraph; a : E(G) R; s V (G). Find P si P si, i V (G), s.t. a(p si ) = min{a(p si) P si P si }. Theorem 1. Let G = (V, E) be a digraph, V = {1,..., n}, s V and a : E R, s.t. (I ) a(c) > 0, for all C circuit in G. Then, (u 1,..., u n ) is a solution of the nonlinear system of equations { us = 0 (B) u i = min (u j + a ji ) i s. j i if and only if i V, P si P si s.t. a(p si ) = u i and a(p si ) = min{a(p) P P si}. 47 / 63

48 Path Problems Shortest Paths Proof of Theorem 1. Let Psi optimal solutions of P2 and u i = a(psi ) (i V ). The hypothesis (I) implies that u s = 0, i.e. the first equation of the system (B) is satisfied. For i s, the path Psi has a penultimate vertex j. If P sj is the path from s to j determined on Psi by j, we have u i = a(p si) = a(p sj ) + a ji a(p sj) + a ji = u j + a ji. We show that u i = u j + a ji. Suppose that u i > u j + a ji, i.e. a(p sj ) > a(psj ). Case 1. i V (Psj ). Then P1 = Psj (j, ji, i) P si and a(p 1 ) = a(psj ) + a ji < a(p sj ) + a ji = a(psi ), a contradiction (P si is a shortest path). D sj s D* sj j i 48 / 63

49 Path Problems Shortest Paths Proof of Theorem 1. Case 2. i V (Psj ). Let P sj = P si P ij the two paths determined by the vertex i on Psj. Then the cost of the circuit C = P ij (j, ji, i) is a(c) = a(p ij ) + a ji = a(psj ) a(p si) + a ji = u j + a ji a(p si ) u j + a ji a(psi ) = u j + a ji u i < 0, a contradiction (the hypothesis (I) is D violated). ij D sj C s D* sj j i Hence the part of the theorem is proved. Remark. We proved above that if j is the vertex before i on a shortest path from s to i, then the path from s to j determined by j on this shortest paths is a shortest path from s to j. Inductively, it follows: Bellman s Principle of Optimality: If P si is a shortet path from s to i, then j V (P si ), if dacă P si = P sj P ji then P sj (respectively P ji ) is a shortest path from s to j (respectively from j to i). 49 / 63

50 Path Problems Shortest Paths Proof of Theorem 1. We show that if (u 1,..., u n ) is a solution of (B), then (a) P si P si such that u i = a(p si ), i V. (b) i V, u i = min{a(p) P P si }(= a(p si )). (a) If i = s, then u s = 0 and the path P ss satisfies a(p ss ) = 0 = u s. If i s, let us consider the following algorithm v i; k 0; while v s do { find w such that u v = u w + a wv ;// w since u v satisfies (*) i k v; k + +; v w } i k s The algorithm find the path P : (s =)i k+1, i k+1 i k,..., i 1, i 1 i 0, i 0 (= i) with P P si and a(p) = a(i k+1 i k ) + + a(i 1 i 0 ) = (u ik u ik+1 ) + (u ik 1 u ik ) + + (u i0 u i1 ) = u i0 u ik+1 = u i u s = u i. In each while iteration w {i 0,..., i k 1 } (else we get a circuit of cost 0, violating the hypothesis (I)). 50 / 63

51 Path Problems Shortest Paths Proof of Theorem 1. Note that (with the notations in the above algorithm ) we have u i = u i1 + a i1i. (b) Let u i = a(p si ) i V. By the part of the proof, u i, i = 1, n, satisfy the system of equations (B). Suppose that u = (u 1,..., u n ) u = (u 1,..., u n ). Since u s = u s = 0, it follows that there is i s such that u i u i and j V (P si ), j i, u j = u j, where P si is the path constructed in (a) for u i. Then u i > u i = u i1 + a i1 i = u i1 + a i1 i u i ( the first inequality holds by the choice of i, the second holds since u i satisfies (B)). The contradiction found shows that u = u, that is the components of u are shortest paths costs. 51 / 63

52 Path Problems Shortest Paths Remarks From the above proof it follows that for solving P2 is sufficiently to found a solution of the system of equations (B). The corresponding shortest paths can be obtained as in part (a) of the proof: if we have u i = u k + a ki then k is the vertex before i on the shortest path from s to i (of cost u i ). In the algorithm that solves (B) we maintain an array before[1..n] with entries from V {0, } with the final meaning before[i]= the vertex before i on the shortest path from s to i. The vertices of this path can be found in O(n) time by constructing the sequence i, before[i], before[before[i]],..., s. If the algorithms solving the system of equations (B) circumvent (by the maintenance of the array before) 0-cost circuits, then the problem P2 is solved, even the unicity of the solution is lost. Hence these algorithms will solve P2 in the hypothesis (I ) a(c) 0, C circuit in G. 52 / 63

53 Path Problems Shortest Paths Remarks If, in the problems P1-P3, G is a graph and not a digraph, we can use the algorithms for digraphs by replacing each (undirected) edge of G with a symmetric pair of arcs, each having the cost of the edge. Note that this approach works only for non-negative costs of the edges (if an edge has negative cost, then the 2-circuit formed by the two symmetric arcs replacing the edge has negative cost, hence hypothesis (I ) is not satisfied). Since the sets P ij are finite (and non-empty), we can consider problems similar to P1-P3 by replacing min with max. The use of the obvious relation max x A x = (min x A ( x)), by replacing the costs a ij by a ij, works only for digraphs in which, for each circuit C, we have a(c) 0 (in particular, this approach works for digraphs without circuits). If the digraph has circuits, longest path problems are in general NP-hard. 53 / 63

54 Exercises for Next week (23 Oct - 28 Oct) Seminar Most of the exercises for this seminar are very easy, their purpose is solely for practicing the terminology introduced in the lecture. 1 Let us consider three graphs, G 1, G 2, G 3, such that G 1 = G2 and G 2 = G3. True or false: G 1 = G3? You must provide a proof for the answer true or a counterexample for the answer no. 2 Are the two graphs below isomorphic? (justify your answer) 54 / 63

55 Exercises for Next week (23 Oct - 28 Oct) Seminar 3 Prove that if G is a connected graph having exactly one circuit then G = E(G). 4 Find the stability number, α(g), of the graph G below (justify your answer). 5 Let G be a connected graph with G > 1 and without leaf vertices. Prove that E(G) G. 55 / 63

56 Exercises for Next week (23 Oct - 28 Oct) Seminar 6 Let G = (V, E) be a connected graph with G 2. Prove that there is at least one vertex v 0 V that is not a cut vertex. 7 There are graphs having just one spanning tree? There are graphs having exactly 2 spanning trees? (justify your answers) 8 Draw the graph L(L(G)), where G is: 56 / 63

57 Exercises for Next week (23 Oct - 28 Oct) Seminar 9 If G is the graph below, is its line graph, L(G), a Hamiltonian graph? (justify your answer) 10 Find the chromatic number, χ(g), of the complement of the above graph. 11 Find the vertex conectivity number, k(g), of the graph G in the exercise / 63

58 Exercises for Next week (23 Oct - 28 Oct) Seminar 12 Is the graph below self-complementary? (justify your answer) 13 Has the above graph two spanning trees without common edges? (justify your answer) 14 Find the number of spanning trees of the complement of the graph in exercise 12. (justify your answer) 58 / 63

59 Exercises for Next week (23 Oct - 28 Oct) Seminar 15 Find the maximum cardinality of a stable set in the graph K 2 G, where G is the graph depicted in the exercise If G is the graph below, is L(G) a Hamiltonian graph? (justify your answer) 17 For the above graph, G, find the chromatic number χ(g). (justify your answer) 59 / 63

60 Exercises for Next week (23 Oct - 28 Oct) Seminar 18 Is the graph from exercise 16 isomorphic with its complement? (justify your answer) 19 Find the vertex connectivity number of the graph in exercise 16. (justify your answer) 20 Find the diameter of the graph in exercise 16. (justify your answer) 21 Find the chromatic index of the graph in exercise 16. (justify your answer) 60 / 63

61 Exercises for Next week (23 Oct - 28 Oct) Seminar 22 Prove that if G is the line graph of a graph H (G = L(H)) then G is a K 1,3 -free graph. 23 Draw the graph P 4 K 2 and find its chromatic number. (justify your answer) 24 Is it true that α(g) k(g) for the graph G below? (justify your answer) 61 / 63

62 Exercises for Next week (23 Oct - 28 Oct) Seminar 25 Let G be a connected graph with the property that the dfs and bfs trees starting from the same root vertex are equal. Can G have citcuits? (justify your answer) 26 Prove that if N G (u) N G (v) = V (G) for all u, v V (G), u v, then G is a complete graph. 27 Prove that if a graph G has exactly 2 odd degree vertices, then there is in G a path between these 2 vertices. 28 Let G = (V, E) be a graph with the property that d G (v) + d G (w) V 1, v, w V, v w. Prove that the diameter of G is not greater than / 63

63 Exercises for Next week (23 Oct - 28 Oct) Seminar 29 Let G = (V, E) be a connected graph with all vertices of even degree. Prove that the graph G e is connected, e E. 30 Let G = (V, E) be a graph with at least 3 vertices. Prove that G is connected if and only if there are two vertices u, v V (u v) such that the graphs G u and G v are connected. 31 If H = (V (H), E(H) is a graph, we denote by e(h) the size of H (e(h) = E(H) ). Prove that for every graph G with at least 3 vertices we have e(g) = v V (G) e(g v) V (G) / 63

GRAPH ALGORITHMS Week 7 (13 Nov - 18 Nov 2017)

GRAPH ALGORITHMS Week 7 (13 Nov - 18 Nov 2017) GRAPH ALGORITHMS Week 7 (13 Nov - 18 Nov 2017) C. Croitoru croitoru@info.uaic.ro FII November 12, 2017 1 / 33 OUTLINE Matchings Analytical Formulation of the Maximum Matching Problem Perfect Matchings

More information

Preliminaries. Graphs. E : set of edges (arcs) (Undirected) Graph : (i, j) = (j, i) (edges) V = {1, 2, 3, 4, 5}, E = {(1, 3), (3, 2), (2, 4)}

Preliminaries. Graphs. E : set of edges (arcs) (Undirected) Graph : (i, j) = (j, i) (edges) V = {1, 2, 3, 4, 5}, E = {(1, 3), (3, 2), (2, 4)} Preliminaries Graphs G = (V, E), V : set of vertices E : set of edges (arcs) (Undirected) Graph : (i, j) = (j, i) (edges) 1 2 3 5 4 V = {1, 2, 3, 4, 5}, E = {(1, 3), (3, 2), (2, 4)} 1 Directed Graph (Digraph)

More information

Topics in Graph Theory

Topics in Graph Theory Topics in Graph Theory September 4, 2018 1 Preliminaries A graph is a system G = (V, E) consisting of a set V of vertices and a set E (disjoint from V ) of edges, together with an incidence function End

More information

2 hours THE UNIVERSITY OF MANCHESTER. 6 June :45 11:45

2 hours THE UNIVERSITY OF MANCHESTER. 6 June :45 11:45 2 hours THE UNIVERSITY OF MANCHESTER DISCRETE MATHEMATICS 6 June 2016 9:45 11:45 Answer ALL THREE questions in Section A (30 marks in total) and TWO of the THREE questions in Section B (50 marks in total).

More information

2 GRAPH AND NETWORK OPTIMIZATION. E. Amaldi Introduction to Operations Research Politecnico Milano 1

2 GRAPH AND NETWORK OPTIMIZATION. E. Amaldi Introduction to Operations Research Politecnico Milano 1 2 GRAPH AND NETWORK OPTIMIZATION E. Amaldi Introduction to Operations Research Politecnico Milano 1 A variety of decision-making problems can be formulated in terms of graphs and networks Examples: - transportation

More information

1.3 Vertex Degrees. Vertex Degree for Undirected Graphs: Let G be an undirected. Vertex Degree for Digraphs: Let D be a digraph and y V (D).

1.3 Vertex Degrees. Vertex Degree for Undirected Graphs: Let G be an undirected. Vertex Degree for Digraphs: Let D be a digraph and y V (D). 1.3. VERTEX DEGREES 11 1.3 Vertex Degrees Vertex Degree for Undirected Graphs: Let G be an undirected graph and x V (G). The degree d G (x) of x in G: the number of edges incident with x, each loop counting

More information

Discrete Wiskunde II. Lecture 5: Shortest Paths & Spanning Trees

Discrete Wiskunde II. Lecture 5: Shortest Paths & Spanning Trees , 2009 Lecture 5: Shortest Paths & Spanning Trees University of Twente m.uetz@utwente.nl wwwhome.math.utwente.nl/~uetzm/dw/ Shortest Path Problem "#$%&'%()*%"()$#+,&- Given directed "#$%&'()*+,%+('-*.#/'01234564'.*,'7+"-%/8',&'5"4'84%#3

More information

Discrete Optimization 2010 Lecture 2 Matroids & Shortest Paths

Discrete Optimization 2010 Lecture 2 Matroids & Shortest Paths Matroids Shortest Paths Discrete Optimization 2010 Lecture 2 Matroids & Shortest Paths Marc Uetz University of Twente m.uetz@utwente.nl Lecture 2: sheet 1 / 25 Marc Uetz Discrete Optimization Matroids

More information

Graph G = (V, E). V ={vertices}, E={edges}. V={a,b,c,d,e,f,g,h,k} E={(a,b),(a,g),( a,h),(a,k),(b,c),(b,k),...,(h,k)}

Graph G = (V, E). V ={vertices}, E={edges}. V={a,b,c,d,e,f,g,h,k} E={(a,b),(a,g),( a,h),(a,k),(b,c),(b,k),...,(h,k)} Graph Theory Graph G = (V, E). V ={vertices}, E={edges}. a b c h k d g f e V={a,b,c,d,e,f,g,h,k} E={(a,b),(a,g),( a,h),(a,k),(b,c),(b,k),...,(h,k)} E =16. Digraph D = (V, A). V ={vertices}, E={edges}.

More information

Part V. Matchings. Matching. 19 Augmenting Paths for Matchings. 18 Bipartite Matching via Flows

Part V. Matchings. Matching. 19 Augmenting Paths for Matchings. 18 Bipartite Matching via Flows Matching Input: undirected graph G = (V, E). M E is a matching if each node appears in at most one Part V edge in M. Maximum Matching: find a matching of maximum cardinality Matchings Ernst Mayr, Harald

More information

More on NP and Reductions

More on NP and Reductions Indian Institute of Information Technology Design and Manufacturing, Kancheepuram Chennai 600 127, India An Autonomous Institute under MHRD, Govt of India http://www.iiitdm.ac.in COM 501 Advanced Data

More information

Supereulerian planar graphs

Supereulerian planar graphs Supereulerian planar graphs Hong-Jian Lai and Mingquan Zhan Department of Mathematics West Virginia University, Morgantown, WV 26506, USA Deying Li and Jingzhong Mao Department of Mathematics Central China

More information

FINAL EXAM PRACTICE PROBLEMS CMSC 451 (Spring 2016)

FINAL EXAM PRACTICE PROBLEMS CMSC 451 (Spring 2016) FINAL EXAM PRACTICE PROBLEMS CMSC 451 (Spring 2016) The final exam will be on Thursday, May 12, from 8:00 10:00 am, at our regular class location (CSI 2117). It will be closed-book and closed-notes, except

More information

4 CONNECTED PROJECTIVE-PLANAR GRAPHS ARE HAMILTONIAN. Robin Thomas* Xingxing Yu**

4 CONNECTED PROJECTIVE-PLANAR GRAPHS ARE HAMILTONIAN. Robin Thomas* Xingxing Yu** 4 CONNECTED PROJECTIVE-PLANAR GRAPHS ARE HAMILTONIAN Robin Thomas* Xingxing Yu** School of Mathematics Georgia Institute of Technology Atlanta, Georgia 30332, USA May 1991, revised 23 October 1993. Published

More information

Advanced Topics in Discrete Math: Graph Theory Fall 2010

Advanced Topics in Discrete Math: Graph Theory Fall 2010 21-801 Advanced Topics in Discrete Math: Graph Theory Fall 2010 Prof. Andrzej Dudek notes by Brendan Sullivan October 18, 2010 Contents 0 Introduction 1 1 Matchings 1 1.1 Matchings in Bipartite Graphs...................................

More information

Maximum flow problem (part I)

Maximum flow problem (part I) Maximum flow problem (part I) Combinatorial Optimization Giovanni Righini Università degli Studi di Milano Definitions A flow network is a digraph D = (N,A) with two particular nodes s and t acting as

More information

Ngày 20 tháng 7 năm Discrete Optimization Graphs

Ngày 20 tháng 7 năm Discrete Optimization Graphs Discrete Optimization Graphs Ngày 20 tháng 7 năm 2011 Lecture 6: Graphs In this class we shall prove some simple, useful theorems about graphs. We start with very simple obseravations. Lecture 6: Graphs

More information

NP and Computational Intractability

NP and Computational Intractability NP and Computational Intractability 1 Polynomial-Time Reduction Desiderata'. Suppose we could solve X in polynomial-time. What else could we solve in polynomial time? don't confuse with reduces from Reduction.

More information

Discrete Optimization 2010 Lecture 10 P, N P, and N PCompleteness

Discrete Optimization 2010 Lecture 10 P, N P, and N PCompleteness Discrete Optimization 2010 Lecture 10 P, N P, and N PCompleteness Marc Uetz University of Twente m.uetz@utwente.nl Lecture 9: sheet 1 / 31 Marc Uetz Discrete Optimization Outline 1 N P and co-n P 2 N P-completeness

More information

On improving matchings in trees, via bounded-length augmentations 1

On improving matchings in trees, via bounded-length augmentations 1 On improving matchings in trees, via bounded-length augmentations 1 Julien Bensmail a, Valentin Garnero a, Nicolas Nisse a a Université Côte d Azur, CNRS, Inria, I3S, France Abstract Due to a classical

More information

List of Theorems. Mat 416, Introduction to Graph Theory. Theorem 1 The numbers R(p, q) exist and for p, q 2,

List of Theorems. Mat 416, Introduction to Graph Theory. Theorem 1 The numbers R(p, q) exist and for p, q 2, List of Theorems Mat 416, Introduction to Graph Theory 1. Ramsey s Theorem for graphs 8.3.11. Theorem 1 The numbers R(p, q) exist and for p, q 2, R(p, q) R(p 1, q) + R(p, q 1). If both summands on the

More information

CS60007 Algorithm Design and Analysis 2018 Assignment 1

CS60007 Algorithm Design and Analysis 2018 Assignment 1 CS60007 Algorithm Design and Analysis 2018 Assignment 1 Palash Dey and Swagato Sanyal Indian Institute of Technology, Kharagpur Please submit the solutions of the problems 6, 11, 12 and 13 (written in

More information

CSE 202 Homework 4 Matthias Springer, A

CSE 202 Homework 4 Matthias Springer, A CSE 202 Homework 4 Matthias Springer, A99500782 1 Problem 2 Basic Idea PERFECT ASSEMBLY N P: a permutation P of s i S is a certificate that can be checked in polynomial time by ensuring that P = S, and

More information

CS/COE

CS/COE CS/COE 1501 www.cs.pitt.edu/~nlf4/cs1501/ P vs NP But first, something completely different... Some computational problems are unsolvable No algorithm can be written that will always produce the correct

More information

Martin Milanič

Martin Milanič 1 / 75 Algorithmic Graph Theory Part I - Review of Basic Notions in Graph Theory, Algorithms and Complexity Martin Milanič martin.milanic@upr.si University of Primorska, Koper, Slovenia Dipartimento di

More information

University of Toronto Department of Electrical and Computer Engineering. Final Examination. ECE 345 Algorithms and Data Structures Fall 2016

University of Toronto Department of Electrical and Computer Engineering. Final Examination. ECE 345 Algorithms and Data Structures Fall 2016 University of Toronto Department of Electrical and Computer Engineering Final Examination ECE 345 Algorithms and Data Structures Fall 2016 Print your first name, last name, UTORid, and student number neatly

More information

The least eigenvalue of the signless Laplacian of non-bipartite unicyclic graphs with k pendant vertices

The least eigenvalue of the signless Laplacian of non-bipartite unicyclic graphs with k pendant vertices Electronic Journal of Linear Algebra Volume 26 Volume 26 (2013) Article 22 2013 The least eigenvalue of the signless Laplacian of non-bipartite unicyclic graphs with k pendant vertices Ruifang Liu rfliu@zzu.edu.cn

More information

4 Packing T-joins and T-cuts

4 Packing T-joins and T-cuts 4 Packing T-joins and T-cuts Introduction Graft: A graft consists of a connected graph G = (V, E) with a distinguished subset T V where T is even. T-cut: A T -cut of G is an edge-cut C which separates

More information

CS 583: Algorithms. NP Completeness Ch 34. Intractability

CS 583: Algorithms. NP Completeness Ch 34. Intractability CS 583: Algorithms NP Completeness Ch 34 Intractability Some problems are intractable: as they grow large, we are unable to solve them in reasonable time What constitutes reasonable time? Standard working

More information

arxiv: v1 [cs.ds] 2 Oct 2018

arxiv: v1 [cs.ds] 2 Oct 2018 Contracting to a Longest Path in H-Free Graphs Walter Kern 1 and Daniël Paulusma 2 1 Department of Applied Mathematics, University of Twente, The Netherlands w.kern@twente.nl 2 Department of Computer Science,

More information

Partial characterizations of clique-perfect graphs II: diamond-free and Helly circular-arc graphs

Partial characterizations of clique-perfect graphs II: diamond-free and Helly circular-arc graphs Partial characterizations of clique-perfect graphs II: diamond-free and Helly circular-arc graphs Flavia Bonomo a,1, Maria Chudnovsky b,2 and Guillermo Durán c,3 a Departamento de Matemática, Facultad

More information

Standard Diraphs the (unique) digraph with no vertices or edges. (modulo n) for every 1 i n A digraph whose underlying graph is a complete graph.

Standard Diraphs the (unique) digraph with no vertices or edges. (modulo n) for every 1 i n A digraph whose underlying graph is a complete graph. 5 Directed Graphs What is a directed graph? Directed Graph: A directed graph, or digraph, D, consists of a set of vertices V (D), a set of edges E(D), and a function which assigns each edge e an ordered

More information

Some Nordhaus-Gaddum-type Results

Some Nordhaus-Gaddum-type Results Some Nordhaus-Gaddum-type Results Wayne Goddard Department of Mathematics Massachusetts Institute of Technology Cambridge, USA Michael A. Henning Department of Mathematics University of Natal Pietermaritzburg,

More information

Fundamental Algorithms 11

Fundamental Algorithms 11 Technische Universität München WS 2013/14 Institut für Informatik Worksheet Scientific Computing in Computer Science 20.01.2014 Fundamental Algorithms 11 Exercise 1 Hypergraphs A hypergraph extends the

More information

This section is an introduction to the basic themes of the course.

This section is an introduction to the basic themes of the course. Chapter 1 Matrices and Graphs 1.1 The Adjacency Matrix This section is an introduction to the basic themes of the course. Definition 1.1.1. A simple undirected graph G = (V, E) consists of a non-empty

More information

Representations of All Solutions of Boolean Programming Problems

Representations of All Solutions of Boolean Programming Problems Representations of All Solutions of Boolean Programming Problems Utz-Uwe Haus and Carla Michini Institute for Operations Research Department of Mathematics ETH Zurich Rämistr. 101, 8092 Zürich, Switzerland

More information

Combinatorial optimization problems

Combinatorial optimization problems Combinatorial optimization problems Heuristic Algorithms Giovanni Righini University of Milan Department of Computer Science (Crema) Optimization In general an optimization problem can be formulated as:

More information

UNIVERSITY OF YORK. MSc Examinations 2004 MATHEMATICS Networks. Time Allowed: 3 hours.

UNIVERSITY OF YORK. MSc Examinations 2004 MATHEMATICS Networks. Time Allowed: 3 hours. UNIVERSITY OF YORK MSc Examinations 2004 MATHEMATICS Networks Time Allowed: 3 hours. Answer 4 questions. Standard calculators will be provided but should be unnecessary. 1 Turn over 2 continued on next

More information

CS 301: Complexity of Algorithms (Term I 2008) Alex Tiskin Harald Räcke. Hamiltonian Cycle. 8.5 Sequencing Problems. Directed Hamiltonian Cycle

CS 301: Complexity of Algorithms (Term I 2008) Alex Tiskin Harald Räcke. Hamiltonian Cycle. 8.5 Sequencing Problems. Directed Hamiltonian Cycle 8.5 Sequencing Problems Basic genres. Packing problems: SET-PACKING, INDEPENDENT SET. Covering problems: SET-COVER, VERTEX-COVER. Constraint satisfaction problems: SAT, 3-SAT. Sequencing problems: HAMILTONIAN-CYCLE,

More information

directed weighted graphs as flow networks the Ford-Fulkerson algorithm termination and running time

directed weighted graphs as flow networks the Ford-Fulkerson algorithm termination and running time Network Flow 1 The Maximum-Flow Problem directed weighted graphs as flow networks the Ford-Fulkerson algorithm termination and running time 2 Maximum Flows and Minimum Cuts flows and cuts max flow equals

More information

Trees. A tree is a graph which is. (a) Connected and. (b) has no cycles (acyclic).

Trees. A tree is a graph which is. (a) Connected and. (b) has no cycles (acyclic). Trees A tree is a graph which is (a) Connected and (b) has no cycles (acyclic). 1 Lemma 1 Let the components of G be C 1, C 2,..., C r, Suppose e = (u, v) / E, u C i, v C j. (a) i = j ω(g + e) = ω(g).

More information

CHAPTER 1. Relations. 1. Relations and Their Properties. Discussion

CHAPTER 1. Relations. 1. Relations and Their Properties. Discussion CHAPTER 1 Relations 1. Relations and Their Properties 1.1. Definition of a Relation. Definition 1.1.1. A binary relation from a set A to a set B is a subset R A B. If (a, b) R we say a is Related to b

More information

Observation 4.1 G has a proper separation of order 0 if and only if G is disconnected.

Observation 4.1 G has a proper separation of order 0 if and only if G is disconnected. 4 Connectivity 2-connectivity Separation: A separation of G of order k is a pair of subgraphs (H, K) with H K = G and E(H K) = and V (H) V (K) = k. Such a separation is proper if V (H) \ V (K) and V (K)

More information

Quantum Algorithms for Graph Traversals and Related Problems

Quantum Algorithms for Graph Traversals and Related Problems Quantum Algorithms for Graph Traversals and Related Problems Sebastian Dörn Institut für Theoretische Informatik, Universität Ulm, 89069 Ulm, Germany sebastian.doern@uni-ulm.de Abstract. We study the complexity

More information

Models of Computation. by Costas Busch, LSU

Models of Computation. by Costas Busch, LSU Models of Computation by Costas Busch, LSU 1 Computation CPU memory 2 temporary memory input memory CPU output memory Program memory 3 Example: f ( x) x 3 temporary memory input memory Program memory compute

More information

Observation 4.1 G has a proper separation of order 0 if and only if G is disconnected.

Observation 4.1 G has a proper separation of order 0 if and only if G is disconnected. 4 Connectivity 2-connectivity Separation: A separation of G of order k is a pair of subgraphs (H 1, H 2 ) so that H 1 H 2 = G E(H 1 ) E(H 2 ) = V (H 1 ) V (H 2 ) = k Such a separation is proper if V (H

More information

Undirected Graphs. V = { 1, 2, 3, 4, 5, 6, 7, 8 } E = { 1-2, 1-3, 2-3, 2-4, 2-5, 3-5, 3-7, 3-8, 4-5, 5-6 } n = 8 m = 11

Undirected Graphs. V = { 1, 2, 3, 4, 5, 6, 7, 8 } E = { 1-2, 1-3, 2-3, 2-4, 2-5, 3-5, 3-7, 3-8, 4-5, 5-6 } n = 8 m = 11 Undirected Graphs Undirected graph. G = (V, E) V = nodes. E = edges between pairs of nodes. Captures pairwise relationship between objects. Graph size parameters: n = V, m = E. V = {, 2, 3,,,, 7, 8 } E

More information

On shredders and vertex connectivity augmentation

On shredders and vertex connectivity augmentation On shredders and vertex connectivity augmentation Gilad Liberman The Open University of Israel giladliberman@gmail.com Zeev Nutov The Open University of Israel nutov@openu.ac.il Abstract We consider the

More information

Math 5707: Graph Theory, Spring 2017 Midterm 3

Math 5707: Graph Theory, Spring 2017 Midterm 3 University of Minnesota Math 5707: Graph Theory, Spring 2017 Midterm 3 Nicholas Rancourt (edited by Darij Grinberg) December 25, 2017 1 Exercise 1 1.1 Problem Let G be a connected multigraph. Let x, y,

More information

arxiv: v1 [cs.dm] 26 Apr 2010

arxiv: v1 [cs.dm] 26 Apr 2010 A Simple Polynomial Algorithm for the Longest Path Problem on Cocomparability Graphs George B. Mertzios Derek G. Corneil arxiv:1004.4560v1 [cs.dm] 26 Apr 2010 Abstract Given a graph G, the longest path

More information

5 Flows and cuts in digraphs

5 Flows and cuts in digraphs 5 Flows and cuts in digraphs Recall that a digraph or network is a pair G = (V, E) where V is a set and E is a multiset of ordered pairs of elements of V, which we refer to as arcs. Note that two vertices

More information

1 T 1 = where 1 is the all-ones vector. For the upper bound, let v 1 be the eigenvector corresponding. u:(u,v) E v 1(u)

1 T 1 = where 1 is the all-ones vector. For the upper bound, let v 1 be the eigenvector corresponding. u:(u,v) E v 1(u) CME 305: Discrete Mathematics and Algorithms Instructor: Reza Zadeh (rezab@stanford.edu) Final Review Session 03/20/17 1. Let G = (V, E) be an unweighted, undirected graph. Let λ 1 be the maximum eigenvalue

More information

Packing and Covering Dense Graphs

Packing and Covering Dense Graphs Packing and Covering Dense Graphs Noga Alon Yair Caro Raphael Yuster Abstract Let d be a positive integer. A graph G is called d-divisible if d divides the degree of each vertex of G. G is called nowhere

More information

THE COMPLEXITY OF DISSOCIATION SET PROBLEMS IN GRAPHS. 1. Introduction

THE COMPLEXITY OF DISSOCIATION SET PROBLEMS IN GRAPHS. 1. Introduction THE COMPLEXITY OF DISSOCIATION SET PROBLEMS IN GRAPHS YURY ORLOVICH, ALEXANDRE DOLGUI, GERD FINKE, VALERY GORDON, FRANK WERNER Abstract. A subset of vertices in a graph is called a dissociation set if

More information

Hamilton cycles and closed trails in iterated line graphs

Hamilton cycles and closed trails in iterated line graphs Hamilton cycles and closed trails in iterated line graphs Paul A. Catlin, Department of Mathematics Wayne State University, Detroit MI 48202 USA Iqbalunnisa, Ramanujan Institute University of Madras, Madras

More information

Graduate Algorithms CS F-21 NP & Approximation Algorithms

Graduate Algorithms CS F-21 NP & Approximation Algorithms Graduate Algorithms CS673-2016F-21 NP & Approximation Algorithms David Galles Department of Computer Science University of San Francisco 21-0: Classes of Problems Consider three problem classes: Polynomial

More information

The Strong Largeur d Arborescence

The Strong Largeur d Arborescence The Strong Largeur d Arborescence Rik Steenkamp (5887321) November 12, 2013 Master Thesis Supervisor: prof.dr. Monique Laurent Local Supervisor: prof.dr. Alexander Schrijver KdV Institute for Mathematics

More information

CSE 431/531: Analysis of Algorithms. Dynamic Programming. Lecturer: Shi Li. Department of Computer Science and Engineering University at Buffalo

CSE 431/531: Analysis of Algorithms. Dynamic Programming. Lecturer: Shi Li. Department of Computer Science and Engineering University at Buffalo CSE 431/531: Analysis of Algorithms Dynamic Programming Lecturer: Shi Li Department of Computer Science and Engineering University at Buffalo Paradigms for Designing Algorithms Greedy algorithm Make a

More information

arxiv: v2 [math.co] 7 Jan 2016

arxiv: v2 [math.co] 7 Jan 2016 Global Cycle Properties in Locally Isometric Graphs arxiv:1506.03310v2 [math.co] 7 Jan 2016 Adam Borchert, Skylar Nicol, Ortrud R. Oellermann Department of Mathematics and Statistics University of Winnipeg,

More information

ACO Comprehensive Exam October 18 and 19, Analysis of Algorithms

ACO Comprehensive Exam October 18 and 19, Analysis of Algorithms Consider the following two graph problems: 1. Analysis of Algorithms Graph coloring: Given a graph G = (V,E) and an integer c 0, a c-coloring is a function f : V {1,,...,c} such that f(u) f(v) for all

More information

Laplacian Integral Graphs with Maximum Degree 3

Laplacian Integral Graphs with Maximum Degree 3 Laplacian Integral Graphs with Maximum Degree Steve Kirkland Department of Mathematics and Statistics University of Regina Regina, Saskatchewan, Canada S4S 0A kirkland@math.uregina.ca Submitted: Nov 5,

More information

8.5 Sequencing Problems

8.5 Sequencing Problems 8.5 Sequencing Problems Basic genres. Packing problems: SET-PACKING, INDEPENDENT SET. Covering problems: SET-COVER, VERTEX-COVER. Constraint satisfaction problems: SAT, 3-SAT. Sequencing problems: HAMILTONIAN-CYCLE,

More information

Limitations of Algorithm Power

Limitations of Algorithm Power Limitations of Algorithm Power Objectives We now move into the third and final major theme for this course. 1. Tools for analyzing algorithms. 2. Design strategies for designing algorithms. 3. Identifying

More information

CS 4407 Algorithms Lecture: Shortest Path Algorithms

CS 4407 Algorithms Lecture: Shortest Path Algorithms CS 440 Algorithms Lecture: Shortest Path Algorithms Prof. Gregory Provan Department of Computer Science University College Cork 1 Outline Shortest Path Problem General Lemmas and Theorems. Algorithms Bellman-Ford

More information

Chapter 7 Network Flow Problems, I

Chapter 7 Network Flow Problems, I Chapter 7 Network Flow Problems, I Network flow problems are the most frequently solved linear programming problems. They include as special cases, the assignment, transportation, maximum flow, and shortest

More information

arxiv: v3 [cs.dm] 18 Oct 2017

arxiv: v3 [cs.dm] 18 Oct 2017 Decycling a Graph by the Removal of a Matching: Characterizations for Special Classes arxiv:1707.02473v3 [cs.dm] 18 Oct 2017 Fábio Protti and Uéverton dos Santos Souza Institute of Computing - Universidade

More information

The Chvátal-Erdős condition for supereulerian graphs and the hamiltonian index

The Chvátal-Erdős condition for supereulerian graphs and the hamiltonian index The Chvátal-Erdős condition for supereulerian graphs and the hamiltonian index Hong-Jian Lai Department of Mathematics West Virginia University Morgantown, WV 6506, U.S.A. Huiya Yan Department of Mathematics

More information

P P P NP-Hard: L is NP-hard if for all L NP, L L. Thus, if we could solve L in polynomial. Cook's Theorem and Reductions

P P P NP-Hard: L is NP-hard if for all L NP, L L. Thus, if we could solve L in polynomial. Cook's Theorem and Reductions Summary of the previous lecture Recall that we mentioned the following topics: P: is the set of decision problems (or languages) that are solvable in polynomial time. NP: is the set of decision problems

More information

Partial characterizations of clique-perfect graphs I: subclasses of claw-free graphs

Partial characterizations of clique-perfect graphs I: subclasses of claw-free graphs Partial characterizations of clique-perfect graphs I: subclasses of claw-free graphs Flavia Bonomo a,1, Maria Chudnovsky b,2 and Guillermo Durán c,3 a Departamento de Computación, Facultad de Ciencias

More information

In this paper, we will investigate oriented bicyclic graphs whose skew-spectral radius does not exceed 2.

In this paper, we will investigate oriented bicyclic graphs whose skew-spectral radius does not exceed 2. 3rd International Conference on Multimedia Technology ICMT 2013) Oriented bicyclic graphs whose skew spectral radius does not exceed 2 Jia-Hui Ji Guang-Hui Xu Abstract Let S(Gσ ) be the skew-adjacency

More information

Chapter 7 Matchings and r-factors

Chapter 7 Matchings and r-factors Chapter 7 Matchings and r-factors Section 7.0 Introduction Suppose you have your own company and you have several job openings to fill. Further, suppose you have several candidates to fill these jobs and

More information

Combinatorial Optimization

Combinatorial Optimization Combinatorial Optimization Problem set 8: solutions 1. Fix constants a R and b > 1. For n N, let f(n) = n a and g(n) = b n. Prove that f(n) = o ( g(n) ). Solution. First we observe that g(n) 0 for all

More information

Discrete Optimization 2010 Lecture 3 Maximum Flows

Discrete Optimization 2010 Lecture 3 Maximum Flows Remainder: Shortest Paths Maximum Flows Discrete Optimization 2010 Lecture 3 Maximum Flows Marc Uetz University of Twente m.uetz@utwente.nl Lecture 3: sheet 1 / 29 Marc Uetz Discrete Optimization Outline

More information

Combinatorial Optimization

Combinatorial Optimization Combinatorial Optimization 2017-2018 1 Maximum matching on bipartite graphs Given a graph G = (V, E), find a maximum cardinal matching. 1.1 Direct algorithms Theorem 1.1 (Petersen, 1891) A matching M is

More information

Nowhere-zero Unoriented Flows in Hamiltonian Graphs

Nowhere-zero Unoriented Flows in Hamiltonian Graphs Nowhere-zero Unoriented Flows in Hamiltonian Graphs S. Akbari 1,5, A. Daemi 2, O. Hatami 1, A. Javanmard 3, A. Mehrabian 4 1 Department of Mathematical Sciences Sharif University of Technology Tehran,

More information

Branch-and-Bound for the Travelling Salesman Problem

Branch-and-Bound for the Travelling Salesman Problem Branch-and-Bound for the Travelling Salesman Problem Leo Liberti LIX, École Polytechnique, F-91128 Palaiseau, France Email:liberti@lix.polytechnique.fr March 15, 2011 Contents 1 The setting 1 1.1 Graphs...............................................

More information

Preliminaries and Complexity Theory

Preliminaries and Complexity Theory Preliminaries and Complexity Theory Oleksandr Romanko CAS 746 - Advanced Topics in Combinatorial Optimization McMaster University, January 16, 2006 Introduction Book structure: 2 Part I Linear Algebra

More information

Lecture 3: graph theory

Lecture 3: graph theory CONTENTS 1 BASIC NOTIONS Lecture 3: graph theory Sonia Martínez October 15, 2014 Abstract The notion of graph is at the core of cooperative control. Essentially, it allows us to model the interaction topology

More information

CMPS 6610 Fall 2018 Shortest Paths Carola Wenk

CMPS 6610 Fall 2018 Shortest Paths Carola Wenk CMPS 6610 Fall 018 Shortest Paths Carola Wenk Slides courtesy of Charles Leiserson with changes and additions by Carola Wenk Paths in graphs Consider a digraph G = (V, E) with an edge-weight function w

More information

Induced Subgraph Isomorphism on proper interval and bipartite permutation graphs

Induced Subgraph Isomorphism on proper interval and bipartite permutation graphs Induced Subgraph Isomorphism on proper interval and bipartite permutation graphs Pinar Heggernes Pim van t Hof Daniel Meister Yngve Villanger Abstract Given two graphs G and H as input, the Induced Subgraph

More information

MINIMALLY NON-PFAFFIAN GRAPHS

MINIMALLY NON-PFAFFIAN GRAPHS MINIMALLY NON-PFAFFIAN GRAPHS SERGUEI NORINE AND ROBIN THOMAS Abstract. We consider the question of characterizing Pfaffian graphs. We exhibit an infinite family of non-pfaffian graphs minimal with respect

More information

Claw-free Graphs. III. Sparse decomposition

Claw-free Graphs. III. Sparse decomposition Claw-free Graphs. III. Sparse decomposition Maria Chudnovsky 1 and Paul Seymour Princeton University, Princeton NJ 08544 October 14, 003; revised May 8, 004 1 This research was conducted while the author

More information

Perfect matchings in highly cyclically connected regular graphs

Perfect matchings in highly cyclically connected regular graphs Perfect matchings in highly cyclically connected regular graphs arxiv:1709.08891v1 [math.co] 6 Sep 017 Robert Lukot ka Comenius University, Bratislava lukotka@dcs.fmph.uniba.sk Edita Rollová University

More information

An Introduction to Spectral Graph Theory

An Introduction to Spectral Graph Theory An Introduction to Spectral Graph Theory Mackenzie Wheeler Supervisor: Dr. Gary MacGillivray University of Victoria WheelerM@uvic.ca Outline Outline 1. How many walks are there from vertices v i to v j

More information

CS 70 Discrete Mathematics and Probability Theory Fall 2016 Seshia and Walrand Midterm 1 Solutions

CS 70 Discrete Mathematics and Probability Theory Fall 2016 Seshia and Walrand Midterm 1 Solutions CS 70 Discrete Mathematics and Probability Theory Fall 2016 Seshia and Walrand Midterm 1 Solutions PRINT Your Name: Answer: Oski Bear SIGN Your Name: PRINT Your Student ID: CIRCLE your exam room: Dwinelle

More information

Paths and cycles in extended and decomposable digraphs

Paths and cycles in extended and decomposable digraphs Paths and cycles in extended and decomposable digraphs Jørgen Bang-Jensen Gregory Gutin Department of Mathematics and Computer Science Odense University, Denmark Abstract We consider digraphs called extended

More information

Graph Theory. Thomas Bloom. February 6, 2015

Graph Theory. Thomas Bloom. February 6, 2015 Graph Theory Thomas Bloom February 6, 2015 1 Lecture 1 Introduction A graph (for the purposes of these lectures) is a finite set of vertices, some of which are connected by a single edge. Most importantly,

More information

Fast exact algorithms for hamiltonicity in claw-free graphs

Fast exact algorithms for hamiltonicity in claw-free graphs Fast exact algorithms for hamiltonicity in claw-free graphs Hajo Broersma 1, Fedor V. Fomin 2, Pim van t Hof 1, and Daniël Paulusma 1 1 Department of Computer Science, University of Durham, Science Laboratories,

More information

Chapter 3: Proving NP-completeness Results

Chapter 3: Proving NP-completeness Results Chapter 3: Proving NP-completeness Results Six Basic NP-Complete Problems Some Techniques for Proving NP-Completeness Some Suggested Exercises 1.1 Six Basic NP-Complete Problems 3-SATISFIABILITY (3SAT)

More information

Some Results on Paths and Cycles in Claw-Free Graphs

Some Results on Paths and Cycles in Claw-Free Graphs Some Results on Paths and Cycles in Claw-Free Graphs BING WEI Department of Mathematics University of Mississippi 1 1. Basic Concepts A graph G is called claw-free if it has no induced subgraph isomorphic

More information

Lecture 13: Spectral Graph Theory

Lecture 13: Spectral Graph Theory CSE 521: Design and Analysis of Algorithms I Winter 2017 Lecture 13: Spectral Graph Theory Lecturer: Shayan Oveis Gharan 11/14/18 Disclaimer: These notes have not been subjected to the usual scrutiny reserved

More information

Single Source Shortest Paths

Single Source Shortest Paths CMPS 00 Fall 017 Single Source Shortest Paths Carola Wenk Slides courtesy of Charles Leiserson with changes and additions by Carola Wenk Paths in graphs Consider a digraph G = (V, E) with an edge-weight

More information

Zero-Sum Flows in Regular Graphs

Zero-Sum Flows in Regular Graphs Zero-Sum Flows in Regular Graphs S. Akbari,5, A. Daemi 2, O. Hatami, A. Javanmard 3, A. Mehrabian 4 Department of Mathematical Sciences Sharif University of Technology Tehran, Iran 2 Department of Mathematics

More information

1 Matchings in Non-Bipartite Graphs

1 Matchings in Non-Bipartite Graphs CS 598CSC: Combinatorial Optimization Lecture date: Feb 9, 010 Instructor: Chandra Chekuri Scribe: Matthew Yancey 1 Matchings in Non-Bipartite Graphs We discuss matching in general undirected graphs. Given

More information

CS 350 Algorithms and Complexity

CS 350 Algorithms and Complexity CS 350 Algorithms and Complexity Winter 2019 Lecture 15: Limitations of Algorithmic Power Introduction to complexity theory Andrew P. Black Department of Computer Science Portland State University Lower

More information

CS 350 Algorithms and Complexity

CS 350 Algorithms and Complexity 1 CS 350 Algorithms and Complexity Fall 2015 Lecture 15: Limitations of Algorithmic Power Introduction to complexity theory Andrew P. Black Department of Computer Science Portland State University Lower

More information

Tree-width and planar minors

Tree-width and planar minors Tree-width and planar minors Alexander Leaf and Paul Seymour 1 Princeton University, Princeton, NJ 08544 May 22, 2012; revised March 18, 2014 1 Supported by ONR grant N00014-10-1-0680 and NSF grant DMS-0901075.

More information

Algorithms. NP -Complete Problems. Dong Kyue Kim Hanyang University

Algorithms. NP -Complete Problems. Dong Kyue Kim Hanyang University Algorithms NP -Complete Problems Dong Kyue Kim Hanyang University dqkim@hanyang.ac.kr The Class P Definition 13.2 Polynomially bounded An algorithm is said to be polynomially bounded if its worst-case

More information

Rao s degree sequence conjecture

Rao s degree sequence conjecture Rao s degree sequence conjecture Maria Chudnovsky 1 Columbia University, New York, NY 10027 Paul Seymour 2 Princeton University, Princeton, NJ 08544 July 31, 2009; revised December 10, 2013 1 Supported

More information