Ngā hua rapu - binary (whole OR while) optimization algorithm