 
-->// Use the Metanet window to create a graph
 
-->num = edit_graph()
 num  =
 
    3.  
 
-->// a new window opens (the 3 indicates i've opened others before)
 
-->// use edit -> NewNode to add vertices, I did 10 for petersen
 
-->// use edit -> NewArc to add edges, I did 15 for petersen
 
-->// use edit -> Give Default Names, click yes on pop-up
 
-->// use graph -> Settings, on popup change `is directed' to no
 
-->// use graph -> SaveAs to save a petersen
 
-->// load into scilab with load_graph
 
-->p = load_graph('petersen.graph');
 !--error 9999 
Graph file "./petersen.graph" does not exist
at line      10 of function load_graph called by :  
p = load_graph('petersen.graph');
 
 
-->dir
 ans  =
 
gui.sce       
 
-->// Do save as and make sure you are saving it to current directory
 
-->p = load_graph('petersen.graph');
 
-->lines(0);
 
-->p
 p  =
 
 
       p(1)
 
 
         column 1 to 8
 
!graph  name  directed  node_number  tail  head  node_name  node_type  !
 
         column  9 to 14
 
!node_x  node_y  node_color  node_diam  node_border  node_font_size  !
 
         column 15 to 19
 
!node_demand  edge_name  edge_color  edge_width  edge_hi_width  !
 
         column 20 to 24
 
!edge_font_size  edge_length  edge_cost  edge_min_cap  edge_max_cap  !
 
         column 25 to 28
 
!edge_q_weight  edge_q_orig  edge_weight  default_node_diam  !
 
         column 29 to 31
 
!default_node_border  default_edge_width  default_edge_hi_width  !
 
         column 32 to 34
 
!default_font_size  node_label  edge_label  !
 
       p(2)
 
 petersen   
 
       p(3)
 
    0.  
 
       p(4)
 
    10.  
 
       p(5)
 
 
         column  1 to 11
 
    1.    2.    3.    4.    5.    1.    2.    3.    4.    5.    6.  
 
         column 12 to 15
 
    8.    10.    7.    9.  
 
       p(6)
 
 
         column  1 to 11
 
    2.    3.    4.    5.    1.    6.    7.    8.    9.    10.    8.  
 
         column 12 to 15
 
    10.    7.    9.    6.  
 
       p(7)
 
!1  2  3  4  5  6  7  8  9  10  !
 
       p(8)
 
    0.    0.    0.    0.    0.    0.    0.    0.    0.    0.  
 
       p(9)
 
 
         column 1 to 9
 
  - 86.    61.    21.  - 154.  - 248.  - 88.  - 32.  - 48.  - 125.  
 
         column 10
 
  - 152.  
 
       p(10)
 
 
         column 1 to 9
 
    228.    148.  - 34.  - 34.    126.    161.    128.    56.    54.  
 
         column 10
 
    125.  
 
       p(11)
 
    1.    1.    1.    1.    1.    1.    1.    1.    1.    1.  
 
       p(12)
 
    0.    0.    0.    0.    0.    0.    0.    0.    0.    0.  
 
       p(13)
 
    0.    0.    0.    0.    0.    0.    0.    0.    0.    0.  
 
       p(14)
 
    0.    0.    0.    0.    0.    0.    0.    0.    0.    0.  
 
       p(15)
 
    0.    0.    0.    0.    0.    0.    0.    0.    0.    0.  
 
       p(16)
 
!1  2  3  4  5  6  7  8  9  10  11  12  13  14  15  !
 
       p(17)
 
 
         column  1 to 11
 
    1.    1.    1.    1.    1.    1.    1.    1.    1.    1.    1.  
 
         column 12 to 15
 
    1.    1.    1.    1.  
 
       p(18)
 
 
         column  1 to 11
 
    0.    0.    0.    0.    0.    0.    0.    0.    0.    0.    0.  
 
         column 12 to 15
 
    0.    0.    0.    0.  
 
       p(19)
 
 
         column  1 to 11
 
    0.    0.    0.    0.    0.    0.    0.    0.    0.    0.    0.  
 
         column 12 to 15
 
    0.    0.    0.    0.  
 
       p(20)
 
 
         column  1 to 11
 
    0.    0.    0.    0.    0.    0.    0.    0.    0.    0.    0.  
 
         column 12 to 15
 
    0.    0.    0.    0.  
 
       p(21)
 
 
         column  1 to 11
 
    0.    0.    0.    0.    0.    0.    0.    0.    0.    0.    0.  
 
         column 12 to 15
 
    0.    0.    0.    0.  
 
       p(22)
 
 
         column  1 to 11
 
    0.    0.    0.    0.    0.    0.    0.    0.    0.    0.    0.  
 
         column 12 to 15
 
    0.    0.    0.    0.  
 
       p(23)
 
 
         column  1 to 11
 
    0.    0.    0.    0.    0.    0.    0.    0.    0.    0.    0.  
 
         column 12 to 15
 
    0.    0.    0.    0.  
 
       p(24)
 
 
         column  1 to 11
 
    0.    0.    0.    0.    0.    0.    0.    0.    0.    0.    0.  
 
         column 12 to 15
 
    0.    0.    0.    0.  
 
       p(25)
 
 
         column  1 to 11
 
    0.    0.    0.    0.    0.    0.    0.    0.    0.    0.    0.  
 
         column 12 to 15
 
    0.    0.    0.    0.  
 
       p(26)
 
 
         column  1 to 11
 
    0.    0.    0.    0.    0.    0.    0.    0.    0.    0.    0.  
 
         column 12 to 15
 
    0.    0.    0.    0.  
 
       p(27)
 
 
         column  1 to 11
 
    0.    0.    0.    0.    0.    0.    0.    0.    0.    0.    0.  
 
         column 12 to 15
 
    0.    0.    0.    0.  
 
       p(28)
 
    15.  
 
       p(29)
 
    1.  
 
       p(30)
 
    1.  
 
       p(31)
 
    4.  
 
       p(32)
 
    1.  
 
       p(33)
 
     []
 
       p(34)
 
     []
 
