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

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

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

Varying Applications (examples)

Discrete Mathematics and Probability Theory Fall 2013 Vazirani Note 7

Math 776 Graph Theory Lecture Note 1 Basic concepts

Lecture 5: Graphs. Rajat Mittal. IIT Kanpur

Graph theory: basic concepts

Graph Theory CS/Math231 Discrete Mathematics Spring2015

6.2. Paths and Cycles

8. The Postman Problems

Theory of Computing. Lecture 10 MAS 714 Hartmut Klauck

Graph Theory. Part of Texas Counties.

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

Chapter 11: Graphs and Trees. March 23, 2008

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

Solution for Homework set 3

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

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

Introduction III. Graphs. Motivations I. Introduction IV

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

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

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

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

Introduction to Graph Theory

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

Simple graph Complete graph K 7. Non- connected graph

LECTURES 3 and 4: Flows and Matchings

Notes for Lecture 20

Lecture 3: Graphs and flows

Network Design and Optimization course

CSE 417 Network Flows (pt 4) Min Cost Flows

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

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

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

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.

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

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

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

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

CS6702 GRAPH THEORY AND APPLICATIONS 2 MARKS QUESTIONS AND ANSWERS

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

Mathematical and Algorithmic Foundations Linear Programming and Matchings

6. Lecture notes on matroid intersection

GRAPH THEORY AND LOGISTICS

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

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

Lecture Notes for IEOR 266: Graph Algorithms and Network Flows

Steiner Trees and Forests

Fundamental Properties of Graphs

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

Chapter 3: Paths and Cycles

6.854J / J Advanced Algorithms Fall 2008

Lecture 11: Maximum flow and minimum cut

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

Assignment 4 Solutions of graph problems

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

Classic Graph Theory Problems

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

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

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

Discrete Mathematics

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.

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

NETWORK OPTIMIZATION MODELS

Theorem 2.9: nearest addition algorithm

CSC 8301 Design & Analysis of Algorithms: Linear Programming

Ma/CS 6a Class 8: Eulerian Cycles

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

Lecture 22 Tuesday, April 10

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

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

CMPSCI 311: Introduction to Algorithms Practice Final Exam

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

Konigsberg Bridge Problem

Maximum flows & Maximum Matchings

and 6.855J March 6, Maximum Flows 2

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

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

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?

Introduction to Graphs

Graphs and Network Flows IE411 Lecture 20

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

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

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

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

DHANALAKSHMI COLLEGE OF ENGINEERING, CHENNAI

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

4 Integer Linear Programming (ILP)

Assignment 1 Introduction to Graph Theory CO342

Chapter 2 Graphs. 2.1 Definition of Graphs

TWO CONTRIBUTIONS OF EULER

8 Matroid Intersection

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

Algorithms and Data Structures

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

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

Mathematical Tools for Engineering and Management

Integer Programming Theory

Matching and Planarity

Network models and graph theory

Transcription:

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

Introduction to Graph Theory

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.

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

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?

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.

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.

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

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() = {, } δ() = {(,), (,), (,)}

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,), (,)}

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

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

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

Definitions A directed cycle 0 An undirected cycle 0

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

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

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) = {(,), (,), (,)}

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) ={(,)}

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

Definitions A forest is a graph withouth cycles 0 0

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

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

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

A distribution problem: Minimum Cost (Network) Flow Problem

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.

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.

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

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)

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

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

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

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

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

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.

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.

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.

Cost optimization and production planning Plants 00 00 00 Production Capacity (ton/year) Customers 00 80 Demand (ton/year) Transportation and production/inventory costs (thousands of Euros per ton) Warehouse Warehouse Customer Customer Plant.0.0.0.0 Plant.0.0 8.0 9.0 Plant.0 0. 0.0 8.0 Warehouse - -.0.0 Warehouse - -.0 7.0

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 00 6 00 00 00 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

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.0.0.0.0 Plant.0.0 8.0 9.0 Plant.0 0. 0.0 8.0 Warehouse - -.0.0 Warehouse - -.0 7.0

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 00 6 00 00 00 Production Capacity (ton/year) 7 80 Demand (ton/year)

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 00 6 00 00 00 Production Capacity (ton/year) 7 80 8 0 Demand (ton/year) We introduce a dummy demand node with value 600-80=0 connected to the source nodes (i.e., the plants) with arcs with maximum capacity 0 and null cost

Formulating the problem by Excel

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

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

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

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.

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

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

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.

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

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

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

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

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

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 (,)

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

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

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

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.

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.

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.

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.

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

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

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

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

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 )

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.

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

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.

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.

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

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.

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

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

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

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

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' = 0 0 0 ( i, ( i, ( i, j) T j) L j) U

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

An algorithm for solving minimum cost network flow problems: the network simplex Proof (continued) From conditions we have min... c' c' c' = 0 0 0 ( 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.

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.

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.

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]

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.

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

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

An algorithm for solving minimum cost network flow problems: the network simplex Selection of the entering arc Optimality conditions:... c' c' c' = 0 0 0 ( 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

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

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

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

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

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

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

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,)

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 π() = 8... 0 6 π(i) i - - x π(j) j -8 - -9 6

An algorithm for solving minimum cost network flow problems: the network simplex - -8 6 0 π(i) i - - π(j) x L={(,), (,)} U={(,), (,6)} j -9 6 0 6 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) - -8 - - -9 6 c' c' c' c' 6 = c = c = c = c 6 π() + π() = + > 0 π() + π() = + 8 > 0 π() + π() = + = > 0 π() + π(6) = + 8 9 = > 0 π(i) i x π(j) j

An algorithm for solving minimum cost network flow problems: the network simplex Example (continued) The new spanning tree - -8 7 0 π(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 + π(6) = 0 π(6) = 0 Optimality test: 6 = c = c = c = c 6 π() + π() = + > 0 π() + π() = + 6 8 > 0 π() + π() = + 6 < 0 π() + π(6) = + 8 0 > 0

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 -8-6 -0 6

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