finding minimums implemented for matrix triangulation