13.08.2013 Views

?????????????? ?????? ? ????????? ?????????? ??????? ?????

?????????????? ?????? ? ????????? ?????????? ??????? ?????

?????????????? ?????? ? ????????? ?????????? ??????? ?????

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

function [C,A,g]=formc(ta,he)<br />

maxv1=max (ta);maxv2=max (he);maxv= max (maxv1,maxv2);<br />

g = make _graph ('cep1',1,maxv,ta,he);<br />

g1=make _graph ('cep2',0,maxv,ta,he);<br />

a=graph _2_mat (g,'node-arc');<br />

A0=full (a); arc = arc_number (g); node = node_number (g);<br />

nc=connex (g);<br />

if nc==1 then<br />

t= min _weight _tree (node,g1);<br />

yzl=maxv; hordsum=setdiff (1:arc,t)<br />

at(1:node-1, 1:arc)=A0(1:node-1, 1:arc);<br />

size_hord=size(hordsum);<br />

for i=1:size_hord(2) at(node-1+i,hordsum(i))=1; end;<br />

else<br />

inow=0;kd=0;<br />

for ks=1:nc<br />

ns=con_nodes(ks,g); size_ns=size(ns); kyz=size_ns(2);<br />

for j=1:kyz-1 yz0(kd+j)=ns(j); end; kd=kd+kyz-1;<br />

k=0;vetv= zeros(arc);<br />

for i=1:kyz<br />

i1=ns(i);<br />

for j=1:arc<br />

jot=j;<br />

if A0(i1,j)==- 1. then<br />

k=k+1; vetv(k)=j;<br />

end;<br />

end;<br />

end;<br />

gpod1=subgraph (ns,'nodes',g1); node1 = node_number (gpod1);<br />

t= min _weight _tree (node1,gpod1); size_t= size(t);<br />

for ii=1:size_t(2)<br />

tnew(ii)=vetv(t(ii));<br />

end;<br />

hord=setdiff (vetv',tnew');<br />

for j=1:k-ii hordsum(inow+j)=hord(j); end; inow=inow+k-ii;<br />

end;<br />

hordsum=hordsum'; yzl=yz0'; size_yz0=size(yz0');<br />

for j=1:size_yz0(2)<br />

for i=1:node<br />

if i==yz0(j) then<br />

at(j,1:arc)=A0(i,1:arc);<br />

end;<br />

end;<br />

end;<br />

size_hord=size(hordsum); nhord=size_hord(2);<br />

for i=1:nhord at(size_yz0(2)+i,hordsum(i))=1; end;<br />

end;<br />

A=at'; C=at^(- 1);<br />

endfunction ;<br />

82

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!