Optimization: principles and algorithms, by Michel Bierlaire
runTransportationTrans.m
Go to the documentation of this file.
1 %> \file
2 %> Solve the transportation problem as a transhipment problem (Example 22.12 od \cite Bier15-book
3 %>
4 %> Calls \ref transhipment
5 %>
6 %> @ingroup Running
7 %> @ingroup chap22
8 %> @author Michel Bierlaire
9 %> @date Sat Apr 11 11:28:52 2015
10 
11 adj = [ 0 0 0 1 2 3 4 ;
12  0 0 0 5 6 7 8 ;
13  0 0 0 9 10 11 12 ;
14  0 0 0 0 0 0 0 ;
15  0 0 0 0 0 0 0 ;
16  0 0 0 0 0 0 0 ;
17  0 0 0 0 0 0 0 ];
18 
19 cost = [ 18 ; 6 ; 10 ; 9 ; 9 ; 16 ; 13 ; 7 ; 14 ; 9 ; 16 ; 5 ];
20 lb = [ 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ] ;
21 ub = [ 16513 ; 16513 ; 16513 ; 16513 ; 16513 ; 16513 ; 16513 ; 16513 ; 16513 ; 16513 ; 16513 ; 16513 ] ;
22 
23 supply = [ 3110 ; 3198 ; 10205 ; -8961 ; -3777 ; -2517 ; -1258 ] ;
24 
25 useGlpk = 0 ;
26 [x, copt] = transhipment(adj,cost,lb,ub,supply,useGlpk)
27 
28 useGlpk = 1 ;
29 [x, copt] = transhipment(adj,cost,lb,ub,supply,useGlpk)
30 
function transhipment(in adj, in cost, in lb, in ub, in supply, in useGlpk)
Solve the transhipment problem with bound constraints.
Copyright 2015-2018 Michel Bierlaire