1
.TH graph-list 1 "September 1996" "Scilab Group" "Scilab type"
4
graph-list - description of graph list
6
A graph in Scilab is represented by a Scilab typed list.
7
We call it a graph list.
9
You will find below the complete description of the list.
10
Each element is described by one or more lines.
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
19
g=make_graph('min',1,1,[1],[1]);
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).
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:
30
and if you want to change the name of the graph to \fV'toto'\fR,
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.
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
46
Metanet window. This is not checked by \fVcheck_graph\fR
47
because it is time consuming. It is only checked when loading, saving
50
The elements of a graph list are given below:
54
- the name of the graph
58
it is a string with a maximum of 80 characters
63
- flag giving the type of the graph
67
it is equal to 1 (graph directed) or equal to 0 (graph undirected)
76
- row vector of the tail node numbers
80
- row vector of the head node numbers
84
- row vector of node names
88
the names of the nodes must be different
91
default is the node numbers as node names
96
- row vector of the node types
100
the type is an integer from 0 to 2, default is 0 (plain node):
116
- row vector of the x coordinate of the nodes
125
- row vector of the y coordinate of the nodes
134
- row vector of the node colors
138
the color is an integer from 0 to 16, default is 0 (default foreground):
142
0 = default foreground
196
- row vector of the size of the node diameters in pixels
200
a node is drawn as a circle
203
default is the value of element \fVdefault_node_diam\fR
208
- row vector of the size of the node borders in pixels
212
a node is drawn as a circle
215
default is the value of element \fVdefault_node_border\fR
220
- row vector of the size of the font used to draw the name of the node
224
you can choose 8, 10, 12, 14, 18 or 24
227
default is the value of element \fVdefault_font_size\fR
232
- row vector of the node demands
241
- row vector of the edge names
245
it is better that the names of the edges are different, but this is not
249
default is the edge numbers as edge names
254
- row vector of the edge colors
258
the color is an integer from 0 to 16 (see \fVnode_color\fR)
261
default is 0 (default foreground)
266
- row vector of the size of the edge widths in pixels
270
default is the value of element \fVdefault_edge_width\fR
275
- row vector of the size of the highlighted edge widths in pixels
279
default is the value of element \fVdefault_edge_hi_width\fR
284
- row vector of the size of the fonts used to draw the name of the edge
288
you can choose 8, 10, 12, 14, 18 or 24
291
default is the value of element \fVdefault_font_size\fR
296
- row vector of the edge lengths
305
- row vector of the edge costs
314
- row vector of the edge minimum capacities
323
- row vector of the edge maximum capacities
332
- row vector of the edge quadratic weights
341
- row vector of the edge quadratic origins
350
- row vector of the edge weights
359
- default size of the node diameters of the graph
368
- default size of the node borders of the graph
377
- default size of the edge widths of the graph
385
default_edge_hi_width:
386
- default size of the highlighted edge widths of the graph
395
- default size of the font used to draw the names of nodes and edges
404
- row vector of node labels
408
- row vector of edge labels
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);
417
arc_number, check_graph, edge_number, glist, make_graph, node_number