-->// show the graph
 
-->show_graph(p)
 ans  =
 
    3.  
 
-->// Note how we had to use the file system to move the graph to scilab
 
-->// Method 2 Construct the graph by hand
 
-->name = 'p2'; directed = 0; // undirected
 
-->n = 10;
 
-->tail = [1 2 3 4 5 1 2 3 4 5 6 8 10 7 9];
 
-->head = [2 3 4 5 1 6 7 8 9 10 8 10 7 9 6];
 
-->g2 = make_graph(name,directed,n,tail,head);
 
-->show_graph(g2);
 !--error 60 
argument with incompatible dimensions
at line      24 of function ge_arc_coordinates called by :  
line    13 of function ge_drawarcs called by :  
line    10 of function ge_drawobjs called by :  
line     4 of function ge_do_replot called by :  
line    17 of function ge_show_new called by :  
line    49 of function show_graph called by :  
show_graph(g2);
 
 
-->// Forgot to position the graph
 
-->t=0:2*%pi/5:(9*%pi/5)
 t  =
 
    0.    1.2566371    2.5132741    3.7699112    5.0265482  
 
-->g('node_x') = [50*cos(t), 25*cos(t)];
 
-->g('node_y') = [50*sin(t), 25*sin(t)];
 
-->g2('node_x') = [50*cos(t), 25*cos(t)];
 
-->g2('node_y') = [50*sin(t), 25*sin(t)];
 
-->show_graph(g2);
 
-->g2('node_x') = [100*cos(t), 50*cos(t)];
 
-->g2('node_y') = [100*sin(t), 50*sin(t)];
 
-->show_graph(g2);
 
-->g2('node_y') = [200*sin(t), 100*sin(t)];
 
-->g2('node_x') = [200*cos(t), 100*cos(t)];
 
-->show_graph(g2);
 
-->getf('tool.sci')
 
-->y = circ(g2)
 y  =
 
 
       y(1)
 
 
         column 1 to 8
 
!graph  name  directed  node_number  tail  head  node_name  node_type  !
 
         column  9 to 14
 
!node_x  node_y  node_color  node_diam  node_border  node_font_size  !
 
         column 15 to 19
 
!node_demand  edge_name  edge_color  edge_width  edge_hi_width  !
 
         column 20 to 24
 
!edge_font_size  edge_length  edge_cost  edge_min_cap  edge_max_cap  !
 
         column 25 to 28
 
!edge_q_weight  edge_q_orig  edge_weight  default_node_diam  !
 
         column 29 to 31
 
!default_node_border  default_edge_width  default_edge_hi_width  !
 
         column 32 to 34
 
!default_font_size  node_label  edge_label  !
 
       y(2)
 
 p2   
 
       y(3)
 
    0.  
 
       y(4)
 
    10.  
 
       y(5)
 
 
         column  1 to 11
 
    1.    2.    3.    4.    5.    1.    2.    3.    4.    5.    6.  
 
         column 12 to 15
 
    8.    10.    7.    9.  
 
       y(6)
 
 
         column  1 to 11
 
    2.    3.    4.    5.    1.    6.    7.    8.    9.    10.    8.  
 
         column 12 to 15
 
    10.    7.    9.    6.  
 
       y(7)
 
