Optimization: principles and algorithms, by Michel Bierlaire
run2402.m
Go to the documentation of this file.
1 %> \file
2 %> Run the FordFulkerson algorithm on Example 24.2 of \cite Bier15-book
3 %>
4 %> @note Calls \ref fordFulkerson
5 %>
6 %> @ingroup chap24
7 %> @ingroup Running
8 %> @author Michel Bierlaire
9 %> @date Thu Apr 9 18:45:30 2015
10 
11 
12 adj = [ 0 1 2 3 0 0 0 ;
13  0 0 4 0 0 5 0 ;
14  0 0 0 6 0 7 0 ;
15  0 0 8 0 9 0 0 ;
16  0 0 0 0 0 10 11 ;
17  0 0 0 0 0 0 12 ;
18  0 0 0 0 0 0 0 ] ;
19 
20 orig = 1 ;
21 dest = 7 ;
22 lb = [ 0 0 0 0 0 0 0 0 0 0 0 0 ]' ;
23 ub = [ 5 3 5 3 3 3 5 1 5 1 2 9 ]' ;
24 flow = [0 0 0 0 0 0 0 0 0 0 0 0]' ;
25 
26 [flow, total] = fordFulkerson(adj,orig,dest,lb,ub);
27 
function fordFulkerson(in adj, in orig, in dest, in lb, in ub)
Find the maximum flow between two nodes using the Ford Fulkerson algorithm.
Copyright 2015-2016 Michel Bierlaire