1 Transportation problem The transportation problem seeks the determination of a minimum cost transportation plan for a single commodity from a number.

Slides:



Advertisements
Similar presentations
Crew Pairing Optimization with Genetic Algorithms
Advertisements

Local Search Algorithms
Constraint Optimization We are interested in the general non-linear programming problem like the following Find x which optimizes f(x) subject to gi(x)
1 Material to Cover  relationship between different types of models  incorrect to round real to integer variables  logical relationship: site selection.
School of Computer Science
Operations Research Assistant Professor Dr. Sana’a Wafa Al-Sayegh 2 nd Semester ITGD4207 University of Palestine.
Linear Algebra Applications in Matlab ME 303. Special Characters and Matlab Functions.
Transportation Problem (TP) and Assignment Problem (AP)
ITGD4207 Operations Research
Genetic Algorithms Contents 1. Basic Concepts 2. Algorithm
1 9. S EQUENCING C ONSTRUCTION T ASKS Objective: To understand the problem of sequencing tasks in a manufacturing system, and the methods of finding optimal.
Chapter 2 Matrices Finite Mathematics & Its Applications, 11/e by Goldstein/Schneider/Siegel Copyright © 2014 Pearson Education, Inc.
1.2 Row Reduction and Echelon Forms
Linear Equations in Linear Algebra
Content Based Image Clustering and Image Retrieval Using Multiple Instance Learning Using Multiple Instance Learning Xin Chen Advisor: Chengcui Zhang Department.
Non-Linear Problems General approach. Non-linear Optimization Many objective functions, tend to be non-linear. Design problems for which the objective.
The Transportation and Assignment Problems
Goldstein/Schnieder/Lay: Finite Math & Its Applications, 9e 1 of 86 Chapter 2 Matrices.
COMP305. Part II. Genetic Algorithms. Genetic Algorithms.
COMP305. Part II. Genetic Algorithms. Genetic Algorithms.
COMP305. Part II. Genetic Algorithms. Genetic Algorithms.
EAs for Combinatorial Optimization Problems BLG 602E.
Linear Programming Applications
Finite Mathematics & Its Applications, 10/e by Goldstein/Schneider/SiegelCopyright © 2010 Pearson Education, Inc. 1 of 86 Chapter 2 Matrices.
Chapter 6: Transform and Conquer Genetic Algorithms The Design and Analysis of Algorithms.
INDR 262 INTRODUCTION TO OPTIMIZATION METHODS LINEAR ALGEBRA INDR 262 Metin Türkay 1.
Genetic Algorithm.
Chapter 3 Linear Programming Methods 高等作業研究 高等作業研究 ( 一 ) Chapter 3 Linear Programming Methods (II)
1. The Simplex Method.
Slides are based on Negnevitsky, Pearson Education, Lecture 12 Hybrid intelligent systems: Evolutionary neural networks and fuzzy evolutionary systems.
Solving the Concave Cost Supply Scheduling Problem Xia Wang, Univ. of Maryland Bruce Golden, Univ. of Maryland Edward Wasil, American Univ. Presented at.
Section 4.1 Vectors in ℝ n. ℝ n Vectors Vector addition Scalar multiplication.
Simplex method (algebraic interpretation)
Chapter 7 Transportation, Assignment & Transshipment Problems
Zorica Stanimirović Faculty of Mathematics, University of Belgrade
More on Heuristics Genetic Algorithms (GA) Terminology Chromosome –candidate solution - {x 1, x 2,...., x n } Gene –variable - x j Allele –numerical.
Applying Genetic Algorithm to the Knapsack Problem Qi Su ECE 539 Spring 2001 Course Project.
1 Combinatorial Problem. 2 Graph Partition Undirected graph G=(V,E) V=V1  V2, V1  V2=  minimize the number of edges connect V1 and V2.
Christoph F. Eick: Using EC to Solve Transportation Problems Transportation Problems.
Exact and heuristics algorithms
Linear Programming Revised Simplex Method, Duality of LP problems and Sensitivity analysis D Nagesh Kumar, IISc Optimization Methods: M3L5.
Genetic Algorithms Przemyslaw Pawluk CSE 6111 Advanced Algorithm Design and Analysis
Two Discrete Optimization Problems Problem: The Transportation Problem.
1 Network Models Transportation Problem (TP) Distributing any commodity from any group of supply centers, called sources, to any group of receiving.
Genetic Algorithms What is a GA Terms and definitions Basic algorithm.
IT Applications for Decision Making. Operations Research Initiated in England during the world war II Make scientifically based decisions regarding the.
GENETIC ALGORITHM Basic Algorithm begin set time t = 0;
N- Queens Solution with Genetic Algorithm By Mohammad A. Ismael.
OR  Now, we look for other basic feasible solutions which gives better objective values than the current solution. Such solutions can be examined.
Genetic Algorithms. Underlying Concept  Charles Darwin outlined the principle of natural selection.  Natural Selection is the process by which evolution.
Resource-Constrained Project Scheduling Problem (RCPSP)
1 Combinatorial Problem. 2 Graph Partition Undirected graph G=(V,E) V=V1  V2, V1  V2=  minimize the number of edges connect V1 and V2.
1 1.2 Linear Equations in Linear Algebra Row Reduction and Echelon Forms © 2016 Pearson Education, Ltd.
1 Comparative Study of two Genetic Algorithms Based Task Allocation Models in Distributed Computing System Oğuzhan TAŞ 2005.
(iii) Simplex method - I D Nagesh Kumar, IISc Water Resources Planning and Management: M3L3 Linear Programming and Applications.
Genetic Algorithms. Solution Search in Problem Space.
 Presented By: Abdul Aziz Ghazi  Roll No:  Presented to: Sir Harris.
 Negnevitsky, Pearson Education, Lecture 12 Hybrid intelligent systems: Evolutionary neural networks and fuzzy evolutionary systems n Introduction.