!1  2  3  4  5  6  7  8  9  10  !
 
       y(8)
 
     []
 
       y(9)
 
 
         column 1 to 6
 
    200.    161.8034    61.803399  - 61.803399  - 161.8034  - 200.  
 
         column  7 to 10
 
  - 161.8034  - 61.803399    61.803399    161.8034  
 
       y(10)
 
 
         column 1 to 6
 
    0.    117.55705    190.2113    190.2113    117.55705    2.449E-14  
 
         column  7 to 10
 
  - 117.55705  - 190.2113  - 190.2113  - 117.55705  
 
       y(11)
 
     []
 
       y(12)
 
     []
 
       y(13)
 
     []
 
       y(14)
 
     []
 
       y(15)
 
     []
 
       y(16)
 
!1  2  3  4  5  6  7  8  9  10  11  12  13  14  15  !
 
       y(17)
 
 
         column  1 to 11
 
    1.    1.    1.    1.    1.    1.    1.    1.    1.    1.    1.  
 
         column 12 to 15
 
    1.    1.    1.    1.  
 
       y(18)
 
 
         column  1 to 11
 
    1.    1.    1.    1.    1.    1.    1.    1.    1.    1.    1.  
 
         column 12 to 15
 
    1.    1.    1.    1.  
 
       y(19)
 
 
         column  1 to 11
 
    1.    1.    1.    1.    1.    1.    1.    1.    1.    1.    1.  
 
         column 12 to 15
 
    1.    1.    1.    1.  
 
       y(20)
 
 
         column  1 to 11
 
    0.    0.    0.    0.    0.    0.    0.    0.    0.    0.    0.  
 
         column 12 to 15
 
    0.    0.    0.    0.  
 
       y(21)
 
     []
 
       y(22)
 
     []
 
       y(23)
 
     []
 
       y(24)
 
     []
 
       y(25)
 
     []
 
       y(26)
 
     []
 
       y(27)
 
     []
 
       y(28)
 
    15.  
 
       y(29)
 
    1.  
 
       y(30)
 
    1.  
 
       y(31)
 
    3.  
 
       y(32)
 
    8.  
 
       y(33)
 
 
       y(34)
 
!                              !
 
-->show_graph(y)
 ans  =
 
    3.  
 
-->show_graph(g2)
 ans  =
 
    3.  
 
-->getf('tool.sci')
 
-->k5=k(5);
 !--error 10000 
Matrix must be sparse                                                          
at line      15 of function mat_2_graph called by :  
line     3 of function k called by :  
k5=k(5);
 
 
-->getf('tool.sci')
 
-->k5=k(5);
 
-->show_graph(k5)
 ans  =
 
    3.  
 
-->k5
 k5  =
 
 
       k5(1)
 
 
         column 1 to 8
 
!graph  name  directed  node_number  tail  head  node_name  node_type  !
 
         column  9 to 14
 
!node_x  node_y  node_color  node_diam  node_border  node_font_size  !
 
         column 15 to 19
 
!node_demand  edge_name  edge_color  edge_width  edge_hi_width  !
 
         column 20 to 24
 
!edge_font_size  edge_length  edge_cost  edge_min_cap  edge_max_cap  !
 
         column 25 to 28
 
!edge_q_weight  edge_q_orig  edge_weight  default_node_diam  !
 
         column 29 to 31
 
!default_node_border  default_edge_width  default_edge_hi_width  !
 
         column 32 to 34
 
!default_font_size  node_label  edge_label  !
 
       k5(2)
 
 foo   
 
       k5(3)
 
    0.  
 
       k5(4)
 
    5.  
 
       k5(5)
 
    1.    1.    1.    1.    2.    2.    2.    3.    3.    4.  
 
       k5(6)
 
    2.    3.    4.    5.    3.    4.    5.    4.    5.    5.  
 
       k5(7)
 
!1  2  3  4  5  !
 
       k5(8)
 
     []
 
       k5(9)
 
    200.    61.803399  - 161.8034  - 161.8034    61.803399  
 
       k5(10)
 
    0.    190.2113    117.55705  - 117.55705  - 190.2113  
 
       k5(11)
 
     []
 
       k5(12)
 
     []
 
       k5(13)
 
     []
 
       k5(14)
 
     []
 
       k5(15)
 
     []
 
       k5(16)
 
!1  2  3  4  5  6  7  8  9  10  !
 
       k5(17)
 
    1.    1.    1.    1.    1.    1.    1.    1.    1.    1.  
 
       k5(18)
 
    1.    1.    1.    1.    1.    1.    1.    1.    1.    1.  
 
       k5(19)
 
    1.    1.    1.    1.    1.    1.    1.    1.    1.    1.  
 
       k5(20)
 
    0.    0.    0.    0.    0.    0.    0.    0.    0.    0.  
 
       k5(21)
 
     []
 
       k5(22)
 
     []
 
       k5(23)
 
     []
 
       k5(24)
 
     []
 
       k5(25)
 
     []
 
       k5(26)
 
     []
 
       k5(27)
 
     []
 
       k5(28)
 
    15.  
 
       k5(29)
 
    1.  
 
       k5(30)
 
    1.  
 
       k5(31)
 
    3.  
 
       k5(32)
 
    8.  
 
       k5(33)
 
 
       k5(34)
 
