An algorithm to sculpt photon dispersion in a subwavelength nanostructure