The Transportation and Assignment Problems
Linear Programming Revised Simplex Method, Duality of LP problems and Sensitivity analysis D Nagesh Kumar, IISc Optimization Methods: M3L5.
Special Cases In Linear Programming
Linear Algebra Lecture 4.
The Transportation Model
Numerical Analysis Lecture 16.
Chapter 7 Transportation, Assignment & Transshipment Problems
Linear Equations in Linear Algebra
The N-Queens Problem Search The N-Queens Problem Most slides from Milos Hauskrecht.
Chapter 1. Formulations.
Linear Equations in Linear Algebra
Prepared by Po-Chuan on 2016/05/24
Presentation transcript:

1 Transportation problem The transportation problem seeks the determination of a minimum cost transportation plan for a single commodity from a number of sources to a number of destinations. It requires the specification of the level of supply at each source, the amount of demand at each destination, and the transportation cost from each source to each destination. The transportation problem is linear if the cost on a route is directly proportional to the amount transported; otherwise it is nonlinear.

2 Assume there are n sources and k destinations. The amount of supply at source i is sour(i) and the demand at destination j is dest(j). The unit transportation cost between source i and destination j is cost(i,j). If x(i,j) is the amount transported from source i to destination j then the transportation problem is given as min  i,j f(i,j) s.t.  j x(i,j)  sour(i) i=1,2, ,n  i x(i,j)  dest(j) j=1,2, ,k x(i,j)  0 i=1,2, ,n and j=1,2, ,k If f(i,j)=cost(i,j)*x(i,j) for all i and j, the problem is linear.

3 The above problem implies that the total supply  sour(i) must at least equal total demand  dest(j). When the total supply equals the total demand, the resulting formulation is called a balanced transportation problem. It differs from the above only in that all the corresponding constraints are equations. That is  j x(i,j)=sour(i) i=1,2, ,n  i x(i,j)=dest(j) j=1,2, ,k If all sour(i) and dest(j) are integers any optimal solution to a balanced linear transportation problem is an integer solution, i.e., all x(i,j) are integers. Moreover the number of positive integers among x(i,j) is at most k+n-1. In this section we assume a balanced transportation problem.

4 An example Assume 3 sources and 4 destinations. The supply is sour(1)=15, sour(2)=25, sour(3)=5 The demand is dest(1)=5, dest(2)=15, dest(3)=15, dest(4)=10 Note: the total supply and demand equal 45. The unit transportation cost cost(i,j) is given as

5 The optimal solution is shown below The total cost is 315.

6 Classical genetic algorithms A straightforward approach in defining the chromosome for a solution in the transportation problem is to create a vector (v(1), ,v(p)) where p=n  k. Each component v(i) represents an integer associated with row j and column m in the allocation matrix, where j=  (i-1)/k+1  and m=(i-1) mod k+1.

