sort and filter top n nodes
fixed maxnumber of nodes