File: graph-list.man

package info (click to toggle)
scilab 2.6-4
  • links: PTS
  • area: non-free
  • in suites: woody
  • size: 54,632 kB
  • ctags: 40,267
  • sloc: ansic: 267,851; fortran: 166,549; sh: 10,005; makefile: 4,119; tcl: 1,070; cpp: 233; csh: 143; asm: 135; perl: 130; java: 39
file content (417 lines) | stat: -rw-r--r-- 6,470 bytes parent folder | download | duplicates (2)
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
.TH graph-list 1 "September 1996" "Scilab Group" "Scilab type"
.so ../sci.an
.SH NAME
graph-list - description of graph list
.SH DESCRIPTION
A graph in Scilab is represented by a Scilab typed list. 
We call it a graph list.

You will find below the complete description of the list.
Each element is described by one or more lines.
The first line gives
the name of the element and its definition. Additional informations, such as
the default for elements that can have one, are given in the other lines.
Indeed, only the 5 first elements must have a value in the list, all the 
others can be given the empty vector \fV[]\fR as a value, and then the default 
is used when it is needed by functions or by the Metanet window.
For instance, you can define a graph list by
.nf
g=make_graph('min',1,1,[1],[1]);
.fi
which is the simplest graph you can create in Metanet (it is directed, has 
one node and one loop arc on this node).

The name of the element in the list is very important because it is used to 
access the elements of the list. For instance, if \fVg\fR is a graph list, 
to get the name of the graph, you only have to do:
.nf
g('name')
.fi
and if you want to change the name of the graph to \fV'toto'\fR, 
you have to do: 
.nf
g('name')='toto';
.fi

Moreover, you can get the number of edges and the number of arcs of the graph
by using \fVedge_number(g)\fR and \fVarc_number(g)\fR (these names do not
correspond to elements of the list). For compatibility, \fVnode_number(g)\fR 
can also be used instead of \fVg('node_number')\fR.

A graph list can be syntactically correct but not represent a good graph. 
You can use the function \fVcheck_graph\fR to check it.
Moreover it is a good idea to give nodes different names. In fact, this
does not give errors in Scilab, but strange behaviour can appear when using 
the 
Metanet window. This is not checked by \fVcheck_graph\fR 
because it is time consuming. It is only checked when loading, saving
or showing a graph.

The elements of a graph list are given below:

.TP 6
name:
- the name of the graph
.RS
.TP
-
it is a string with a maximum of 80 characters
.RE

.TP 10
directed:
- flag giving the type of the graph
.RS
.TP
-
it is equal to 1 (graph directed) or equal to 0 (graph undirected)
.RE

.TP 13
node_number:
- number of nodes

.TP 6
tail:
- row vector of the tail node numbers

.TP 6
head:
- row vector of the head node numbers

.TP 11
node_name:
- row vector of node names
.RS
.TP
-
the names of the nodes must be different
.TP
-
default is the node numbers as node names
.RE

.TP 11
node_type:
- row vector of the node types
.RS 
.TP
-
the type is an integer from 0 to 2, default is 0 (plain node):
.RS
.TP
-
0 = plain node
.TP
-
1 = sink node
.TP
-
2 = source node
.RE
.RE

.TP 8
node_x:
- row vector of the x coordinate of the nodes
.RS
.TP
-
default is computed
.RE

.TP 8
node_y:
- row vector of the y coordinate of the nodes
.RS
.TP
-
default is computed
.RE

.TP 12
node_color:
- row vector of the node colors
.RS
.TP
-
the color is an integer from 0 to 16, default is 0 (default foreground):
.RS
.TP
-
0 = default foreground
.TP
-
1 = navyblue
.TP
-
2 = blue
.TP
-
3 = skyblue
.TP
-
4 = aquamarine
.TP
-
5 = forestgreen
.TP
-
6 = green
.TP
-
7 = lightcyan
.TP
-
8 = cyan
.TP
-
9 = orange
.TP
-
10 = red
.TP
-
11 = magenta
.TP
-
12 = violet
.TP
-
13 = yellow
.TP
-
14 = gold
.TP
-
15 = beige
.TP
-
16 = background
.RE
.RE