!                    !
 
-->show_graph(k5)
 ans  =
 
    3.  
 
-->k7=k(7);
 
-->show_graph(k7)
 ans  =
 
    3.  
 
-->getf('tool.sci')
 
-->kp23=kp(2,3);
 !--error 6 
inconsistent row/column dimensions
at line       3 of function kp called by :  
kp23=kp(2,3);
 
 
-->zeros(2,2)
 ans  =
 
    0.    0.  
    0.    0.  
 
-->[zeros(2,2), ones(2,3)]
 ans  =
 
    0.    0.    1.    1.    1.  
    0.    0.    1.    1.    1.  
 
-->[zeros(2,2), ones(2,3); ones(3,2), zeros(3,3)]
 ans  =
 
    0.    0.    1.    1.    1.  
    0.    0.    1.    1.    1.  
    1.    1.    0.    0.    0.  
    1.    1.    0.    0.    0.  
    1.    1.    0.    0.    0.  
 
-->getf('tool.sci')
 
-->kp23=kp(2,3);
 !--error 5 
inconsistent column/row dimensions
at line       4 of function kp called by :  
kp23=kp(2,3);
 
 
-->getf('tool.sci')
 
-->kp23=kp(2,3);
 !--error 5 
inconsistent column/row dimensions
at line       4 of function kp called by :  
kp23=kp(2,3);
 
 
-->getf('tool.sci')
 
-->kp23=kp(2,3);
 
-->show_graph(kp23)
 ans  =
 
    3.  
 
-->getf('tool.sci')
 
-->c10=c(10);
 
-->show_graph(c10)
 ans  =
 
    3.  
 
-->getf('tool.sci')
 
-->p7 = p(7)
 p7  =
 
 
       p7(1)
 
 
         column 1 to 8
 
!graph  name  directed  node_number  tail  head  node_name  node_type  !
 
         column  9 to 14
 
!node_x  node_y  node_color  node_diam  node_border  node_font_size  !
 
         column 15 to 19
 
!node_demand  edge_name  edge_color  edge_width  edge_hi_width  !
 
         column 20 to 24
 
!edge_font_size  edge_length  edge_cost  edge_min_cap  edge_max_cap  !
 
         column 25 to 28
 
!edge_q_weight  edge_q_orig  edge_weight  default_node_diam  !
 
         column 29 to 31
 
!default_node_border  default_edge_width  default_edge_hi_width  !
 
         column 32 to 34
 
!default_font_size  node_label  edge_label  !
 
       p7(2)
 
 foo   
 
       p7(3)
 
    0.  
 
       p7(4)
 
    7.  
 
       p7(5)
 
    1.    2.    3.    4.    5.    6.  
 
       p7(6)
 
    2.    3.    4.    5.    6.    7.  
 
       p7(7)
 
!1  2  3  4  5  6  7  !
 
       p7(8)
 
     []
 
       p7(9)
 
 
         column 1 to 5
 
  - 100.  - 66.666667  - 33.333333    7.105E-15    33.333333  
 
         column 6 to 7
 
    66.666667    100.  
 
       p7(10)
 
    0.    0.    0.    0.    0.    0.    0.  
 
       p7(11)
 
     []
 
       p7(12)
 
     []
 
       p7(13)
 
     []
 
       p7(14)
 
     []
 
       p7(15)
 
     []
 
       p7(16)
 
!1  2  3  4  5  6  !
 
       p7(17)
 
    1.    1.    1.    1.    1.    1.  
 
       p7(18)
 
    1.    1.    1.    1.    1.    1.  
 
       p7(19)
 
    1.    1.    1.    1.    1.    1.  
 
       p7(20)
 
    0.    0.    0.    0.    0.    0.  
 
       p7(21)
 
     []
 
       p7(22)
 
     []
 
       p7(23)
 
     []
 
       p7(24)
 
     []
 
       p7(25)
 
     []
 
       p7(26)
 
     []
 
       p7(27)
 
     []
 
       p7(28)
 
    15.  
 
       p7(29)
 
    1.  
 
       p7(30)
 
    1.  
 
       p7(31)
 
    3.  
 
       p7(32)
 
    8.  
 
       p7(33)
 
 
       p7(34)
 
!            !
 
-->show(p7)
         !--error 4 
undefined variable : show                    
 
 
-->show_graph(p7)
 ans  =
 
    3.  
 
-->diary(0);
