File: graph_simp.cat

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 (25 lines) | stat: -rw-r--r-- 953 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
graph_simp         Scilab Group         Scilab function          graph_simp
NAME
   graph_simp - converts a graph to a simple undirected graph
  
CALLING SEQUENCE
 g1 = graph_simp(g)
PARAMETERS
 g  : graph list of the old graph
    
 g1 : graph list of the new graph 
    
DESCRIPTION
   graph_simp returns the simple undirected graph g1 corresponding to 
  multigraph g. It deletes loops in g, replaces directed edges  with
  undirected edges and replaces multiple edges with single edges.
  
EXAMPLE
 ta=[1 1  1 2 2 2 3 4 4 4 5 5 6 7 7 8 8 9 9 10 10 10 10 10 11 12 12 13 13 13 14 15 16 16 17 17];
 he=[1 2 10 3 5 7 4 2 9 9 4 6 6 8 2 6 9 7 4  7 11 13 13 15 12 11 13 9 10 14 11 16 1 17 14 15];
 g=make_graph('foo',1,17,ta,he);
 g('node_x')=[283 163  63  98 164 162 273 235 267 384 504 493 409 573 601 627 642];
 g('node_y')=[ 59 133 223 311 227 299 221 288 384 141 209 299 398 383 187 121 301];
 show_graph(g);
 g1=graph_simp(g);
 show_graph(g1,'new');