Optimization: principles and algorithms, by Michel Bierlaire
runSimpleCycle.m
Go to the documentation of this file.
1 %> \file
2 %> Run the algorithm extracting cycle flow vector on the example represented in Figure 21.15 of \cite Bier15-book
3 %>
4 %> @note Calls \ref simpleCycle
5 %>
6 %> @ingroup Running
7 %> @author Michel Bierlaire
8 %> @date Fri Mar 27 17:57:43 2015
9 %> @ingroup chap21
10
11 modA = [0 1 0 0 0 0 0 0 0;
12  0 0 2 3 0 0 0 0 0;
13  4 0 0 0 5 0 0 0 0;
14  0 6 0 0 7 0 0 0 0;
15  0 0 0 8 0 0 0 0 0;
16  0 0 0 0 0 0 9 0 0;
17  0 0 0 0 0 10 0 0 0;
18  0 0 0 0 0 0 0 0 0;
19  11 0 12 13 14 15 16 0 0] ;
20
21
22 circ = [ 4 ; # (1,2)
23  0 ; # (2,3)
24  1.5 ; # (2,4)
25  1 ; # (3,1)
26  0 ; # (3,5)
27  -2.5 ; # (4,2)
28  4 ; # (4,5)
29  1 ; # (5,4)
30  2 ; # (6,7)
31  0 ; # (7,6)
32  3 ; # (A,1)
33  1 ; # (A,3)
34  -1 ; # (A,4)
35  -3 ; # (A,5)
36  2 ; # (A,6)
37  -2 ; # (A,7)
38  ];
39
40 cycleflow = simpleCycle(modA,circ,1) ;
41
42 circ -= cycleflow ;
43
44 cycleflow = simpleCycle(modA,circ,1) ;
45
46 circ -= cycleflow ;
47
48 cycleflow = simpleCycle(modA,circ,1);
49
50 circ -= cycleflow ;
51
52 cycleflow = simpleCycle(modA,circ,1);
53
54 circ -= cycleflow;
55
56 cycleflow = simpleCycle(modA,circ,1);
57
58 circ -= cycleflow;
59
60 cycleflow = simpleCycle(modA,circ,1) ;
61
62 circ -= cycleflow ;
63
function simpleCycle(in adj, in circ, in printlevel)
Extract a simple cycle flow from a circulation.