# MinMaxNN: minimum of MaxNN(G,H) over all subsets H of [n] with size r. MinMaxNN:=proc(G,r) local n,i,c,mini,curr: n:=G[1]: c:=firstcomb(n,r): mini:=MaxNN(G,c): # check {1,..,r} first while nextcomb(c,n)<>FAIL do: # check all other r-subsets of [n] and update the minimum if they are better c:=nextcomb(c,n): curr:=MaxNN(G,c): if curr < mini then: mini:=curr: fi: od: mini: end: