File: mat_2_graph.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 (39 lines) | stat: -rw-r--r-- 1,145 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

mat_2_graph(1)                 Scilab function                 mat_2_graph(1)
NAME
  mat_2_graph - graph from node-arc or node-node incidence matrix

CALLING SEQUENCE
  g = mat_2_graph(a,directed,[mat])

PARAMETERS

  a : sparse node-arc or node-node incidence matrix

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

  mat : optional string, 'node-arc' or 'node-node' matrix

  g : graph list

DESCRIPTION
  mat_2_graph computes the graph g corresponding to the node-arc or the
  node-node incidence matrix a.  Note that a checking is made to insure that
  a is a sparse node-arc or node-node incidence matrix of a directed
  (directed = 1) or undirected (directed = 0) graph.  If the optional argu-
  ment mat is omitted or is the string

EXAMPLE
  g=load_graph(SCI+'/demos/metanet/colored');
  show_graph(g);
  a=graph_2_mat(g);
  g1=mat_2_graph(a,1);
  g1('node_x')=g('node_x'); g1('node_y')=g('node_y');
  show_graph(g1,'new');
  a=graph_2_mat(g,'node-node');
  g1=mat_2_graph(a,1,'node-node');
  g1('node_x')=g('node_x'); g1('node_y')=g('node_y');
  show_graph(g1,'new');

SEE ALSO
  adj_lists, chain_struct, graph_2_mat