Material handling and Transportation in Logistics. Paolo Detti Dipartimento di Ingegneria dell Informazione e Scienze Matematiche Università di Siena

Size: px
Start display at page:

Download "Material handling and Transportation in Logistics. Paolo Detti Dipartimento di Ingegneria dell Informazione e Scienze Matematiche Università di Siena"

Transcription

1 Material handling and Transportation in Logistics Paolo Detti Dipartimento di Ingegneria dell Informazione e Scienze Matematiche Università di Siena

2 Introduction to Graph Theory

3 Graph Theory As Mathematical Programming, Graph Theory provides theoretical tools for modeling and solving optimization and decison problems Many optimization problems have a natural graph representation. Efficient solution approaches exists based on Graph Theory.

4 Origins Graph Theory has been introduced by the Swiss mathematician Leonhard Euler (707-78) In 76 Euler solved a problem known as the seven bridges of Königsberg. The city of Königsberg (now Kaliningrad, Russia) is set on the Pregel River, and includes two large islands which are connected to each other and to the mainland by seven bridges. C Pregel River A D B

5 Origins Graph Theory has been introduced by the Swiss mathematician Leonhard Euler (707-78) In 76 Euler solved a problem known as the seven bridges of Königsberg. The city of Königsberg (now Kaliningrad, Russia) is set on the Pregel River, and includes two large islands which were connected to each other and to the mainland by seven bridges. C Pregel River A D B The question: is it possible to walk with a route that crosses each bridge exactly once, and return to the starting point?

6 The following graph can be used to model the problem of the bridges of Königsberg: to each land zone is associated a circle (called node or vertex), to each bridge a segment (called arc or edge) C A D B The above graph was used by Euler to show that no solution exist for the problem.

7 The following graph can be used to model the problem of the bridges of Königsberg: to each land zone is associated a circle (called node or vertex), to each bridge a segment (called arc or edge) C A D B The above graph was used by Euler to show that no solution exist for the problem. A walk traversing each arc exactly once and returning to the starting point (Eulerian walk) exists in a graph, if and only if the graph has an even number of incident arcs on each node.

8 Definitions A graph G=(V,E) is defined by two sets: The node set V; The arc set E; Each arc connects two nodes. A graph is called directed if each arc is directed (defining an orientation), otherwise the graph is undirected. C C A D A D B B

9 Definitions (undirected graph) Given an undirected arc e=(a, b), we say that a, b are endpoints of e a e is incident in a and b a, b are adjacent two arcs are adjacent if they share a common node b Given a node a in G the neighbor of a, denoted as N(a), is the set of nodes adjacent to a δ(a) is the set of arcs incident in a N() = {, } δ() = {(,), (,), (,)}

10 Given a directed arc e=(a, b) e exits from a (tail of the arc) e enters in b (head of the arc) a is a direct predecessor of b b is a direct successor of a Definitions (directed graph) a b Given a node a of a directed arc G δ + (a) is the set of arcs exiting from a (outgoing arcs) δ - (a) is the set of arcs entering in a (incoming arcs) a node with only ingoing arcs is called sink a node with only outgoing arcs is called source 0 δ + () = {(,), (,)} δ - () ={(0,), (,)}

11 Definitions Given a graph G=(V, E) with V={v,, v n } and E={e,, e m } a path is an arc sequence p={e h, e h,, e hq }, such that each two consecutive arcs in the sequence are adjacent 0 0

12 Definitions A path is called simple if all nodes and arcs in the path are distinct, otherwise the path is called not simple A not simple path is also called walk 0 0 A path is directed if for each (directed) arc e=(i, j) in the path, i is the tail of e and j is the head of e 0

13 We say that path is closed if the first and last nodes of the path are the same A simple and closed path is called cycle 0 Definitions We say that a graph G is connected if for each pair of nodes a and b a path connecting a and b exists 0 0

14 Definitions A directed cycle 0 An undirected cycle 0

15 Definitions A closed path in a graph is called Eulerian cycle if it traverses exactly once each arc of the graph. An Eulerian cycle may not exist in an graph. Not Eulerian Graph Eulerian Graph C A D 0 B

16 Definitions A cycle in a graph is called Hamiltonian cycle if traverses exactly once each node of the graph. A Hamiltonian cycle may not exist in an graph. Hamiltonian Graphs C A D 0 B

17 Given an undirected graph G=(V,A) and a subset S of V a cut in G Definitions is the set of arcs, denoted as δ(s), having one endpoint in S and the other endpoint in V\S S= {, } δ(s) = {(,), (,), (,)}

18 Given a directed graph G=(V,A) and a subset S of V a cut in G The cut δ + (S) is the set of arcs having the tail in S and the head in V\S The cut δ - (S) is the set of arcs having the head in S and the tail in V\S 0 Definitions S ={0,,} δ + (S) = {(0,),(,),(,)} δ - (S) ={(,)}

19 Bipartite graph G=(V, V, A) Definitions The set of nodes V can be partitioned into two sets V and V such that arcs in A incident in two nodes of V or V do not exist

20 Definitions A forest is a graph withouth cycles 0 0

21 A tree T=(V,A) is a graph satisfying one of the following definitions: is a connected forest is connected and does not contain cycles is connected and exactly contains V - arcs a single simple path exists connecting each pair of nodes is connected, but the removal of every arc produces a not connected graph 0 Definitions

22 Definitions Given a graph G=(V,A) a spanning forest F =(V,A ) of G is a forest such that V =V 0 0 0

23 Definitions Given a graph G=(V,A) a spanning tree T =(V,A ) of G is a tree such thatv =V 0 0 0

24 A distribution problem: Minimum Cost (Network) Flow Problem

25 Minimum Cost (Network) Flow Problem The Minimum Cost (Network) Flow Problem consists in finding a plan of minimum cost for transporting goods from sources (e.g., production plants or warehouses) to destinations (e.g., customers) on a given network.

26 Minimum Cost (Network) Flow Problem The Minimum Cost (Network) Flow Problem consists in finding a plan of minimum cost for transporting goods from sources (e.g., production plants or warehouses) to destinations (e.g., customers) on a given network. Efficient solution algorithms exist for the problem, that can be formulated as a Linear Programming problem.

27 Minimum Cost Network Flow Problem: definition Data The graph G=(V, E) of the network A set of source nodes S V, with an amount of goods avalaible, a(i), for each i S A set of destination (or demand) nodes D V, with a amount of goods demanded, b(i), for each i D A set of transit nodes H V, with no goods avalaible/required A unit transportation cost c, a maximum capacity, u, and minimum capacity, l, for each arc (i,j) in E

28 Minimum Cost Network Flow Problem: definition Data The graph G=(V, E) of the network A set of source nodes S V, with an amount of goods avalaible, a(i), for each i S A set of destination (or demand) nodes D V, with a amount of goods demanded, b(i), for each i D A set of transit nodes H V, with no goods avalaible/required A unit transportation cost c, a maximum capacity, u, and minimum capacity, l, for each arc (i,j) in E i l, u, c Let x be the amount of goods flowing on arc (i,j) j Then c x is the cost on arc (i,j)

29 Minimum Cost Network Flow Problem: definition The problem Finding the amount of flow on each arc in such a way that: Arc capacities are respected The following flow conservation constraint is satisfied at each node i: Flow out of i flow into i = a(i) if i is a source node b(i) if i is a destination node 0 if i is a transit node The total cost of the flow is minimum

30 Minimum Cost Network Flow Problem: definition Example: a feasible flow (arc costs are not shown) Sources Nodes Transit Nodes Destination Nodes a()= b(6)=0 a()= a()=0 i 0 0 l, u, c j 7 b(7)= l = 0 u = +

31 Minimum Cost Network Flow Problem: A Linear Programming formulation Variables: x amount of flow traversing arc (i,j), for each (i,j) E Objective Function: min ( i, j ) E c x

32 Upper bound on variables (maximum arc capacity): x u (i,j) E Lower bound on variables (minimum arc capacity): x l (i,j) E

33 Flow conservation constraints: x x ji = (i,j ) δ + (i ) ( j,i ) δ (i ) a(i) i S b(i) i D 0 otherwise Feasible Condition: A feasible solution exists only if total supply equals total demand: i S a ( i) = b( i) i D

34 min c x ( i, j ) E a(i) i S x x ji = b(i) i D ( j,i ) δ (i ) 0 otherwise x l (i,j) E (i,j ) δ + (i ) Linear Programming Formulation x u (i,j) E Property: Observe that, the coefficient matrix of the formulation is Totally Unimodular (composed by the node-arc incidence matrix of a direct graph and identity matrices). Then, if data a ( i), b( i), l, u are integers, an optimal integer flow x* exists.

35 Minimum Cost Network Flow Problem Solution approaches: Efficient (polinomyal) combinatorial solution algorithms exists for the problem, working directly on the network. Furthermore, a modified version of the simplex algorithm exists, called network simplex algorithm, specifically designed for solving minimum cost network flow problems.

