Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
%
%
%
%
%
kldemonew.m
Demonstration of Kernighan-Lin Bi-partitioning Algorithm
(C) 2004 by Yu Hen Hu
created: 9/4/2004
updated: 9/11/2004 add a third example
updated: 12/14/2004 add choice = 3, and interactive problem entry
to
% now convert into node indices for the two selected nodes
bidx(iter) = idxB(id2); % node index for node b
aidx(iter) = idxA(ida); % node index for node a
disp(['iter = ' int2str(iter) ', nodes to be exchanged: ' ...
int2str(aidx(iter)) ', and ' int2str(bidx(iter)) ...
' Max. g = ' num2str(g(iter))]);
% In summary, the maximum g value corrsponds to exchange
% node aidx(iter) in A and node bidx(iter) in B, and these nodes correspond
% the ida, and idb rows and columns in the current c matrix
%
%
%
%