MinKL algorithm