search m of nodes with sorted on less weights from n number of nodes where m < n