~ubuntu-branches/ubuntu/hoary/scilab/hoary

« back to all changes in this revision

Viewing changes to man/metanet/max_flow.man

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2005-01-09 22:58:21 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050109225821-473xr8vhgugxxx5j
Tags: 3.0-12
changed configure.in to build scilab's own malloc.o, closes: #255869

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
.TH max_flow 1 "September 1995" "Scilab Group" "Scilab function"
2
 
.so ../sci.an
3
 
.SH NAME
4
 
max_flow - maximum flow between two nodes
5
 
.SH CALLING SEQUENCE
6
 
.nf
7
 
[v,phi,flag] = max_flow(i,j,g)
8
 
.fi
9
 
.SH PARAMETERS
10
 
.TP 2
11
 
i
12
 
: integer, number of start node
13
 
.TP 2
14
 
j
15
 
: integer, number of end node
16
 
.TP 2
17
 
g
18
 
: graph list
19
 
.TP 2
20
 
v
21
 
: value of the maximum flow it is exists
22
 
.TP 4
23
 
phi
24
 
: row vector of the value of the flow on the arcs
25
 
.TP 5
26
 
flag
27
 
: feasible problem flag (0 or 1)
28
 
.SH DESCRIPTION
29
 
\fVmax_flow\fR returns the value of maximum flow \fVv\fR from node number
30
 
\fVi\fR to node number \fVj\fR if it exists, and the value of the flow 
31
 
on each arc as a row vector \fVphi\fR. All the computations are made with 
32
 
integer numbers. The graph must be directed. If the problem is not 
33
 
feasible, \fVflag\fR is equal to 0, otherwise it is equal to 1.
34
 
 
35
 
The bounds of the flow are given by the elements \fVedge_min_cap\fR and
36
 
\fVedge_max_cap\fR of the graph list. 
37
 
The value of the maximum capacity must be greater than or equal to the 
38
 
value of the minimum capacity.
39
 
If the value of \fVedge_min_cap\fR or \fVedge_max_cap\fR is not given (empty
40
 
row vector \fV[]\fR), it is assumed to be equal to 0 on each edge.
41
 
.SH EXAMPLE
42
 
.nf
43
 
ta=[1 1 2 2 3 3 4 4 5 5 5 5 6 6 6 7 7 15 15 15 15 15 15];
44
 
ta=[ta, 15 8 9 10 11 12 13 14];
45
 
he=[10 13 9 14 8 11 9 11 8 10 12 13 8 9 12 8 11 1 2 3 4];
46
 
he=[he, 5 6 7 16 16 16 16 16 16 16];
47
 
n=16;
48
 
g=make_graph('foo',1,n,ta,he);
49
 
g('node_x')=[42 615 231 505 145 312 403 233 506 34 400 312 142 614 260 257];
50
 
g('node_y')=[143 145 154 154 147 152 157 270 273 279 269 273 273 274 50 376];
51
 
ma=edge_number(g);
52
 
g('edge_max_cap')=ones(1,ma);
53
 
g('edge_min_cap')=zeros(1,ma);
54
 
source=15; sink=16;
55
 
nodetype=0*ones(1,n); nodetype(source)=2; nodetype(sink)=1;
56
 
g('node_type')=nodetype;
57
 
nodecolor=0*ones(1,n); nodecolor(source)=11; nodecolor(sink)=11;
58
 
g('node_color')=nodecolor;
59
 
show_graph(g);
60
 
[v,phi,ierr]=max_flow(source,sink,g);
61
 
ii=find(phi<>0); edgecolor=phi; edgecolor(ii)=11*ones(ii);
62
 
g('edge_color')=edgecolor;
63
 
edgefontsize=8*ones(1,ma); edgefontsize(ii)=18*ones(ii);
64
 
g('edge_font_size')=edgefontsize;
65
 
g('edge_label')=string(phi);
66
 
show_graph(g);
67
 
.fi