Optimization: principles and algorithms, by Michel Bierlaire
runFlowDecomposition.m
Go to the documentation of this file.
1 %> \file
2 %> Run the flow decomposition algorithm on the examples represented in Figures 21.14 and 21.19 of \cite Bier15-book
3 %>
4 %> @note Calls \ref flowDecomposition
5 %>
6 %> @ingroup Running
7 %> @author Michel Bierlaire
8 %> @date Sun Mar 29 17:31:46 2015
9 %> @ingroup chap21
10 
11 A = [0 1 0 0 0 0 0 0 ;
12  0 0 2 3 0 0 0 0 ;
13  4 0 0 0 5 0 0 0 ;
14  0 6 0 0 7 0 0 0 ;
15  0 0 0 8 0 0 0 0 ;
16  0 0 0 0 0 0 9 0 ;
17  0 0 0 0 0 10 0 0 ;
18  0 0 0 0 0 0 0 0 ] ;
19 
20 
21 flow = [ 4 ; # (1,2)
22  0 ; # (2,3)
23  1.5 ; # (2,4)
24  1 ; # (3,1)
25  0 ; # (3,5)
26  -2.5 ; # (4,2)
27  4 ; # (4,5)
28  1 ; # (5,4)
29  2 ; # (6,7)
30  0 # (7,6)
31  ];
32 
33 simplePathFlows = flowDecomposition(A,flow)
34 
35 
36 printf("***********************\n") ;
37 
38 A = [0 1 0 2 0 0 0 0 0 ;
39  0 0 3 0 4 0 0 0 0 ;
40  0 0 0 0 0 5 0 0 0 ;
41  0 0 0 0 6 0 7 0 0 ;
42  0 8 0 0 0 9 0 0 0 ;
43  0 0 0 0 0 0 0 0 10 ;
44  0 0 0 0 0 0 0 11 0 ;
45  0 0 0 0 12 0 0 0 13 ;
46  0 0 0 0 0 0 0 0 0 ] ;
47 
48 flow = [ 3 ; #1(1,2)
49  7 ; #2(1,4)
50  8 ; #3(2,3)
51  2 ; #4(2,5)
52  8 ; #5(3,6)
53  3 ; #6(4,5)
54  4 ; #7(4,7)
55  7 ; #8(5,2)
56  2 ; #9(5,6)
57  10 ; #10(6,9)
58  4 ; #11(7,8)
59  4 ; #12(8,5)
60  0 #13(8,9)
61  ];
62 
63 simplePathFlows = flowDecomposition(A,flow)
64 
function flowDecomposition(in adj, in flow)
Decompose a flow vector into simple path flows.
Copyright 2015-2016 Michel Bierlaire