def royal_road2(individual, order):
 total = 0
 norder = order
 while (norder < (order ** 2)):
  total += royal_road1(norder, individual)[0]
  norder *= 2
 return (total,)

def royal_road2 ( individual , order ) : total = 0 norder = order while ( norder < ( order ** 2 ) ) : total += royal_road1 ( norder , individual ) [ 0 ] norder *= 2 return ( total , )
royal road function r2 as presented by melanie mitchell in : "an introduction to genetic algorithms" .