.TP 11
node_diam:
- row vector of the size of the node diameters in pixels
.RS
.TP
-
a node is drawn as a circle
.TP
-
default is the value of element \fVdefault_node_diam\fR
.RE

.TP 13
node_border:
- row vector of the size of the node borders in pixels
.RS
.TP
-
a node is drawn as a circle
.TP
-
default is the value of element \fVdefault_node_border\fR
.RE

.TP 16
node_font_size:
- row vector of the size of the font used to draw the name of the node
.RS
.TP
-
you can choose 8, 10, 12, 14, 18 or 24
.TP
-
default is the value of element \fVdefault_font_size\fR
.RE

.TP 13
node_demand:
- row vector of the node demands
.RS
.TP
-
default is 0
.RE

.TP 11
edge_name:
- row vector of the edge names
.RS
.TP
-
it is better that the names of the edges are different, but this is not
an error
.TP
-
default is the edge numbers as edge names
.RE

.TP 12
edge_color:
- row vector of the edge colors
.RS
.TP
-
the color is an integer from 0 to 16 (see \fVnode_color\fR)
.TP
-
default is 0 (default foreground)
.RE

.TP 12
edge_width:
- row vector of the size of the edge widths in pixels
.RS
.TP
-
default is the value of element \fVdefault_edge_width\fR
.RE

.TP 15
edge_hi_width:
- row vector of the size of the highlighted edge widths in pixels
.RS
.TP
-
default is the value of element \fVdefault_edge_hi_width\fR
.RE

.TP 16
edge_font_size:
- row vector of the size of the fonts used to draw the name of the edge
.RS
.TP
-
you can choose 8, 10, 12, 14, 18 or 24
.TP
-
default is the value of element \fVdefault_font_size\fR
.RE

.TP 13
edge_length:
- row vector of the edge lengths
.RS
.TP
-
default is 0
.RE

.TP 11
edge_cost:
- row vector of the edge costs
.RS
.TP
-
default is 0
.RE

.TP 14
edge_min_cap:
- row vector of the edge minimum capacities
.RS
.TP
-
default is 0
.RE

.TP 14
edge_max_cap:
- row vector of the edge maximum capacities
.RS
.TP
-
default is 0
.RE

.TP 15
edge_q_weight:
- row vector of the edge quadratic weights
.RS
.TP
-
default is 0
.RE

.TP 13
edge_q_orig:
- row vector of the edge quadratic origins
.RS
.TP
-
default is 0
.RE

.TP 13
edge_weight:
- row vector of the edge weights
.RS
.TP
-
default is 0
.RE

.TP 19
default_node_diam:
- default size of the node diameters of the graph
.RS
.TP
-
default is 20 pixels
.RE

.TP 21
default_node_border:
- default size of the node borders of the graph
.RS
.TP
-
default is 2 pixels
.RE

.TP 20
default_edge_width:
- default size of the edge widths of the graph
.RS
.TP
-
default is 1 pixel
.RE

.TP 23
default_edge_hi_width:
- default size of the highlighted edge widths of the graph
.RS
.TP
-
default is 3 pixels
.RE

.TP 19
default_font_size:
- default size of the font used to draw the names of nodes and edges
.RS
.TP
-
default is 12
.RE

.TP 12
node_label:
- row vector of node labels

.TP 12
edge_label:
- row vector of edge labels
.SH EXAMPLE
.nf
g=load_graph(SCI+'/demos/metanet/mesh100');
g('node_color')=int(rand(1:g('node_number'))*16);
g('edge_color')=int(rand(1:edge_number(g))*16);
show_graph(g)
.fi
.SH SEE ALSO
arc_number, check_graph, edge_number, glist, make_graph, node_number