Added minimum weight perfect matching capability.