36 Cost optimization and production planning Problem description A food industry produces food in production plants. After production, food is can be transported to the customers or first stored in warehouses and then delivered to the customers. Data The unit production cost is the same for all the plants. The unit inventory cost is the same for all the warehouses. Each plant has a limited production capacity. The demand of the customers is known. Transportation costs are known between each pair of points. Between each pair of points at most 00 tons of product can be transported. Objective(s) The problem is to decide the production volumes of each plant and the inventory level of each warehouse, in such a way that the transportation costs are minimized and the demand is satisfied.

37 Cost optimization and production planning Plants Production Capacity (ton/year) Customers Demand (ton/year) Transportation and production/inventory costs (thousands of Euros per ton) Warehouse Warehouse Customer Customer Plant Plant Plant Warehouse Warehouse

38 Cost optimization and production planning The problem can be modeled by a directed graph, in which nodes correspond to plants, warehouses ad customers. A directed arc allows the transportation of food between the two endpoints. Plants warehouses Customers Production Capacity (ton/year) 7 80 Demand (ton/year) A source node is associate to each plant A demand node is associate to each customer A transit node is associated to each warehouse

39 Cost optimization and production planning The following values are associated to each arc: a maximum transportation capacity u, a production and a transportation cost c per ton (for the arcs outgoing from the plants, a transportation and inventiory cost c per ton (for the arcs outgoing from the warehouses). i u, c u = 00 for each arc (i,j) j Transportation and production/inventory costs (thousands of Euros per ton) Warehouse Warehouse Customer Customer Plant Plant Plant Warehouse Warehouse

40 Cost optimization and production planning Modeling as a min cost network flow problem: Feasibility condition The total production capacity (600) exceeds the total demand (80) Plants warehouses Customers Production Capacity (ton/year) 7 80 Demand (ton/year)

41 Cost optimization and production planning Modeling as a min cost network flow problem: Feasibility condition The total production capacity (600) exceeds the total demand (80) Plants warehouses Customers Production Capacity (ton/year) Demand (ton/year) We introduce a dummy demand node with value =0 connected to the source nodes (i.e., the plants) with arcs with maximum capacity 0 and null cost

42 Formulating the problem by Excel

43 Optimal solution of the problem Plants warehouses Customers Production Capacity (ton/year) Demand (ton/year) Total transportation cost:,0,000 Euros

44 The shortest path problem We are given a directed graph G=(V, E) a traveling cost c associated to each arc (i, j) a starting node s and an ending node t The problem is that of finding a directed (simple) path of minimum cost from s to t (i.e., such that the sum of the costs of the arcs on the path) is. s t

45 Modeling the shortest path problem A minimum cost network flow problem Given a shortest path problem efined by a grapg G=(V,E), let us associate: a value a(s)= to node s; a value b(t)= to node t; a minimum capactiy equal to 0 to each arc in E; a maximum capactiy equal to to each arc in E; Then, the problem of finding a shortest path from s to t can be formulated as the problem of finding a minimum cost network flow on the above graph, where s is the unique source node, t is the unique sink node, all the other nodes in V are transit nodes. a(s)= s b(t)= t

46 The transportation problem We are given a bipartite directed graph G=(A,B,E) A, a set of source nodes B, a set of demand nodes the amount b i available in each node of A the amount d i demanded by each node of B a unit transportation cost c to each arc (i, j) di E The problem The problem is that of finding the amount of good to send on each arc, in such a way that the total trasnportation cost is minimum and the the demand is satisfied.

47 The transportation problem Variable definition: x is the amount of flow on arc (i,j), for each (i,j) E j B i A x x min ( i, j ) E c x b i i A d j j B x 0 (i,j) E

48 The transportation problem Source nodes Demand nodes b d b b min c x (i,j ) E x b i i A j B x d j j B i A x 0 (i, j) E Property: The coefficient matrix of the formulation is Totally Unimodular (composed by the node-arc incidence matrix of a direct graph). Then, if data b i and d j are integers, an optimal integer flow x* exists. d

49 The transportation problem Source nodes Demand nodes b d b b d min c x (i,j ) E x = b i i A j B x = d j j B i A x 0 (i, j) E 6 d 6 =Σ i b i - Σ i d i Introducing a dummy node, inequality constraints can be changed in equalities. Then, the transportation problem is a network-flow model without transit nodes.

50 An algorithm for solving minimum cost network flow problems: the network simplex

51 E j i c x ), ( min E (i,j) u x E (i,j) l x = + altrimenti 0 ) ( ) ( ) ( ), ( ) ( ), ( D i i b S i i a x x i i j ji i j i δ δ An algorithm for solving minimum cost network flow problems: the network simplex

52 An algorithm for solving minimum cost network flow problems: the network simplex Flow along an arc: The flow on an arc increases if the direction of the flow and the arc have the same orientation. Flow The flow on an arc decreases if the direction of the flow and the arc have opposite orientation. Flow

53 An algorithm for solving minimum cost network flow problems: the network simplex Sending flow around a cycle Assume that cycles are oriented in a direction. The forward arcs of the cycle are the arcs with the same orientation of the cycle. The backward arcs are in the opposite direction. A flow of unit around C refers to a flow of unit in the forward arcs and a flow of - units in the backward arcs. (,) (,) (,) (,) (,) i (x, c ) j

54 An algorithm for solving minimum cost network flow problems: the network simplex Sending flow around a cycle Assume that cycles are oriented in a direction. The forward arcs of the cycle are the arcs in the same orientation of the cycle. The backward arcs are in the opposite direction. A flow of unit around C refers to a flow of unit in the forward arcs and a flow of - units in the backward arcs. Cost variation produced by a flow of unit around C -++-= - (,) (,) (,) (,) (,) i (x, c ) j

55 An algorithm for solving minimum cost network flow problems: the network simplex Sending flow around a cycle Assume that cycles are oriented in a direction. The forward arcs of the cycle are the arcs in the same orientation of the cycle. The backward arcs are in the opposite direction. A flow of unit around C refers to a flow of unit in the forward arcs and a flow of - units in the backward arcs. Cost variation produced by flow of unit around C -++-= - Observe that the flow variation in C does not affect: - the arcs not in C - the flow conservation constraints (,) (,) i (,) (,) (x, c ) j (,)

56 An algorithm for solving minimum cost network flow problems: the network simplex Sending flow around a cycle Assume that cycles are oriented in a direction. The forward arcs of the cycle are the arcs in the same orientation of the cycle. The backward arcs are in the opposite direction. A flow of unit around C refers to a flow of unit in the forward arcs and a flow of - units in the backward arcs. Cost variation produced by flow of unit around C -++-= - In this case, the cycle is called negative unit cost cycle (,) (,) (,) (,) (,) i (x, c ) j

57 An algorithm for solving minimum cost network flow problems: the network simplex Idea: Starting from a feasible flow, the idea is to improve the initial solution by increasing the flow on negative unit cost cycles (and by decreasing the flow on positive unit cost cycles). Negative unit cost cycle: -++-= - (,) (,) (,) (,) (,) i (x, c ) j

58 An algorithm for solving minimum cost network flow problems: the network simplex Idea: Starting from a feasible flow, the idea is to improve the initial solution by increasing the flow on negative unit cost cycles and by decreasing the flow on positive unit cost cycles. Positive unit cost cycle: -++-= (,) (,) (,) (,) (,) i (x, c ) j

59 An algorithm for solving minimum cost network flow problems: the network simplex Definitions Let x be a feasible flow for a minimum cost flow problem on the graph G, an arc (i, j) is called: free if l < x < u restricted if x = l or x = u One can increase or decrease the flow in a free arc by a small amount and still satisfy bound constraints.

60 An algorithm for solving minimum cost network flow problems: the network simplex Definitions Let x be a feasible flow for a minimum cost flow problem on the graph G, an arc (i, j) is called: free if l < x < u restricted if x = l or x = u Cycle free solution: A cycle free solution is a feasible flow x such that no cycle composed only of free arcs exists in the network. Comment: In a cycle free solution we can send flow in any cycle only in one direction, since each cycle contains at least a constrained arc.

61 An algorithm for solving minimum cost network flow problems: the network simplex Definitions Let x be a feasible flow for a minimum cost flow problem on the graph G, an arc (i, j) is called: free if l < x < u restricted if x = l or x = u Cycle free solution: A cycle free solution is a feasible flow x such that no cycle composed only of free arcs exists in the network. Spanning tree solution: Given a spanning tree T of G, and feasible flow x, x is a spanning tree solution if every nontree arc is a restricted arc. Comment: In a spanning tree solution, the tree arcs can be free or restricted.

62 An algorithm for solving minimum cost network flow problems: the network simplex Cycle free solution: A cycle free solution is a feasible flow x such that no cycle composed only of free arcs exists in the network. Spanning tree solution: Given a spanning tree T of G, and feasible flow x, x is a spanning tree solution if every nontree arc is a restricted arc. Theorem If a minimum cost flow problem allows a finite solution, the problem always has an optimal cycle free and spanning tree solution.

63 An algorithm for solving minimum cost network flow problems: the network simplex Proof. Step : A feasible solution can be always transformed in a free cycle solution Example: Cycle with negative unit cost All arcs have infinite maximum capacity and null minimum capacity Unit Cost of the Cycle: -++-= - negative unit cost cycle (,) (,) i (,) (,) (x, c ) j (,) +a -a -a +a +a

64 An algorithm for solving minimum cost network flow problems: the network simplex By increasing the flow around a negative unit cost cycle of the amount a, the flow on the forward (backward) arcs increases (decreases). The cost in the cycle decreases. a can be increased until the flows on the arcs do not exceed the bound constraints (minimum and maximum capacity): -a a 0 +a 8 +a a a 0 -a +a 0 a= 7 We get a new feasible solution with a smaller cost and with a restricted arc (with flow 0) on the cycle

65 An algorithm for solving minimum cost network flow problems: the network simplex Example: Cycle with positive unit cost All arcs have infinite maximum capacity and null minimum capacity Unit Cost of the Cycle: -++-= positive unit cost cycle (,) (,) i (,) (,) (x, c ) j (,) +a -a -a +a +a

66 An algorithm for solving minimum cost network flow problems: the network simplex In a positive unit cost cycle, the cost decreases as the flow along the cycle decreases. Then, the flow can be decreased on the forward arcs and increased on the backward arcs until the flows on the arcs do not exceed the bound constraints (minimum and maximum capacity): + + a 0 -a +a +a a 0 + a 0 a -a 6 +a a=- 0 We get a new feasible solution with a smaller cost and with a restricted arc (with flow 0) on the cycle

67 An algorithm for solving minimum cost network flow problems: the network simplex Hence, given a feasible flow on the network, we can increase/ decrease the flow around all the cycles of the network until we get a cycle free solution. The procedure described in the previous slides can be easily adapted to networks with lower bounds (l ) greater than 0 and finite upper bounds (u ) on arcs (i,j) (i.e., on variables x )

68 An algorithm for solving minimum cost network flow problems: the network simplex Proof. Step : It is easy to convert a cycle free solution into a spanning tree solution. In fact, given a cycle free solution, let G be the graph obtained by removing all the restricted arcs from the network G. Two cases are possible:. G is connected. Then we directly have a spanning tree solution.. G is not connected. Then, G is a spanning forest. In Case, we can add constrained arcs to G until we get a spanning tree, i.e., a spanning tree solution.

69 An algorithm for solving minimum cost network flow problems: the network simplex In Case, we can add constrained arcs to the forest until we get a spanning tree solution (,) (,) (,) (,) (,6) (,) i (0,) j (x, u ), l =0 Spanning tree solution

70 An algorithm for solving minimum cost network flow problems: the network simplex Hence, we have (informal) proved: Theorem If a minimum cost flow problem allows a finite solution, the problem always has an optimal cycle free and spanning tree solution.

71 An algorithm for solving minimum cost network flow problems: the network simplex Given a spannig tree solution, the arcs in E of the network G can be partitioned into three sets:. The arcs belonging to the tree T. The arcs not belonging to the tree with a flow equal to the minimum capacity (set L). The arcs not belonging to the tree with a flow equal to the maximum capacity (set U) The triple T,L,U is called structure.

72 An algorithm for solving minimum cost network flow problems: the network simplex Given a spannig tree solution, the arcs in E of the network G can be partitioned into three sets:. The arcs belonging to the tree T. The arcs not belonging to the tree with a flow equal to the minimum capacity (set L). The arcs not belonging to the tree with a flow equal to the maximum capacity (set U) Exactly one spannig tree solution x corresponds to a given structure T,L,U, obtained as follows: x =l for each (i,j) in L x =u for each (i,j) in U the flow x on the arcs (i,j) of T can be computed by imposing the flow conservation constraints

73 An algorithm for solving minimum cost network flow problems: the network simplex We say that the structure T,L,U corresponding to a spanning tree solution is feasible if the associated spanning tree solution satisfies all the bounds of the arcs in G We call the tree of a spanning tree solution nondegenerate if every arc of the tree is free. Otherwise, the tree is called degenerate.

74 An algorithm for solving minimum cost network flow problems: the network simplex Given a spanning tree structure T,L,U we can reconstruct its associate spanning tree solution. For the sake of simplicity, let us assume that all arcs have infinite upper bounds and null lower bounds, i.e., all arcs not in T are in L (i.e. 0 flow). Let T e T be the two (sub-)trees obtained by removing any arc. a()= b()= a()=0 a()=b()=0 Note that, it must be: b()=0 T a()= T b()= ( a(i) b(i) ) + ( a(i) b(i) ) = 0 i T i T a()=0 a()=b()=0 b()=0

75 An algorithm for solving minimum cost network flow problems: the network simplex Given a spanning tree structure T,L,U we can reconstruct its associate spanning tree solution. For the sake of simplicity, let us assume that all arcs have infinite upper bounds and null lower bounds, i.e., all arcs not in T are in L (i.e. 0 flow). Let T e T be the two (sub-)trees obtained by removing any arc. a()= b()= a()=0 a()=b()=0 Note that, it must be: b()=0 T a()= T b()= ( a(i) b(i) ) + ( a(i) b(i) ) = 0 i T i T a()=0 a()=b()=0 x =0 b()=0

76 An algorithm for solving minimum cost network flow problems: the network simplex Similarly, we can compute the flow on the arcs, even when arcs have a finite maximum capacity. E.g., let us suppose that arcs (,) and (,) are in U (all other arcs not in T are in L). a()= u = u = b()= a()=0 a()=b()=0 b()=0 a()= T b()= T a()=0 x = a()=b()=0 b()=0

77 An algorithm for solving minimum cost network flow problems: the network simplex How can we check the optimality of a feasible spanning solution and of its related structure T.L,U? Optimality Test Let the reduced cost of an arc be defined as: c ' = c π(i) + π( j) Where π(i) is called potential of node i (i, j) E

78 An algorithm for solving minimum cost network flow problems: the network simplex Optimality Test Let the reduced cost of an arc be defined as: c ' = c π(i) + π( j) Where π(i) is called potential of node i (i, j) E Theorem A spanning tree feasible structure T,L,U is optimal for the minimum cost network flow problem if node potentials π(i) exist such that: c' c' c' = ( i, ( i, ( i, j) T j) L j) U

79 An algorithm for solving minimum cost network flow problems: the network simplex Theorem A spanning tree feasible structure T,L,U is optimal for the minimum cost network flow problem if node potentials π(i) exist such that:.. c' c' = 0 0 ( i, j) T ( i, j) L. c' 0 ( i, j) U Proof Let x* be the solution associated with the spanning tree structure T,L,U. Let us suppose that node potentials exist satisfying conditions -. Note that minimizing c x corresponds to (i,j ) A minimizing c ' x = (i,j ) A constant = min (c π(i) + π( j))x = min c x + π(i)x + π(i)x ji (i,j ) A (i,j ) A i V (i,j ) δ(i ) + ( j,i ) δ(i ) π(i)a(i) if i supplier node π(i)b(i) if i demand node 0 if i transit node

80 An algorithm for solving minimum cost network flow problems: the network simplex Proof (continued) From conditions we have min... c' c' c' = ( i, j) T ( i, j) L ( i, j) U c ' x = min c ' x c ' x (i,j ) A (i,j ) L (i,j ) U Given any feasible solution x, from definition of x* we have: x x * = l ( i, j) L Hence: x x * = u ( i, j) U c' ( i, j ) A x c' ( i, j ) A x * c ( i, j ) A x c ( i, j ) A x * c.d.d.

81 An algorithm for solving minimum cost network flow problems: the network simplex Idea of the algorithm: The network simplex algorithm mantains a feasible spanning tree structure and moves from a spanning tree structure to another until it finds an optimal structure. At each iteration, the algorithm adds one arc to the spanning tree in place of one tree-arc: The entering arc is a nontree arc violating its optimality condition. This arc is added to the spanning tree, creating a cycle with negative unit cost. The flow around the cycle is increased until one or more arcs of the cycle reach their lower or upper bounds. One of these restricted arcs is dropped, generating a new spanning tree structure.

82 An algorithm for solving minimum cost network flow problems: the network simplex Given a spanning spanning tree structure T,L,U The algorithm checks the optimality condition. First of all, it computes the node potentials by imposing that: c' = 0 ( i, j) T How? The nodes are V and the arcs of T are V - Observation We can arbitrarly set the potential of one of the nodes of G. In fact, the addition of a constant k to each node potential does not modify the reduced cost of any arc.

83 An algorithm for solving minimum cost network flow problems: the network simplex Given a spanning spanning tree structure T,L,U The algorithm checks the optimality condition. First of all, it computes the node potentials by imposing that: c' = 0 ( i, j) T How? The nodes are V and the arcs of T are V - The addition of a constant k to each node potential does not modify the reduced cost of any arc: c' = c π( i) + π( j) = c [ π( i) + k] + [ π( j) + For example, the potential of node can be set to 0 The potentials of all other nodes are consequently computed by imposing: c' = c π( i) + π( j) = 0 ( i, j) T k]

84 An algorithm for solving minimum cost network flow problems: the network simplex Example: node potential computation starting from a spanning tree structure T,L,U: i c j c' = c π( i) + π( j) = 0 ( i, j) T π() = 0 c c π() + π() = 0 + π () = 0 π() = π() + π() = + + π () = 0 π() =... Observation If all arc costs are integer, the minimum cost flow problem always has optimal integer node potentials.

85 An algorithm for solving minimum cost network flow problems: the network simplex Algorithm: network simplex determine an initial feasible tree structure T,L,U, and the related feasible flow x compute the node potentials π while (some nontree arc violates the optimality conditions) begin select an entering arc violating its optimality condition add the arc to the tree and determine a leaving arc to drop from the tree perform a tree update and update the structure T,L,U, the flow x and the node potentials π end

86 An algorithm for solving minimum cost network flow problems: the network simplex Obtaining an initial spanning tree structure T,L,U (when all arcs have 0 lower bounds) Let us suppose that Between each pair of nodes a direct path exists with infinite maximum capacity: Given a network G=(V,E), let us add in G dummy arcs (,j) and (j,) for each node j in V\{}, with infinite upper bound and cost (no optimal solution exists using one of these arcs) An initial spanning tree structure T,L,U can be obtained as follows For each supplier (a(j)>0) or transit (a(j)=b(j)=0) node j add in T the arc (j, ) with flow equal to a(j) For each demand (b(j)>0) node j add in T the arc (,j) with flow equal to b(j) Add in the set L all other arcs of G The set U is empty

87 An algorithm for solving minimum cost network flow problems: the network simplex Selection of the entering arc Optimality conditions:... c' c' c' = ( i, j) T ( i, j) L ( i, j) U If the current spanning tree structure violates the optimality conditions, two types of arcs are eligible to enter into the tree: (i,j) L (i,j) U con con > 0 Different selection rules (pivot rules), e.g., - Dantzig rule: select the arc with maximum reduced cost c - First eligible arc rule c' c' < 0

88 An algorithm for solving minimum cost network flow problems: the network simplex Leaving arc selection Let (k,l) be the arc selected for entering into the tree The insertion of (k,l) to the tree generates a cycle (pivot cycle) W We define the orientation of the cycle W as same as that of (k,l) if it is in L and the reverse orientation of (k,l) if it is in U Sending additional flow δ around the pivot cycle strictly decreases the cost of the current solution at per unit rate of c kl i (x, u ) j (,) (,) (,) (,6) (0,) δ 6 (,) (,) 7 8 (,6) (,) 9 (0,) k l pivot cycle

89 An algorithm for solving minimum cost network flow problems: the network simplex Leaving arc selection We augment the flow on the forward arcs and decrease it on the backward arcs. We augment the flow around the cycle as much as possible until one of the arcs in the pivot cycle reaches its lower or upper bound (blocking arc). Eligible arcs for leaving the tree are the blocking arcs. i (x, u ) j (,) (,) (,) (,6) (0,) δ 6 (,) (,) 7 8 (,6) (,) 9 (0,) k l pivot cycle

90 An algorithm for solving minimum cost network flow problems: the network simplex Leaving arc selection The maximum flow change on each arc (i,j) of the pivot cycle that satisfies the bound constraints is: δ i,j = u i,j - x i,j δ i,j = x i,j - l i,j if (i,j) is a forward arc if (i,j) is a backward arc i (x, u ) j (,) (,) (,) (,6) (0,) δ 6 (,) (,) 7 8 (,6) (,) 9 (0,) k l pivot cycle

91 An algorithm for solving minimum cost network flow problems: the network simplex Leaving arc selection The maximum flow change on each arc (i,j) of the pivot cycle that satisfies the bound constraints is: δ i,j = u i,j - x i,j δ i,j = x i,j - l i,j if (i,j) is a forward arc if (i,j) is a backward arc i (x, u ) j Then, the maximum flow we can send around the cycle is (,) (,) (,) (,6) (0,) δ 6 (,) (,) 7 8 (,6) (,) 9 (0,) k l δ = min {δ i,j, for (i,j) in the cycle}= pivot cycle

92 An algorithm for solving minimum cost network flow problems: the network simplex Leaving arc selection A pivot iteration is called nondegenarate iteration if δ >0 and degenarate iteration if δ =0 A degenarate iteration occurs if the spanning tree T is degenerate i (x, u ) j (,) (,) (,) (,6) (0,) δ 6 (,) (,) 7 8 (,6) (,) 9 (0,) k l pivot cycle degenerate iteration

93 An algorithm for solving minimum cost network flow problems: the network simplex Leaving arc selection Turn back to the nondegenerate case (δ=). We augment the flow around the cycle as much as possible until one of the arcs in the pivot cycle reaches its lower or upper bound (blocking arc). Eligible arcs for leaving the tree are the blocking arcs. i (x, u ) j (,) (,) (,) (,6) (0,) δ 6 (,) (,) 7 8 (,6) (,) 9 (0,) k l pivot cycle

94 An algorithm for solving minimum cost network flow problems: the network simplex Leaving arc selection Turn back to the nondegenerate case (δ=). We augment the flow around the cycle as much as possible until one of the arcs in the pivot cycle reaches its lower or upper bound (blocking arc). Eligible arcs for leaving the tree are the blocking arcs. i (x, u ) j (,) (,) (,) (,6) (0,) δ 6 (,) (,) 7 8 (,6) (,) 9 (0,) k l (,) pivot cycle (0,) (,6) (,) (,) δ= (,) 6 (,) 7 8 (,6) (,) 9 k (,) l Blocking arcs: (,), (7,) and (6,)

95 An algorithm for solving minimum cost network flow problems: the network simplex Example a()=9, b(6)=9, all other nodes are transit nodes (,8) (,) i (,7) (,) (,) (,) j (,) (,) (,6) 6 Starting feasible structure T, L, U: Computation of the flows on the arcs L={(,), (,)} U={(,), (,6)} (c, u ), l =0 Node potentials computation: π() = 0 c c c π() + π() = 0 + π() = 0 π () = π() + π() = 0 + π() = 0 π () = π() + π() = + + π () = 0 π() = π(i) i - - x π(j) j

96 An algorithm for solving minimum cost network flow problems: the network simplex π(i) i - - π(j) x L={(,), (,)} U={(,), (,6)} j Selection of the entering arc: c =+-=>0, (,) in U, the maximum additional flow δ around the pivot cycle is, the arc (,) is blocking and leaves the tree (enters in U) c' c' c' c' 6 = c = c = c = c 6 π() + π() = + > 0 π() + π() = + 8 > 0 π() + π() = + = > 0 π() + π(6) = = > 0 π(i) i x π(j) j

97 An algorithm for solving minimum cost network flow problems: the network simplex Example (continued) The new spanning tree π(i) i - -6 π(j) x L={(,), (,)} U={(,), (,6)} j -0 6 c c 6 c' c' c' c' Node potentials computation: c' = c π( i) + π( j) = 0 ( i, j) T π() + π() = + + π() = 0 π() = 6 π() + π(6) = π(6) = 0 π(6) = 0 Optimality test: 6 = c = c = c = c 6 π() + π() = + > 0 π() + π() = > 0 π() + π() = + 6 < 0 π() + π(6) = > 0

98 An algorithm for solving minimum cost network flow problems: the network simplex (,8) (,) i (,) (,7) (,) (c, u ), l =0 (,) j (,) (,) (,6) 6 New enetering arc: c 6 =+8-0=>0, the maximum additional flow δ around the pivot cycle is, Arcs (,) e (,) are blocking We choose to remove the arc (,) from T 7 π(i) i - - x π(j) j

99 An algorithm for solving minimum cost network flow problems: the network simplex Example (continued) The new spanning tree 0 π(i) i x π(j) j c' π() = 0 c c c c c Node potentials computation: 6 6 = c π( i) + π( j) = 0 ( i, j) T π() + π() = 0 + π() = 0 π() = π() + π() = 0 + π() = 0 π() = π() + π() = + + π() = 0 π() = 8 π() + π(6) = π(6) = 0 π(6) = π() + π() = π() = 0 π() = 7 L={(,), (,)} U={(,), (,)} An optimal solution has been found Optimality test: c' c' c' c' = c = c = c = c π() + π() = π() + π() = π() + π() = π() + π() = > 0 < 0 < 0 > 0

SCHOOL OF ENGINEERING & BUILT ENVIRONMENT. Mathematics. An Introduction to Graph Theory

SCHOOL OF ENGINEERING & BUILT ENVIRONMENT. Mathematics. An Introduction to Graph Theory SCHOOL OF ENGINEERING & BUILT ENVIRONMENT Mathematics An Introduction to Graph Theory. Introduction. Definitions.. Vertices and Edges... The Handshaking Lemma.. Connected Graphs... Cut-Points and Bridges.

More information

Introduction to Mathematical Programming IE406. Lecture 16. Dr. Ted Ralphs

Introduction to Mathematical Programming IE406. Lecture 16. Dr. Ted Ralphs Introduction to Mathematical Programming IE406 Lecture 16 Dr. Ted Ralphs IE406 Lecture 16 1 Reading for This Lecture Bertsimas 7.1-7.3 IE406 Lecture 16 2 Network Flow Problems Networks are used to model

More information

Varying Applications (examples)

Varying Applications (examples) Graph Theory Varying Applications (examples) Computer networks Distinguish between two chemical compounds with the same molecular formula but different structures Solve shortest path problems between cities

More information

Discrete Mathematics and Probability Theory Fall 2013 Vazirani Note 7

Discrete Mathematics and Probability Theory Fall 2013 Vazirani Note 7 CS 70 Discrete Mathematics and Probability Theory Fall 2013 Vazirani Note 7 An Introduction to Graphs A few centuries ago, residents of the city of Königsberg, Prussia were interested in a certain problem.

More information

Math 776 Graph Theory Lecture Note 1 Basic concepts

Math 776 Graph Theory Lecture Note 1 Basic concepts Math 776 Graph Theory Lecture Note 1 Basic concepts Lectured by Lincoln Lu Transcribed by Lincoln Lu Graph theory was founded by the great Swiss mathematician Leonhard Euler (1707-178) after he solved

More information

Lecture 5: Graphs. Rajat Mittal. IIT Kanpur

Lecture 5: Graphs. Rajat Mittal. IIT Kanpur Lecture : Graphs Rajat Mittal IIT Kanpur Combinatorial graphs provide a natural way to model connections between different objects. They are very useful in depicting communication networks, social networks

More information

Graph theory: basic concepts

Graph theory: basic concepts Graph theory: basic concepts Graphs and networks allow modelling many different decision problems Graphs permit to represent relationships among different kinds of entities: Cities connected by roads Computers

More information

Graph Theory CS/Math231 Discrete Mathematics Spring2015

Graph Theory CS/Math231 Discrete Mathematics Spring2015 1 Graphs Definition 1 A directed graph (or digraph) G is a pair (V, E), where V is a finite set and E is a binary relation on V. The set V is called the vertex set of G, and its elements are called vertices

More information

6.2. Paths and Cycles

6.2. Paths and Cycles 6.2. PATHS AND CYCLES 85 6.2. Paths and Cycles 6.2.1. Paths. A path from v 0 to v n of length n is a sequence of n+1 vertices (v k ) and n edges (e k ) of the form v 0, e 1, v 1, e 2, v 2,..., e n, v n,

More information

8. The Postman Problems

8. The Postman Problems 8. The Postman Problems The Chinese postman problem (CPP) A postal carrier must pick up the mail at the post office, deliver the mail along blocks on the route, and finally return to the post office. To

More information

Theory of Computing. Lecture 10 MAS 714 Hartmut Klauck

Theory of Computing. Lecture 10 MAS 714 Hartmut Klauck Theory of Computing Lecture 10 MAS 714 Hartmut Klauck Seven Bridges of Königsberg Can one take a walk that crosses each bridge exactly once? Seven Bridges of Königsberg Model as a graph Is there a path

More information

Graph Theory. Part of Texas Counties.

Graph Theory. Part of Texas Counties. Graph Theory Part of Texas Counties. We would like to visit each of the above counties, crossing each county only once, starting from Harris county. Is this possible? This problem can be modeled as a graph.

More information

Copyright 2007 Pearson Addison-Wesley. All rights reserved. A. Levitin Introduction to the Design & Analysis of Algorithms, 2 nd ed., Ch.

Copyright 2007 Pearson Addison-Wesley. All rights reserved. A. Levitin Introduction to the Design & Analysis of Algorithms, 2 nd ed., Ch. Iterative Improvement Algorithm design technique for solving optimization problems Start with a feasible solution Repeat the following step until no improvement can be found: change the current feasible

More information

Chapter 11: Graphs and Trees. March 23, 2008

Chapter 11: Graphs and Trees. March 23, 2008 Chapter 11: Graphs and Trees March 23, 2008 Outline 1 11.1 Graphs: An Introduction 2 11.2 Paths and Circuits 3 11.3 Matrix Representations of Graphs 4 11.5 Trees Graphs: Basic Definitions Informally, a

More information

Discrete Mathematics and Probability Theory Fall 2009 Satish Rao,David Tse Note 8

Discrete Mathematics and Probability Theory Fall 2009 Satish Rao,David Tse Note 8 CS 70 Discrete Mathematics and Probability Theory Fall 2009 Satish Rao,David Tse Note 8 An Introduction to Graphs Formulating a simple, precise specification of a computational problem is often a prerequisite

More information

Solution for Homework set 3

Solution for Homework set 3 TTIC 300 and CMSC 37000 Algorithms Winter 07 Solution for Homework set 3 Question (0 points) We are given a directed graph G = (V, E), with two special vertices s and t, and non-negative integral capacities

More information

Methods and Models for Combinatorial Optimization Exact methods for the Traveling Salesman Problem

Methods and Models for Combinatorial Optimization Exact methods for the Traveling Salesman Problem Methods and Models for Combinatorial Optimization Exact methods for the Traveling Salesman Problem L. De Giovanni M. Di Summa The Traveling Salesman Problem (TSP) is an optimization problem on a directed

More information

Math 778S Spectral Graph Theory Handout #2: Basic graph theory

Math 778S Spectral Graph Theory Handout #2: Basic graph theory Math 778S Spectral Graph Theory Handout #: Basic graph theory Graph theory was founded by the great Swiss mathematician Leonhard Euler (1707-178) after he solved the Königsberg Bridge problem: Is it possible

More information

Introduction III. Graphs. Motivations I. Introduction IV

Introduction III. Graphs. Motivations I. Introduction IV Introduction I Graphs Computer Science & Engineering 235: Discrete Mathematics Christopher M. Bourke cbourke@cse.unl.edu Graph theory was introduced in the 18th century by Leonhard Euler via the Königsberg

More information

Discrete Optimization 2010 Lecture 5 Min-Cost Flows & Total Unimodularity

Discrete Optimization 2010 Lecture 5 Min-Cost Flows & Total Unimodularity Discrete Optimization 2010 Lecture 5 Min-Cost Flows & Total Unimodularity Marc Uetz University of Twente m.uetz@utwente.nl Lecture 5: sheet 1 / 26 Marc Uetz Discrete Optimization Outline 1 Min-Cost Flows

More information

Graphs and Network Flows IE411. Lecture 21. Dr. Ted Ralphs

Graphs and Network Flows IE411. Lecture 21. Dr. Ted Ralphs Graphs and Network Flows IE411 Lecture 21 Dr. Ted Ralphs IE411 Lecture 21 1 Combinatorial Optimization and Network Flows In general, most combinatorial optimization and integer programming problems are

More information

Source. Sink. Chapter 10: Iterative Programming Maximum Flow Problem. CmSc250 Intro to Algorithms

Source. Sink. Chapter 10: Iterative Programming Maximum Flow Problem. CmSc250 Intro to Algorithms Chapter 10: Iterative Programming Maximum Flow Problem CmSc20 Intro to Algorithms A flow network is a model of a system where some material is produced at its source, travels through the system, and is

More information

Lecture 10,11: General Matching Polytope, Maximum Flow. 1 Perfect Matching and Matching Polytope on General Graphs

Lecture 10,11: General Matching Polytope, Maximum Flow. 1 Perfect Matching and Matching Polytope on General Graphs CMPUT 675: Topics in Algorithms and Combinatorial Optimization (Fall 2009) Lecture 10,11: General Matching Polytope, Maximum Flow Lecturer: Mohammad R Salavatipour Date: Oct 6 and 8, 2009 Scriber: Mohammad

More information

Introduction to Graph Theory

Introduction to Graph Theory Introduction to Graph Theory Tandy Warnow January 20, 2017 Graphs Tandy Warnow Graphs A graph G = (V, E) is an object that contains a vertex set V and an edge set E. We also write V (G) to denote the vertex

More information

Discrete Mathematics for CS Spring 2008 David Wagner Note 13. An Introduction to Graphs

Discrete Mathematics for CS Spring 2008 David Wagner Note 13. An Introduction to Graphs CS 70 Discrete Mathematics for CS Spring 2008 David Wagner Note 13 An Introduction to Graphs Formulating a simple, precise specification of a computational problem is often a prerequisite to writing a

More information

Simple graph Complete graph K 7. Non- connected graph

Simple graph Complete graph K 7. Non- connected graph A graph G consists of a pair (V; E), where V is the set of vertices and E the set of edges. We write V (G) for the vertices of G and E(G) for the edges of G. If no two edges have the same endpoints we

More information

LECTURES 3 and 4: Flows and Matchings

LECTURES 3 and 4: Flows and Matchings LECTURES 3 and 4: Flows and Matchings 1 Max Flow MAX FLOW (SP). Instance: Directed graph N = (V,A), two nodes s,t V, and capacities on the arcs c : A R +. A flow is a set of numbers on the arcs such that

More information

Notes for Lecture 20

Notes for Lecture 20 U.C. Berkeley CS170: Intro to CS Theory Handout N20 Professor Luca Trevisan November 13, 2001 Notes for Lecture 20 1 Duality As it turns out, the max-flow min-cut theorem is a special case of a more general

More information

Lecture 3: Graphs and flows

Lecture 3: Graphs and flows Chapter 3 Lecture 3: Graphs and flows Graphs: a useful combinatorial structure. Definitions: graph, directed and undirected graph, edge as ordered pair, path, cycle, connected graph, strongly connected

More information

Network Design and Optimization course

Network Design and Optimization course Effective maximum flow algorithms Modeling with flows Network Design and Optimization course Lecture 5 Alberto Ceselli alberto.ceselli@unimi.it Dipartimento di Tecnologie dell Informazione Università degli

More information

CSE 417 Network Flows (pt 4) Min Cost Flows

CSE 417 Network Flows (pt 4) Min Cost Flows CSE 417 Network Flows (pt 4) Min Cost Flows Reminders > HW6 is due Monday Review of last three lectures > Defined the maximum flow problem find the feasible flow of maximum value flow is feasible if it

More information

Outline. 1 The matching problem. 2 The Chinese Postman Problem

Outline. 1 The matching problem. 2 The Chinese Postman Problem Outline The matching problem Maximum-cardinality matchings in bipartite graphs Maximum-cardinality matchings in bipartite graphs: The augmenting path algorithm 2 Let G = (V, E) be an undirected graph.

More information

Brief History. Graph Theory. What is a graph? Types of graphs Directed graph: a graph that has edges with specific directions

Brief History. Graph Theory. What is a graph? Types of graphs Directed graph: a graph that has edges with specific directions Brief History Graph Theory What is a graph? It all began in 1736 when Leonhard Euler gave a proof that not all seven bridges over the Pregolya River could all be walked over once and end up where you started.

More information

Graphs and Network Flows IE411. Lecture 13. Dr. Ted Ralphs

Graphs and Network Flows IE411. Lecture 13. Dr. Ted Ralphs Graphs and Network Flows IE411 Lecture 13 Dr. Ted Ralphs IE411 Lecture 13 1 References for Today s Lecture IE411 Lecture 13 2 References for Today s Lecture Required reading Sections 21.1 21.2 References

More information

Adjacent: Two distinct vertices u, v are adjacent if there is an edge with ends u, v. In this case we let uv denote such an edge.

Adjacent: Two distinct vertices u, v are adjacent if there is an edge with ends u, v. In this case we let uv denote such an edge. 1 Graph Basics What is a graph? Graph: a graph G consists of a set of vertices, denoted V (G), a set of edges, denoted E(G), and a relation called incidence so that each edge is incident with either one

More information

Crossing bridges. Crossing bridges Great Ideas in Theoretical Computer Science. Lecture 12: Graphs I: The Basics. Königsberg (Prussia)

Crossing bridges. Crossing bridges Great Ideas in Theoretical Computer Science. Lecture 12: Graphs I: The Basics. Königsberg (Prussia) 15-251 Great Ideas in Theoretical Computer Science Lecture 12: Graphs I: The Basics February 22nd, 2018 Crossing bridges Königsberg (Prussia) Now Kaliningrad (Russia) Is there a way to walk through the

More information

CPS 102: Discrete Mathematics. Quiz 3 Date: Wednesday November 30, Instructor: Bruce Maggs NAME: Prob # Score. Total 60

CPS 102: Discrete Mathematics. Quiz 3 Date: Wednesday November 30, Instructor: Bruce Maggs NAME: Prob # Score. Total 60 CPS 102: Discrete Mathematics Instructor: Bruce Maggs Quiz 3 Date: Wednesday November 30, 2011 NAME: Prob # Score Max Score 1 10 2 10 3 10 4 10 5 10 6 10 Total 60 1 Problem 1 [10 points] Find a minimum-cost

More information

Introduction to Engineering Systems, ESD.00. Networks. Lecturers: Professor Joseph Sussman Dr. Afreen Siddiqi TA: Regina Clewlow

Introduction to Engineering Systems, ESD.00. Networks. Lecturers: Professor Joseph Sussman Dr. Afreen Siddiqi TA: Regina Clewlow Introduction to Engineering Systems, ESD.00 Lecture 7 Networks Lecturers: Professor Joseph Sussman Dr. Afreen Siddiqi TA: Regina Clewlow The Bridges of Königsberg The town of Konigsberg in 18 th century

More information

by conservation of flow, hence the cancelation. Similarly, we have

by conservation of flow, hence the cancelation. Similarly, we have Chapter 13: Network Flows and Applications Network: directed graph with source S and target T. Non-negative edge weights represent capacities. Assume no edges into S or out of T. (If necessary, we can

More information

CS6702 GRAPH THEORY AND APPLICATIONS 2 MARKS QUESTIONS AND ANSWERS

CS6702 GRAPH THEORY AND APPLICATIONS 2 MARKS QUESTIONS AND ANSWERS CS6702 GRAPH THEORY AND APPLICATIONS 2 MARKS QUESTIONS AND ANSWERS 1 UNIT I INTRODUCTION CS6702 GRAPH THEORY AND APPLICATIONS 2 MARKS QUESTIONS AND ANSWERS 1. Define Graph. A graph G = (V, E) consists

More information

Graph Algorithms. A Brief Introduction. 高晓沨 (Xiaofeng Gao) Department of Computer Science Shanghai Jiao Tong Univ.

Graph Algorithms. A Brief Introduction. 高晓沨 (Xiaofeng Gao) Department of Computer Science Shanghai Jiao Tong Univ. Graph Algorithms A Brief Introduction 高晓沨 (Xiaofeng Gao) Department of Computer Science Shanghai Jiao Tong Univ. 目录 2015/5/7 1 Graph and Its Applications 2 Introduction to Graph Algorithms 3 References

More information

Mathematical and Algorithmic Foundations Linear Programming and Matchings

Mathematical and Algorithmic Foundations Linear Programming and Matchings Adavnced Algorithms Lectures Mathematical and Algorithmic Foundations Linear Programming and Matchings Paul G. Spirakis Department of Computer Science University of Patras and Liverpool Paul G. Spirakis

More information

6. Lecture notes on matroid intersection

6. Lecture notes on matroid intersection Massachusetts Institute of Technology 18.453: Combinatorial Optimization Michel X. Goemans May 2, 2017 6. Lecture notes on matroid intersection One nice feature about matroids is that a simple greedy algorithm

More information

GRAPH THEORY AND LOGISTICS

GRAPH THEORY AND LOGISTICS GRAPH THEORY AND LOGISTICS Maja Fošner and Tomaž Kramberger University of Maribor Faculty of Logistics Mariborska cesta 2 3000 Celje Slovenia maja.fosner@uni-mb.si tomaz.kramberger@uni-mb.si Abstract This

More information

Graph Theory. ICT Theory Excerpt from various sources by Robert Pergl

Graph Theory. ICT Theory Excerpt from various sources by Robert Pergl Graph Theory ICT Theory Excerpt from various sources by Robert Pergl What can graphs model? Cost of wiring electronic components together. Shortest route between two cities. Finding the shortest distance

More information

A NETWORK SIMPLEX ALGORITHM FOR SOLVING THE MINIMUM DISTRIBUTION COST PROBLEM. I-Lin Wang and Shiou-Jie Lin. (Communicated by Shu-Cherng Fang)

A NETWORK SIMPLEX ALGORITHM FOR SOLVING THE MINIMUM DISTRIBUTION COST PROBLEM. I-Lin Wang and Shiou-Jie Lin. (Communicated by Shu-Cherng Fang) JOURNAL OF INDUSTRIAL AND doi:10.3934/jimo.2009.5.929 MANAGEMENT OPTIMIZATION Volume 5, Number 4, November 2009 pp. 929 950 A NETWORK SIMPLEX ALGORITHM FOR SOLVING THE MINIMUM DISTRIBUTION COST PROBLEM

More information

Lecture Notes for IEOR 266: Graph Algorithms and Network Flows

Lecture Notes for IEOR 266: Graph Algorithms and Network Flows Lecture Notes for IEOR 266: Graph Algorithms and Network Flows Professor Dorit S. Hochbaum Contents 1 Introduction 1 1.1 Assignment problem.................................... 1 1.2 Basic graph definitions...................................

More information

Steiner Trees and Forests

Steiner Trees and Forests Massachusetts Institute of Technology Lecturer: Adriana Lopez 18.434: Seminar in Theoretical Computer Science March 7, 2006 Steiner Trees and Forests 1 Steiner Tree Problem Given an undirected graph G

More information

Fundamental Properties of Graphs

Fundamental Properties of Graphs Chapter three In many real-life situations we need to know how robust a graph that represents a certain network is, how edges or vertices can be removed without completely destroying the overall connectivity,

More information

Graphs (MTAT , 6 EAP) Lectures: Mon 14-16, hall 404 Exercises: Wed 14-16, hall 402

Graphs (MTAT , 6 EAP) Lectures: Mon 14-16, hall 404 Exercises: Wed 14-16, hall 402 Graphs (MTAT.05.080, 6 EAP) Lectures: Mon 14-16, hall 404 Exercises: Wed 14-16, hall 402 homepage: http://courses.cs.ut.ee/2012/graafid (contains slides) For grade: Homework + three tests (during or after

More information

Chapter 3: Paths and Cycles

Chapter 3: Paths and Cycles Chapter 3: Paths and Cycles 5 Connectivity 1. Definitions: Walk: finite sequence of edges in which any two consecutive edges are adjacent or identical. (Initial vertex, Final vertex, length) Trail: walk

More information

6.854J / J Advanced Algorithms Fall 2008

6.854J / J Advanced Algorithms Fall 2008 MIT OpenCourseWare http://ocw.mit.edu 6.854J / 18.415J Advanced Algorithms Fall 2008 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms. 18.415/6.854 Advanced

More information

Lecture 11: Maximum flow and minimum cut

Lecture 11: Maximum flow and minimum cut Optimisation Part IB - Easter 2018 Lecture 11: Maximum flow and minimum cut Lecturer: Quentin Berthet 4.4. The maximum flow problem. We consider in this lecture a particular kind of flow problem, with

More information

CHAPTER 10 GRAPHS AND TREES. Alessandro Artale UniBZ - artale/z

CHAPTER 10 GRAPHS AND TREES. Alessandro Artale UniBZ -  artale/z CHAPTER 10 GRAPHS AND TREES Alessandro Artale UniBZ - http://www.inf.unibz.it/ artale/z SECTION 10.1 Graphs: Definitions and Basic Properties Copyright Cengage Learning. All rights reserved. Graphs: Definitions

More information

Assignment 4 Solutions of graph problems

Assignment 4 Solutions of graph problems Assignment 4 Solutions of graph problems 1. Let us assume that G is not a cycle. Consider the maximal path in the graph. Let the end points of the path be denoted as v 1, v k respectively. If either of

More information

Outline: Finish uncapacitated simplex method Negative cost cycle algorithm The max-flow problem Max-flow min-cut theorem

Outline: Finish uncapacitated simplex method Negative cost cycle algorithm The max-flow problem Max-flow min-cut theorem Outline: Finish uncapacitated simplex method Negative cost cycle algorithm The max-flow problem Max-flow min-cut theorem Uncapacitated Networks: Basic primal and dual solutions Flow conservation constraints

More information

Classic Graph Theory Problems

Classic Graph Theory Problems Classic Graph Theory Problems Hiroki Sayama sayama@binghamton.edu The Origin Königsberg bridge problem Pregel River (Solved negatively by Euler in 176) Representation in a graph Can all the seven edges

More information

CHAPTER 10 GRAPHS AND TREES. Copyright Cengage Learning. All rights reserved.

CHAPTER 10 GRAPHS AND TREES. Copyright Cengage Learning. All rights reserved. CHAPTER 10 GRAPHS AND TREES Copyright Cengage Learning. All rights reserved. SECTION 10.1 Graphs: Definitions and Basic Properties Copyright Cengage Learning. All rights reserved. Graphs: Definitions and

More information

Advanced Operations Research Techniques IE316. Quiz 1 Review. Dr. Ted Ralphs

Advanced Operations Research Techniques IE316. Quiz 1 Review. Dr. Ted Ralphs Advanced Operations Research Techniques IE316 Quiz 1 Review Dr. Ted Ralphs IE316 Quiz 1 Review 1 Reading for The Quiz Material covered in detail in lecture. 1.1, 1.4, 2.1-2.6, 3.1-3.3, 3.5 Background material

More information

Linear Programming. Course review MS-E2140. v. 1.1

Linear Programming. Course review MS-E2140. v. 1.1 Linear Programming MS-E2140 Course review v. 1.1 Course structure Modeling techniques Linear programming theory and the Simplex method Duality theory Dual Simplex algorithm and sensitivity analysis Integer

More information

Discrete Mathematics

Discrete Mathematics Discrete Mathematics Lecturer: Mgr. Tereza Kovářová, Ph.D. tereza.kovarova@vsb.cz Guarantor: doc. Mgr. Petr Kovář, Ph.D. Department of Applied Mathematics, VŠB Technical University of Ostrava About this

More information

Let G = (V, E) be a graph. If u, v V, then u is adjacent to v if {u, v} E. We also use the notation u v to denote that u is adjacent to v.

Let G = (V, E) be a graph. If u, v V, then u is adjacent to v if {u, v} E. We also use the notation u v to denote that u is adjacent to v. Graph Adjacent Endpoint of an edge Incident Neighbors of a vertex Degree of a vertex Theorem Graph relation Order of a graph Size of a graph Maximum and minimum degree Let G = (V, E) be a graph. If u,

More information

GRAPHS, GRAPH MODELS, GRAPH TERMINOLOGY, AND SPECIAL TYPES OF GRAPHS

GRAPHS, GRAPH MODELS, GRAPH TERMINOLOGY, AND SPECIAL TYPES OF GRAPHS GRAPHS, GRAPH MODELS, GRAPH TERMINOLOGY, AND SPECIAL TYPES OF GRAPHS DR. ANDREW SCHWARTZ, PH.D. 10.1 Graphs and Graph Models (1) A graph G = (V, E) consists of V, a nonempty set of vertices (or nodes)

More information

NETWORK OPTIMIZATION MODELS

NETWORK OPTIMIZATION MODELS NETWORK OPTIMIZATION MODELS Network models Transportation, electrical and communication networks pervade our daily lives. Network representation are widely used in: Production, distribution, project planning,

More information

Theorem 2.9: nearest addition algorithm

Theorem 2.9: nearest addition algorithm There are severe limits on our ability to compute near-optimal tours It is NP-complete to decide whether a given undirected =(,)has a Hamiltonian cycle An approximation algorithm for the TSP can be used

More information

CSC 8301 Design & Analysis of Algorithms: Linear Programming

CSC 8301 Design & Analysis of Algorithms: Linear Programming CSC 8301 Design & Analysis of Algorithms: Linear Programming Professor Henry Carter Fall 2016 Iterative Improvement Start with a feasible solution Improve some part of the solution Repeat until the solution

More information

Ma/CS 6a Class 8: Eulerian Cycles

Ma/CS 6a Class 8: Eulerian Cycles Ma/CS 6a Class 8: Eulerian Cycles By Adam Sheffer The Bridges of Königsberg Can we travel the city while crossing every bridge exactly once? 1 How Graph Theory was Born Leonhard Euler 1736 Eulerian Cycle

More information

Chapter 5 Graph Algorithms Algorithm Theory WS 2012/13 Fabian Kuhn

Chapter 5 Graph Algorithms Algorithm Theory WS 2012/13 Fabian Kuhn Chapter 5 Graph Algorithms Algorithm Theory WS 2012/13 Fabian Kuhn Graphs Extremely important concept in computer science Graph, : node (or vertex) set : edge set Simple graph: no self loops, no multiple

More information

Lecture 22 Tuesday, April 10

Lecture 22 Tuesday, April 10 CIS 160 - Spring 2018 (instructor Val Tannen) Lecture 22 Tuesday, April 10 GRAPH THEORY Directed Graphs Directed graphs (a.k.a. digraphs) are an important mathematical modeling tool in Computer Science,

More information

Graph Theory. 1 Introduction to Graphs. Martin Stynes Department of Mathematics, UCC January 26, 2011

Graph Theory. 1 Introduction to Graphs. Martin Stynes Department of Mathematics, UCC   January 26, 2011 Graph Theory Martin Stynes Department of Mathematics, UCC email: m.stynes@ucc.ie January 26, 2011 1 Introduction to Graphs 1 A graph G = (V, E) is a non-empty set of nodes or vertices V and a (possibly

More information

Advanced Algorithms Class Notes for Monday, October 23, 2012 Min Ye, Mingfu Shao, and Bernard Moret

Advanced Algorithms Class Notes for Monday, October 23, 2012 Min Ye, Mingfu Shao, and Bernard Moret Advanced Algorithms Class Notes for Monday, October 23, 2012 Min Ye, Mingfu Shao, and Bernard Moret Greedy Algorithms (continued) The best known application where the greedy algorithm is optimal is surely

More information

CMPSCI 311: Introduction to Algorithms Practice Final Exam

CMPSCI 311: Introduction to Algorithms Practice Final Exam CMPSCI 311: Introduction to Algorithms Practice Final Exam Name: ID: Instructions: Answer the questions directly on the exam pages. Show all your work for each question. Providing more detail including

More information

Graphs: Definitions Trails, Paths, and Circuits Matrix Representations Isomorphisms. 11. Graphs and Trees 1. Aaron Tan. 30 October 3 November 2017

Graphs: Definitions Trails, Paths, and Circuits Matrix Representations Isomorphisms. 11. Graphs and Trees 1. Aaron Tan. 30 October 3 November 2017 11. Graphs and Trees 1 Aaron Tan 30 October 3 November 2017 1 The origins of graph theory are humble, even frivolous. Whereas many branches of mathematics were motivated by fundamental problems of calculation,

More information

Konigsberg Bridge Problem

Konigsberg Bridge Problem Graphs Konigsberg Bridge Problem c C d g A Kneiphof e D a B b f c A C d e g D a b f B Euler s Graph Degree of a vertex: the number of edges incident to it Euler showed that there is a walk starting at

More information

Maximum flows & Maximum Matchings

Maximum flows & Maximum Matchings Chapter 9 Maximum flows & Maximum Matchings This chapter analyzes flows and matchings. We will define flows and maximum flows and present an algorithm that solves the maximum flow problem. Then matchings

More information

and 6.855J March 6, Maximum Flows 2

and 6.855J March 6, Maximum Flows 2 5.08 and.855j March, 00 Maximum Flows Network Reliability Communication Network What is the maximum number of arc disjoint paths from s to t? How can we determine this number? Theorem. Let G = (N,A) be

More information

Graph Theory S 1 I 2 I 1 S 2 I 1 I 2

Graph Theory S 1 I 2 I 1 S 2 I 1 I 2 Graph Theory S I I S S I I S Graphs Definition A graph G is a pair consisting of a vertex set V (G), and an edge set E(G) ( ) V (G). x and y are the endpoints of edge e = {x, y}. They are called adjacent

More information

Intermediate Math Circles Wednesday, February 22, 2017 Graph Theory III

Intermediate Math Circles Wednesday, February 22, 2017 Graph Theory III 1 Eulerian Graphs Intermediate Math Circles Wednesday, February 22, 2017 Graph Theory III Let s begin this section with a problem that you may remember from lecture 1. Consider the layout of land and water

More information

How can we lay cable at minimum cost to make every telephone reachable from every other? What is the fastest route between two given cities?

How can we lay cable at minimum cost to make every telephone reachable from every other? What is the fastest route between two given cities? 1 Introduction Graph theory is one of the most in-demand (i.e. profitable) and heavily-studied areas of applied mathematics and theoretical computer science. May graph theory questions are applied in this

More information

Introduction to Graphs

Introduction to Graphs Introduction to Graphs Historical Motivation Seven Bridges of Königsberg Königsberg (now Kaliningrad, Russia) around 1735 Problem: Find a walk through the city that would cross each bridge once and only

More information

Graphs and Network Flows IE411 Lecture 20

Graphs and Network Flows IE411 Lecture 20 Graphs and Network Flows IE411 Lecture 20 Dr. Ted Ralphs IE411 Lecture 20 1 Network Simplex Algorithm Input: A network G = (N, A), a vector of capacities u Z A, a vector of costs c Z A, and a vector of

More information

Dieter Jungnickel (2008), Graphs, Networks and Algorithms, 3rd edition, which is available online via SpringerLink.

Dieter Jungnickel (2008), Graphs, Networks and Algorithms, 3rd edition, which is available online via SpringerLink. Lecture 1 First Steps in Graph Theory This lecture introduces Graph Theory, the main subject of the course, and includes some basic definitions as well as a number of standard examples. Reading: Some of

More information

Approximation Algorithms: The Primal-Dual Method. My T. Thai

Approximation Algorithms: The Primal-Dual Method. My T. Thai Approximation Algorithms: The Primal-Dual Method My T. Thai 1 Overview of the Primal-Dual Method Consider the following primal program, called P: min st n c j x j j=1 n a ij x j b i j=1 x j 0 Then the

More information

Graphs and Network Flows IE411. Lecture 20. Dr. Ted Ralphs

Graphs and Network Flows IE411. Lecture 20. Dr. Ted Ralphs Graphs and Network Flows IE411 Lecture 20 Dr. Ted Ralphs IE411 Lecture 20 1 Network Simplex Algorithm Input: A network G = (N, A), a vector of capacities u Z A, a vector of costs c Z A, and a vector of

More information

The simplex method and the diameter of a 0-1 polytope

The simplex method and the diameter of a 0-1 polytope The simplex method and the diameter of a 0-1 polytope Tomonari Kitahara and Shinji Mizuno May 2012 Abstract We will derive two main results related to the primal simplex method for an LP on a 0-1 polytope.

More information

DHANALAKSHMI COLLEGE OF ENGINEERING, CHENNAI

DHANALAKSHMI COLLEGE OF ENGINEERING, CHENNAI DHANALAKSHMI COLLEGE OF ENGINEERING, CHENNAI Department of Computer Science and Engineering CS6702 - GRAPH THEORY AND APPLICATIONS Anna University 2 & 16 Mark Questions & Answers Year / Semester: IV /

More information

Grade 7/8 Math Circles Graph Theory - Solutions October 13/14, 2015

Grade 7/8 Math Circles Graph Theory - Solutions October 13/14, 2015 Faculty of Mathematics Waterloo, Ontario N2L 3G1 Centre for Education in Mathematics and Computing Grade 7/8 Math Circles Graph Theory - Solutions October 13/14, 2015 The Seven Bridges of Königsberg In

More information

4 Integer Linear Programming (ILP)

4 Integer Linear Programming (ILP) TDA6/DIT37 DISCRETE OPTIMIZATION 17 PERIOD 3 WEEK III 4 Integer Linear Programg (ILP) 14 An integer linear program, ILP for short, has the same form as a linear program (LP). The only difference is that

More information

Assignment 1 Introduction to Graph Theory CO342

Assignment 1 Introduction to Graph Theory CO342 Assignment 1 Introduction to Graph Theory CO342 This assignment will be marked out of a total of thirty points, and is due on Thursday 18th May at 10am in class. Throughout the assignment, the graphs are

More information

Chapter 2 Graphs. 2.1 Definition of Graphs

Chapter 2 Graphs. 2.1 Definition of Graphs Chapter 2 Graphs Abstract Graphs are discrete structures that consist of vertices and edges connecting some of these vertices. Graphs have many applications in Mathematics, Computer Science, Engineering,

More information

TWO CONTRIBUTIONS OF EULER

TWO CONTRIBUTIONS OF EULER TWO CONTRIBUTIONS OF EULER SIEMION FAJTLOWICZ. MATH 4315 Eulerian Tours. Although some mathematical problems which now can be thought of as graph-theoretical, go back to the times of Euclid, the invention

More information

8 Matroid Intersection

8 Matroid Intersection 8 Matroid Intersection 8.1 Definition and examples 8.2 Matroid Intersection Algorithm 8.1 Definitions Given two matroids M 1 = (X, I 1 ) and M 2 = (X, I 2 ) on the same set X, their intersection is M 1

More information

Some Graph Theory for Network Analysis. CS 249B: Science of Networks Week 01: Thursday, 01/31/08 Daniel Bilar Wellesley College Spring 2008

Some Graph Theory for Network Analysis. CS 249B: Science of Networks Week 01: Thursday, 01/31/08 Daniel Bilar Wellesley College Spring 2008 Some Graph Theory for Network Analysis CS 9B: Science of Networks Week 0: Thursday, 0//08 Daniel Bilar Wellesley College Spring 008 Goals this lecture Introduce you to some jargon what we call things in

More information

Algorithms and Data Structures

Algorithms and Data Structures Algorithms and Data Structures PD Dr. rer. nat. habil. Ralf Peter Mundani Computation in Engineering / BGU Scientific Computing in Computer Science / INF Summer Term 08 Part : Graphs The four colour problem

More information

Outline. Combinatorial Optimization 2. Finite Systems of Linear Inequalities. Finite Systems of Linear Inequalities. Theorem (Weyl s theorem :)

Outline. Combinatorial Optimization 2. Finite Systems of Linear Inequalities. Finite Systems of Linear Inequalities. Theorem (Weyl s theorem :) Outline Combinatorial Optimization 2 Rumen Andonov Irisa/Symbiose and University of Rennes 1 9 novembre 2009 Finite Systems of Linear Inequalities, variants of Farkas Lemma Duality theory in Linear Programming

More information

5. Consider the tree solution for a minimum cost network flow problem shown in Figure 5.

5. Consider the tree solution for a minimum cost network flow problem shown in Figure 5. FIGURE 1. Data for a network flow problem. As usual the numbers above the nodes are supplies (negative values represent demands) and numbers shown above the arcs are unit shipping costs. The darkened arcs

More information

Mathematical Tools for Engineering and Management

Mathematical Tools for Engineering and Management Mathematical Tools for Engineering and Management Lecture 8 8 Dec 0 Overview Models, Data and Algorithms Linear Optimization Mathematical Background: Polyhedra, Simplex-Algorithm Sensitivity Analysis;

More information

Integer Programming Theory

Integer Programming Theory Integer Programming Theory Laura Galli October 24, 2016 In the following we assume all functions are linear, hence we often drop the term linear. In discrete optimization, we seek to find a solution x

More information

Matching and Planarity

Matching and Planarity Matching and Planarity Po-Shen Loh June 010 1 Warm-up 1. (Bondy 1.5.9.) There are n points in the plane such that every pair of points has distance 1. Show that there are at most n (unordered) pairs of

More information

Network models and graph theory

Network models and graph theory Network models and graph theory G. Ferrari Trecate Dipartimento di Ingegneria Industriale e dell Informazione (DIII) Università degli Studi di Pavia Industrial Automation Ferrari Trecate (DII) Network

More information