File: gen_net.cat

package info (click to toggle)
scilab 2.4-1
  • links: PTS
  • area: non-free
  • in suites: potato, slink
  • size: 55,196 kB
  • ctags: 38,019
  • sloc: ansic: 231,970; fortran: 148,976; tcl: 7,099; makefile: 4,585; sh: 2,978; csh: 154; cpp: 101; asm: 39; sed: 5
file content (71 lines) | stat: -rw-r--r-- 1,672 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71

gen_net(1)                     Scilab function                     gen_net(1)
NAME
  gen_net - generation of a network

CALLING SEQUENCE
  g = gen_net(name,directed,v)
  g = gen_net()

PARAMETERS

  name : string, the name of the graph

  directed :  integer, 0 (undirected graph) or 1 (directed graph)

  v  : row vector with 12 values for defining the network

  g : graph list

DESCRIPTION
  gen_net generates a network g.  The arguments are the name of the graph, a
  flag equal to 0 (undirected graph) or  to 1 (directed graph) and a vector
  describing the network (see below).

  If no argument are given, a dialog box for the definition of all the argu-
  ments is opened.

  v must be a row vector with 12 values.  The meaning of the values are:

  Seed for random: used for initialization of random generation

  Number of nodes

  Number of sources

  Number of sinks

  Minimum cost

  Maximum cost

  Input supply

  Output supply

  Minimum capacity

  Maximum capacity

  Percentage of edges with costs: between 0 and 100

  Percentage of edges with capacities: between 0 and 100

  The cost of edges without cost are put to minimum cost.  The maximum capa-
  city of edges without capacity are put to maximum upply

  The result is a network g built on a planar connected graph, by using a
  triangulation method. Moreover, computations are made in order to have a
  coherent network. Values of costs and maximum capacities are put on the
  edges. Minimum capacities are reduced to 0.

EXAMPLE
  v=[1,10,2,1,0,10,100,100,0,100,50,50];
  g=gen_net('foo',1,v);
  show_graph(g)
  // generating using dialogs
  g=gen_net();
  show_graph(g)

SEE ALSO
  mesh2d