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

« back to all changes in this revision

Viewing changes to man/metanet/graph-list.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 graph-list 1 "September 1996" "Scilab Group" "Scilab type"
2
 
.so ../sci.an
3
 
.SH NAME
4
 
graph-list - description of graph list
5
 
.SH DESCRIPTION
6
 
A graph in Scilab is represented by a Scilab typed list. 
7
 
We call it a graph list.
8
 
 
9
 
You will find below the complete description of the list.
10
 
Each element is described by one or more lines.
11
 
The first line gives
12
 
the name of the element and its definition. Additional informations, such as
13
 
the default for elements that can have one, are given in the other lines.
14
 
Indeed, only the 5 first elements must have a value in the list, all the 
15
 
others can be given the empty vector \fV[]\fR as a value, and then the default 
16
 
is used when it is needed by functions or by the Metanet window.
17
 
For instance, you can define a graph list by
18
 
.nf
19
 
g=make_graph('min',1,1,[1],[1]);
20
 
.fi
21
 
which is the simplest graph you can create in Metanet (it is directed, has 
22
 
one node and one loop arc on this node).
23
 
 
24
 
The name of the element in the list is very important because it is used to 
25
 
access the elements of the list. For instance, if \fVg\fR is a graph list, 
26
 
to get the name of the graph, you only have to do:
27
 
.nf
28
 
g('name')
29
 
.fi
30
 
and if you want to change the name of the graph to \fV'toto'\fR, 
31
 
you have to do: 
32
 
.nf
33
 
g('name')='toto';
34
 
.fi
35
 
 
36
 
Moreover, you can get the number of edges and the number of arcs of the graph
37
 
by using \fVedge_number(g)\fR and \fVarc_number(g)\fR (these names do not
38
 
correspond to elements of the list). For compatibility, \fVnode_number(g)\fR 
39
 
can also be used instead of \fVg('node_number')\fR.
40
 
 
41
 
A graph list can be syntactically correct but not represent a good graph. 
42
 
You can use the function \fVcheck_graph\fR to check it.
43
 
Moreover it is a good idea to give nodes different names. In fact, this
44
 
does not give errors in Scilab, but strange behaviour can appear when using 
45
 
the 
46
 
Metanet window. This is not checked by \fVcheck_graph\fR 
47
 
because it is time consuming. It is only checked when loading, saving
48
 
or showing a graph.
49
 
 
50
 
The elements of a graph list are given below:
51
 
 
52
 
.TP 6
53
 
name:
54
 
- the name of the graph
55
 
.RS
56
 
.TP
57
 
-
58
 
it is a string with a maximum of 80 characters
59
 
.RE
60
 
 
61
 
.TP 10
62
 
directed:
63
 
- flag giving the type of the graph
64
 
.RS
65
 
.TP
66
 
-
67
 
it is equal to 1 (graph directed) or equal to 0 (graph undirected)
68
 
.RE
69
 
 
70
 
.TP 13
71
 
node_number:
72
 
- number of nodes
73
 
 
74
 
.TP 6
75
 
tail:
76
 
- row vector of the tail node numbers
77
 
 
78
 
.TP 6
79
 
head:
80
 
- row vector of the head node numbers
81
 
 
82
 
.TP 11
83
 
node_name:
84
 
- row vector of node names
85
 
.RS
86
 
.TP
87
 
-
88
 
the names of the nodes must be different
89
 
.TP
90
 
-
91
 
default is the node numbers as node names
92
 
.RE
93
 
 
94
 
.TP 11
95
 
node_type:
96
 
- row vector of the node types
97
 
.RS 
98
 
.TP
99
 
-
100
 
the type is an integer from 0 to 2, default is 0 (plain node):
101
 
.RS
102
 
.TP
103
 
-
104
 
0 = plain node
105
 
.TP
106
 
-
107
 
1 = sink node
108
 
.TP
109
 
-
110
 
2 = source node
111
 
.RE
112
 
