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

« back to all changes in this revision

Viewing changes to man/eng/metanet/min_qcost_flow.xml

  • 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
<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
 
2
<!DOCTYPE MAN SYSTEM "../../manrev.dtd">
 
3
<MAN>
 
4
  <LANGUAGE>eng</LANGUAGE>
 
5
  <TITLE>min_qcost_flow</TITLE>
 
6
  <TYPE>Scilab function</TYPE>
 
7
  <DATE>September 1995</DATE>
 
8
  <SHORT_DESCRIPTION name="min_qcost_flow"> minimum quadratic cost flow</SHORT_DESCRIPTION>
 
9
  <CALLING_SEQUENCE>
 
10
    <CALLING_SEQUENCE_ITEM>[c,phi,flag] = min_qcost_flow(eps,g)  </CALLING_SEQUENCE_ITEM>
 
11
  </CALLING_SEQUENCE>
 
12
  <PARAM>
 
13
    <PARAM_INDENT>
 
14
      <PARAM_ITEM>
 
15
        <PARAM_NAME>eps</PARAM_NAME>
 
16
        <PARAM_DESCRIPTION>
 
17
          <SP>: scalar, precision</SP>
 
18
        </PARAM_DESCRIPTION>
 
19
      </PARAM_ITEM>
 
20
      <PARAM_ITEM>
 
21
        <PARAM_NAME>g</PARAM_NAME>
 
22
        <PARAM_DESCRIPTION>
 
23
          <SP>: graph list</SP>
 
24
        </PARAM_DESCRIPTION>
 
25
      </PARAM_ITEM>
 
26
      <PARAM_ITEM>
 
27
        <PARAM_NAME>c</PARAM_NAME>
 
28
        <PARAM_DESCRIPTION>
 
29
          <SP>: value of cost</SP>
 
30
        </PARAM_DESCRIPTION>
 
31
      </PARAM_ITEM>
 
32
      <PARAM_ITEM>
 
33
        <PARAM_NAME>phi</PARAM_NAME>
 
34
        <PARAM_DESCRIPTION>
 
35
          <SP>: row vector of the value of flow on the arcs</SP>
 
36
        </PARAM_DESCRIPTION>
 
37
      </PARAM_ITEM>
 
38
      <PARAM_ITEM>
 
39
        <PARAM_NAME>flag</PARAM_NAME>
 
40
        <PARAM_DESCRIPTION>
 
41
          <SP>: feasible problem flag (0 or 1)</SP>
 
42
        </PARAM_DESCRIPTION>
 
43
      </PARAM_ITEM>
 
44
    </PARAM_INDENT>
 
45
  </PARAM>
 
46
  <DESCRIPTION>
 
47
    <P><VERB>min_qcost_flow</VERB> computes the minimum quadratic cost flow in the network 
 
48
    <VERB>g</VERB>. It returns the total cost of the flows on the arcs <VERB>c</VERB> and
 
49
    the row vector of the flows on the arcs <VERB>phi</VERB>. <VERB>eps</VERB> is the precision
 
50
    of the iterative algorithm. If the problem is not feasible (impossible to 
 
51
    find a compatible flow for instance), <VERB>flag</VERB> is equal to 0, otherwise it 
 
52
    is equal to 1.</P>
 
53
    <P>
 
54
    The bounds of the flow are given by the elements <VERB>edge_min_cap</VERB> and
 
55
    <VERB>edge_max_cap</VERB> of the graph list. 
 
56
    The value of the maximum capacity must be greater than or equal to the 
 
57
    value of the minimum capacity.
 
58
    If the value of <VERB>edge_min_cap</VERB> or <VERB>edge_max_cap</VERB> is not given (empty
 
59
    row vector <VERB>[]</VERB>), it is assumed to be equal to 0 on each edge.</P>
 
60
    <P>
 
61
    The costs on the edges are given by the elements <VERB>edge_q_orig</VERB> and
 
62
    <VERB>edge_q_weight</VERB> of the graph list. The cost on arc <VERB>u</VERB> is given by:</P>
 
63
    <P>
 
64
      <VERB>(1/2)*edge_q_weight[u](phi[u]-edge_q_orig[u])^2</VERB>
 
65
    </P>
 
66
    <P>
 
67
    The costs must be non negative.
 
68
    If the value of <VERB>edge_q_orig</VERB> or <VERB>edge_q_weight</VERB> is not given (empty 
 
69
    row vector <VERB>[]</VERB>), it is assumed to be equal to 0 on each edge.</P>
 
70
    <P>
 
71
    This function uses an algorithm due to M. Minoux.</P>
 
72
  </DESCRIPTION>
 
73
  <EXAMPLE>
 
74
<![CDATA[
 
75
ta=[1 1 2 2 2 3 4 4 5 6 6 6 7 7 7 8 9 10 12 12 13 13 13 14 15 14 9 11 10 1 8];
 
76
he=[2 6 3 4 5 1 3 5 1 7 10 11 5 8 9 5 8 11 10 11 9 11 15 13 14 4 6 9 1 12 14];
 
77
g=make_graph('foo',1,15,ta,he);
 
78
g('node_x')=[194 191 106 194 296 305 305 418 422 432 552 550 549 416 548];
 
79
g('node_y')=[56 221 316 318 316 143 214 321 217 126 215 80 330 437 439];
 
80
show_graph(g);
 
81
g1=g; ma=arc_number(g1);
 
82
rand('uniform');
 
83
while %T then
 
84
  g1('edge_min_cap')=round(5*rand(1,ma));
 
85
  g1('edge_max_cap')=round(20*rand(1,ma))+30*ones(1,ma);
 
86
  g1('edge_q_orig')=0*ones(1,ma);
 
87
  g1('edge_q_weight')=ones(1,ma);
 
88
  [c,phi,flag]=min_qcost_flow(0.001,g1);
 
89
 if flag==1 then break; end;
 
90
end;
 
91
x_message(['The cost is: '+string(c);
 
92
          'Showing the flow on the arcs']);
 
93
ii=find(phi<>0); edgecolor=phi; edgecolor(ii)=11*ones(ii);
 
94
g1('edge_color')=edgecolor;
 
95
edgefontsize=8*ones(1,ma); edgefontsize(ii)=18*ones(ii);
 
96
g1('edge_font_size')=edgefontsize;
 
97
g1('edge_label')=string(phi);
 
98
show_graph(g1);
 
99
 ]]>
 
100
  </EXAMPLE>
 
101
  <SEE_ALSO>
 
102
    <SEE_ALSO_ITEM>
 
103
      <LINK>min_lcost_cflow</LINK>
 
104
    </SEE_ALSO_ITEM>
 
105
    <SEE_ALSO_ITEM>
 
106
      <LINK>min_lcost_flow1</LINK>
 
107
    </SEE_ALSO_ITEM>
 
108
    <SEE_ALSO_ITEM>
 
109
      <LINK>min_lcost_flow2</LINK>
 
110
    </SEE_ALSO_ITEM>
 
111
  </SEE_ALSO>
 
112
</MAN>