7 Constraint satisfaction It is clear that every solution vector must satisfy the following: v(q)  0 for all q=1,2, , n  k v(c  k+1)+v(c  k+2)+  +v(c  k+k)=sour(c+1) for c=0,1, ,n-1 v(m)+v(m+k)+v(m+2k)+  =dest(m) for m=1,2, ,k

8 Evaluation function fitness=  v(i)cost(j,m) where j=  (i-1)/k+1  and m=(i-1) mod k+1.

9 Genetic operators There is no natural definition of genetic operators the transportation problem with the above representation. Mutation is usually defined as a change in a single gene in a solution vector. This, for our problems, would trigger a series of changes in different places (at least three other changes) in order to maintain the constraint equalities. The situation is even worse if we try to define a crossover operator. Conclusion: the above vector representation is not the most suitable for defining genetic operators in our problems.

10 Incorporating problem-specific knowledge Can we improve the representation of a solution while preserving the basic structure of this vector representation? The answer is yes, but we have to incorporate problem- specific knowledge into the representation.

11 Initialization The following procedure will create a matrix of at most k+n-1 non-zero elements such that all constraints are satisfied. procedure initialization set all numbers from 1 to k  n as unvisited repeat select an unvisited random number q from 1 to k  n and set it as visited (row)i=  (q-1)/k+1  (column)j=(q-1) mod k+1 val=min(sour[i],dest[j]) set v(i,j)=val sour[i]=sour[i]-val dest[j]=dest[j]-val until all numbers are visited

12 Assume 3 sources and 4 destinations. The supply is sour(1)=15, sour(2)=25, sour(3)=5 The demand is dest(1)=5, dest(2)=15, dest(3)=15, dest(4)=

13 The first random number is 10. This means row number i=3 and column number j=2. The val=min(sour[3],dest[2])=5, so v(3,2)=5. After the first iteration, sour[3]=0 and dest[2]= The next three random numbers are 8,5, and 3. What is the resulting matrix?

The random numbers is 8 (corresponding to row 2 and column 4)

The random numbers is 5 (corresponding to row 2 and column 1)

The random numbers is 3 (corresponding to row 1 and column 3)

17 If the further sequence of random number is 1,11,4,12,7,6,9,2, the final matrix produced is

18 This technique can generate any feasible solution that contains at most k+n-1 non-zero integer elements. It will not generate other solutions which, though feasible, do not share this characteristic. The initialization procedure would certainly have to be modified when we attempt to solve non-linear versions of the transportation problems.

19 The knowledge of the problem and its solution characteristic gives us an opportunity to represent a solution to the transportation problem as a vector. A solution vector will be a sequence of n  k distinct integers from the range, which (according to the procedure initialization) would produce an acceptable solution. In other words we would view a solution-vector as a permutation of numbers, and we would look for particular permutations which correspond to the optimal solution.

20 Constraint satisfaction Any permutation of k  n distinct numbers produces a unique solution which satisfies all constraints. This is guaranteed by procedure initialization.

21 Evaluation function This is relatively easy. Any permutation would correspond to a unique matrix. The evaluation function is  i,j v(i,j)  cost(i,j)

22 Genetic operators Inversion: any solution vector (x(1),x(2), , x(q)) (q=k  n) can be easily inverted into another solution vector (x(q), x(q-1), , x(1)) Swap: any two elements of a solution vector, say x(i) and x(j) can be swapped easily resulting in another solution vector. Crossover: PMX, CX, OX

23 A matrix as representation structure Perhaps the most natural representation of a solution for the transportation problem is a two dimensional structure. After all, this is how the problem is presented and solved by hand. In other words, a matrix V=(v(i,j)) (1  i  k, 1  j  n) may represent a solution.

24 Constraint satisfaction Every solution matrix V=(v(i,j)) should satisfy the following:  j v(i,j)=sour(i) i=1,2, ,k  i v(i,j)=dest(j) j=1,2, ,n v(i,j)  0 i=1,2, ,k and j=1,2, ,n This is similar to the set of constraints in the straightforward approach, but the constraints are expressed in an easier and more natural way.

25 Mutation Assume that {i(1), i(2), , i(p)} is a subset of {1,2, ,k} and {j(1),j(2), ,j(q)} is a subset of {1,2, ,n} such that 2  p  k, 2  q  n. Let us consider the matrix V=(v(i,j)). We can create a p  q submatrix W=(w(i,j)) from all elements of the matrix V in the following way: an element v(i,j)  V is in W if and only if i  {i(1), i(2), , i(p)} and j  {j(1),j(2), ,j(q)}. If i=i(r) and j=j(s) then the element v(i,j) is placed in the r-th row and s-th column of the matrix W.