.RE
113
 
 
114
 
.TP 8
115
 
node_x:
116
 
- row vector of the x coordinate of the nodes
117
 
.RS
118
 
.TP
119
 
-
120
 
default is computed
121
 
.RE
122
 
 
123
 
.TP 8
124
 
node_y:
125
 
- row vector of the y coordinate of the nodes
126
 
.RS
127
 
.TP
128
 
-
129
 
default is computed
130
 
.RE
131
 
 
132
 
.TP 12
133
 
node_color:
134
 
- row vector of the node colors
135
 
.RS
136
 
.TP
137
 
-
138
 
the color is an integer from 0 to 16, default is 0 (default foreground):
139
 
.RS
140
 
.TP
141
 
-
142
 
0 = default foreground
143
 
.TP
144
 
-
145
 
1 = navyblue
146
 
.TP
147
 
-
148
 
2 = blue
149
 
.TP
150
 
-
151
 
3 = skyblue
152
 
.TP
153
 
-
154
 
4 = aquamarine
155
 
.TP
156
 
-
157
 
5 = forestgreen
158
 
.TP
159
 
-
160
 
6 = green
161
 
.TP
162
 
-
163
 
7 = lightcyan
164
 
.TP
165
 
-
166
 
8 = cyan
167
 
.TP
168
 
-
169
 
9 = orange
170
 
.TP
171
 
-
172
 
10 = red
173
 
.TP
174
 
-
175
 
11 = magenta
176
 
.TP
177
 
-
178
 
12 = violet
179
 
.TP
180
 
-
181
 
13 = yellow
182
 
.TP
183
 
-
184
 
14 = gold
185
 
.TP
186
 
-
187
 
15 = beige
188
 
.TP
189
 
-
190
 
16 = background
191
 
.RE
192
 
.RE
193
 
 
194
 
.TP 11
195
 
node_diam:
196
 
- row vector of the size of the node diameters in pixels
197
 
.RS
198
 
.TP
199
 
-
200
 
a node is drawn as a circle
201
 
.TP
202
 
-
203
 
default is the value of element \fVdefault_node_diam\fR
204
 
.RE
205
 
 
206
 
.TP 13
207
 
node_border:
208
 
- row vector of the size of the node borders in pixels
209
 
.RS
210
 
.TP
211
 
-
212
 
a node is drawn as a circle
213
 
.TP
214
 
-
215
 
default is the value of element \fVdefault_node_border\fR
216
 
.RE
217
 
 
218
 
.TP 16
219
 
node_font_size:
220
 
- row vector of the size of the font used to draw the name of the node
221
 
.RS
222
 
.TP
223
 
-
224
 
you can choose 8, 10, 12, 14, 18 or 24
225
 
.TP
226
 
-
227
 
default is the value of element \fVdefault_font_size\fR
228
 
.RE
229
 
 
230
 
.TP 13
231
 
node_demand:
232
 
- row vector of the node demands
233
 
.RS
234
 
.TP
235
 
-
236
 
default is 0
237
 
.RE
238
 
 
239
 
.TP 11
240
 
edge_name:
241
 
- row vector of the edge names
242
 
.RS
243
 
.TP
244
 
-
245
 
it is better that the names of the edges are different, but this is not
246
 
an error
247
 
.TP
248
 
-
249
 
default is the edge numbers as edge names
250
 
.RE
251
 
 
252
 
.TP 12
253
 
edge_color:
254
 
- row vector of the edge colors
255
 
.RS
256
 
.TP
257
 
-
258
 
the color is an integer from 0 to 16 (see \fVnode_color\fR)
259
 
.TP
260
 
-
261
 
default is 0 (default foreground)
262
 
.RE
263
 
 
264
 
.TP 12
265
 
edge_width:
266
 
- row vector of the size of the edge widths in pixels
267
 
.RS
268
 
.TP
269
 
-
270
 
default is the value of element \fVdefault_edge_width\fR
271
 
