Code covered by the BSD License  

Highlights from
Weighted maximum matching in general graphs

image thumbnail

Weighted maximum matching in general graphs

by

 

Computes a maximum-weighted matching in a general undirected graph.

runUnitTest(edgeData,correct, inmaxcardinality)
function passed = runUnitTest(edgeData,correct, inmaxcardinality)
if ~exist('inmaxcardinality')
    inmaxcardinality = false;
end

edgeData(:,1) = edgeData(:,1) +1; edgeData(:,2) = edgeData(:,2) +1; 
result = maxWeightMatching(edgeData, inmaxcardinality);
result = result-1;
result(find(result==-2)) = -1;
passed = all(result == correct);
% disp(result);
% disp(correct);

Contact us