26 We assign new values sour_w(i) and dest_w(j) (1  i  p, 1  j  q) for matrix W: sour_w(i)=  j  {j(1),  j(q)} v(i,j) 1  i  p dest_w(j)=  i  {i(1),  i(p)} v(i,j) 1  j  q We then use the procedure initialization to assign new values too the matrix W such that all constraints sour_w(i) and dest_w(j) are satisfied. After that we replace appropriate elements of matrix V by a new elements from the matrix W. In this way all global constraints (sour(i) and dest(j)) are preserved.

27 Example Given a problem with 4 sources and 5 destinations and the following constraints: sour(1)=8, sour(2)=4, sour(3)=12, sour(4)=6 dest(1)=3, dest(2)=5, dest(3)=10, dest(4)=7, dest(5)=5

28 The following matrix V is selected as a parent for mutation

29 Select (at random) the two rows{2,4} and three columns {2,3,5}. The corresponding submatrix W is Note that sour_w(1)=4, sour_w(2)=3, dest_w(1)=5, dest_w(2)=0, dest_w(3)=2. After the reinitialization, the matrix W may get the following values

30 So finally the offspring of matrix V after mutation is

31 Crossover Assume that two matrices V1=(v1(i,j)) and V2=(v2(i,j)) are selected as parents for the crossover operation. Create two temporary matrices DIV=(div(i,j)) and REM=(rem(i,j)) in the following way: div(i,j)=  (v1(i,j)+v2(i,j))/2  rem(i,j)=(v1(i,j)+v2(i,j)) mod 2 Matrix DIV keeps rounded average values from both parents, the matrix REM keeps track of whether any rounding was necessary.

32 Matrix REM has some interesting properties: the number of 1s in each row and each column is even. In other words, the values of sour_REM(i) and dest_REM(j) are even integers. We use this property to transform the matrix REM into two matrices REM1 and REM2 such that REM=REM1+REM2 sour_REM1(i)=sour_REM2(i)=sour_REM(i)/2 dest_REM1(j)=dest_REM2(j)=dest_REM(j)/2 Then we produce two offspring of V1 and V2 V3=DIV+REM1 V4=DIV+REM2

33 Example Given a problem with 4 sources and 5 destinations and the following constraints: sour(1)=8, sour(2)=4, sour(3)=12, sour(4)=6 dest(1)=3, dest(2)=5, dest(3)=10, dest(4)=7, dest(5)=5

34 Assume the following matrices V1 and V2 are selected as parents V1V The matrices DIV and REM are DIVREM

35 DIVREM The two matrices REM1 and REM2 are REM1REM

36 Finally two offspring V3 and V4 are V3V

37 Job shop problem n/m JSP: It is a production scheduling problem in which n jobs must be processed in m machines. A job is a set of tasks. Every task can be labeled by three numbers: i is the job number, j is the task number and k is the machine number. The following is a 5/3 JSP: Job1: 1,1,2 1,2,3 1,3,3 1,4,2, 1,5,2 Job2: 2,1,1 2,2,2 2,3,1 2,4,2 Job3: 3,1,1 3,2,3 Job4: 4,1,1 4,2,2 4,3,1 4,4,1 4,5,3 Job5: 5,1,3 5,2,2 5,3,3

38 Representation The schedule can be represented by a set of permutations.Each permutation stands for the task carried out by the machine. chromosome={m1,m2,m3} m1={3,1,1 2,1,1 2,3,1 4,1,1 4,3,1 4,4,1} m2={1,1,2 1,4,2 2,2,2 1,5,2 4,2,2 2,4,2 5,2,2} m3={1,2,3 3,2,3 5,1,3 1,3,3 5,3,3 4,5,3}

39 Fitness function The total cost according to the chromosome

40 Initialization while(not all the jobs are finished) { time forward; for(every machine) if (the machine is idle || the task is finished) the machine is available;

41 for(every machine) if(the machine is available) { calculate the available task set; if(the available task set is not empty) choose a new task and set the machine as unavailable; } The available task set contains the tasks that all the pre- tasks are finished.

42 Genetic operators Swap: any two elements of a machine can be swapped easily and check the feasibility Modified-OX: choose the crossover points in one machine and calculate the similar crossover points (the beginning time is similar for the first point while the ending time is similar for the second point) for other machines. Then do like normal OX operator.