bfstree bfstree(t,g,v) --- create a breadth-first spanning tree of g
dfstree dfstree(t,g,v) --- create a depth-first spanning tree of g
SOURCE CODE
0001 function copy_labels(g,h)
0002 % copy_labels(g,h) --- copy labels from h to g
0003
0004 if ~is_labeled(h)
0005 error('Source graph (2nd argument) must be labeled')
0006 end
0007
0008 ng = nv(g);
0009 nh = nv(h);
0010
0011 label(g);
0012 for v=1:min(ng,nh)
0013 label(g,v,get_label(h,v));
0014 end