.TH trans_closure 1 "September 1995" "Scilab Group" "Scilab function"
.so man1/sci.an
.SH NAME
trans_closure - transitive closure
.SH CALLING SEQUENCE
.nf
g1 = trans_closure(g)
.fi
.SH PARAMETERS
.TP 2
g
: graph-list
.TP 3
g1
: graph-list
.SH DESCRIPTION
\fVtrans_closure\fR returns as a new graph-list \fVg1\fR the transitive
closure of the graph \fVg\fR. This graph must be directed and connected.
If \fV<name>\fR if the name of graph \fVg\fR, 
\fV<name>_trans_closure\fR is the name of the transitive closure.
.SH EXAMPLE
.nf
ta=[2 3 3 5 3 4 4 5 8];
he=[1 2 4 2 6 6 7 7 4];
gt=make_graph('foo',1,8,ta,he);
gt('node_x')=[129 200 283 281 128 366 122 333];
gt('node_y')=[61 125 129 189 173 135 236 249];
show_graph(gt,'rep');
g1=trans_closure(gt);
vv=1*ones(ta); aa=sparse([ta' he'],vv');
ta1=g1('tail'); he1=g1('head');
ww=1*ones(ta1); bb=sparse([ta1' he1'],ww');
dif=bb-aa; lim=size(ta1); edgecolor=0*ones(ta1);
for i=1:lim(2)
 if dif(ta1(i),he1(i))==1 then edgecolor(i)=11; end;
end;
g1('edge_color')=edgecolor;
x_message('Transitive closure of the graph');
show_graph(g1,'rep');
.fi