.RE
272
 
 
273
 
.TP 15
274
 
edge_hi_width:
275
 
- row vector of the size of the highlighted edge widths in pixels
276
 
.RS
277
 
.TP
278
 
-
279
 
default is the value of element \fVdefault_edge_hi_width\fR
280
 
.RE
281
 
 
282
 
.TP 16
283
 
edge_font_size:
284
 
- row vector of the size of the fonts used to draw the name of the edge
285
 
.RS
286
 
.TP
287
 
-
288
 
you can choose 8, 10, 12, 14, 18 or 24
289
 
.TP
290
 
-
291
 
default is the value of element \fVdefault_font_size\fR
292
 
.RE
293
 
 
294
 
.TP 13
295
 
edge_length:
296
 
- row vector of the edge lengths
297
 
.RS
298
 
.TP
299
 
-
300
 
default is 0
301
 
.RE
302
 
 
303
 
.TP 11
304
 
edge_cost:
305
 
- row vector of the edge costs
306
 
.RS
307
 
.TP
308
 
-
309
 
default is 0
310
 
.RE
311
 
 
312
 
.TP 14
313
 
edge_min_cap:
314
 
- row vector of the edge minimum capacities
315
 
.RS
316
 
.TP
317
 
-
318
 
default is 0
319
 
.RE
320
 
 
321
 
.TP 14
322
 
edge_max_cap:
323
 
- row vector of the edge maximum capacities
324
 
.RS
325
 
.TP
326
 
-
327
 
default is 0
328
 
.RE
329
 
 
330
 
.TP 15
331
 
edge_q_weight:
332
 
- row vector of the edge quadratic weights
333
 
.RS
334
 
.TP
335
 
-
336
 
default is 0
337
 
.RE
338
 
 
339
 
.TP 13
340
 
edge_q_orig:
341
 
- row vector of the edge quadratic origins
342
 
.RS
343
 
.TP
344
 
-
345
 
default is 0
346
 
.RE
347
 
 
348
 
.TP 13
349
 
edge_weight:
350
 
- row vector of the edge weights
351
 
.RS
352
 
.TP
353
 
-
354
 
default is 0
355
 
.RE
356
 
 
357
 
.TP 19
358
 
default_node_diam:
359
 
- default size of the node diameters of the graph
360
 
.RS
361
 
.TP
362
 
-
363
 
default is 20 pixels
364
 
.RE
365
 
 
366
 
.TP 21
367
 
default_node_border:
368
 
- default size of the node borders of the graph
369
 
.RS
370
 
.TP
371
 
-
372
 
default is 2 pixels
373
 
.RE
374
 
 
375
 
.TP 20
376
 
default_edge_width:
377
 
- default size of the edge widths of the graph
378
 
.RS
379
 
.TP
380
 
-
381
 
default is 1 pixel
382
 
.RE
383
 
 
384
 
.TP 23
385
 
default_edge_hi_width:
386
 
- default size of the highlighted edge widths of the graph
387
 
.RS
388
 
.TP
389
 
-
390
 
default is 3 pixels
391
 
.RE
392
 
 
393
 
.TP 19
394
 
default_font_size:
395
 
- default size of the font used to draw the names of nodes and edges
396
 
.RS
397
 
.TP
398
 
-
399
 
default is 12
400
 
.RE
401
 
 
402
 
.TP 12
403
 
node_label:
404
 
- row vector of node labels
405
 
 
406
 
.TP 12
407
 
edge_label:
408
 
- row vector of edge labels
409
 
.SH EXAMPLE
410
 
.nf
411
 
g=load_graph(SCI+'/demos/metanet/mesh100');
412
 
g('node_color')=int(rand(1:g('node_number'))*16);
413
 
g('edge_color')=int(rand(1:edge_number(g))*16);
414
 
show_graph(g)
415
 
.fi
416
 
.SH SEE ALSO
417
 
arc_number, check_graph, edge_number, glist, make_graph, node_number