For instance, you can define a graph list (see 2.1) by
g=make_graph('min',1,1,[1],[1]);which is the simplest graph you can create (it is directed, has one node and one loop arc on this node).
Each element of the list can be accessed by using its name.
For instance, if g is a graph list and
you want to get the node_number element, you only have to type:
g('node_number')
and if you want to change this value to 10, you only have to type:
g('node_number')=10
The check_graph function checks a graph list to see if there are inconsistencies in its elements. Checking is not only syntactic (number of elements of the list, compatible sizes of the vectors), but also semantic in the sense that check_graph checks that node_number, tail and head elements of the list can really represent a graph. This checking is automatically made when calling functions with a graph list as an argument.
You will find below the description of all the elements of a graph list. Each element is described by one or more lines. The first lines give the name of the element and its definition, with its Scilab type if needed. The last line gives the default for elements that can have one. The name of the element is used to access the elements of the list.
Name of the graph; a string with a maximum of 80 characters (REQUIRED).
Flag giving the type of the graph; it is equal to 1 if the graph is directed or equal to 0 is the graph is undirected (REQUIRED).
Number of nodes (REQUIRED).
Row vector of the tail node numbers (REQUIRED).
Row vector of the head node numbers (REQUIRED).
Row vector of the node names; they MUST be different.
Default is the node numbers as node names.
Row vector of the node types; the type is an integer from 0 to 2:
This element is mainly used to draw the nodes in the Metanet window. A plain node is drawn as a circle. A sink or source node is a node where extraneous flow goes out the node or goes into the node; it is drawn differently (a circle with an outgoing or ingoing arrow).
Default is 0 (plain node).
Row vector of the x coordinates of the nodes.
Default is computed when showing the graph in the Metanet window (see 3).
Row vector of the y coordinates of the nodes.
Default is computed when showing the graph in the Metanet window (see 3).
Row vector of the node colors; the color is an integer from 0 to 16:
Default is 0 (black).
Row vector of the sizes of the node diameters in pixels (a node is drawn as a circle).
Default is the value of element default_node_diam.
Row vector of the sizes of the node borders in pixels.
Default is the value of element default_node_border.
Row vector of the sizes of the font used to draw the name or the label of the node; you can choose 8, 10, 12, 14, 18 or 24.
Default is the value of element default_font_size.
Row vector of the node demands.
The demands of the nodes are used in functions min_lcost_cflow, min_lcost_flow1, min_lcost_flow2, min_qcost_flow and supernode.
Default is 0.
Row vector of the edge names; edge names need not be different.
Default is the edge numbers as edge names.
Row vector of the edge colors; the color is an integer from 0 to 16 (see node_color).
Default is 0 (black).
Row vector of the sizes of the edge widths in pixels.
Default is the value of element default_edge_width.
Row vector of the sizes of the highlighted edge widths in pixels.
Default is the value of element default_edge_hi_width.
Row vector of the sizes of the font used to draw the name or the label of the edge; you can choose 8, 10, 12, 14, 18 or 24.
Default is the value of element default_font_size.
Row vector of the edge lengths.
The lengths of the edges are used in functions graph_center, graph_diameter, salesman and shortest_path.
Default is 0.
Row vector of the edge costs.
The costs of the edges are used in functions min_lcost_cflow, min_lcost_flow1 and min_lcost_flow2.
Default is 0.
Row vector of the edge minimum capacities.
The minimum capacities of the edges are used in functions max_flow, min_lcost_cflow, min_lcost_flow1, min_lcost_flow2 and min_qcost_flow.
Default is 0.
Row vector of the edge maximum capacities.
The maximum capacities of the edges are used in functions max_cap_path, max_flow, min_lcost_cflow, min_lcost_flow1, min_lcost_flow2 and min_qcost_flow.
Default is 0.
Row vector of the edge quadratic weights. It corresponds to w(u) in the value of the cost on edge u with flow : .
The quadratic weights of the edges are used in function min_qcost_flow.
Default is 0.
Row vector of the edge quadratic origins. It corresponds to w0(u) in the value of the cost on edge u with flow : .
The quadratic origins of the edges are used in function min_qcost_flow.
Default is 0.
Row vector of the edge weights.
The weights of the edges are used in function min_weight_tree.
Default is 0.
Default size in pixels of the node diameters of the graph.
Default is 20.
Default size in pixels of the node borders of the graph.
Default is 2.
Default size in pixels of the edge widths of the graph.
Default is 1.
Default size in pixels of the highlighted edge widths of the graph.
Default is 3.
Default size of the font used to draw the names or the labels of nodes and edges.
Default is 12.
Row vector of the node labels.
Node labels are used to draw a string in a node. It can be any string. An empty label can be given as a blank string ' '.
Row vector of the edge labels.
Edge labels are used to draw a string on an edge. It can be any string. An empty label can be given as a blank string ' '.