Significantly improve minmaxrandga performance

Added sample points on boundaries.
Fixed a selection bug
Added a max-min solver