(a) The flowchart of Genetic Algorithm (GA) based topology optimization. 2D scattering pattern is represented with bit-array and rigorous coupled wave analysis (RCWA) is adopted to evaluate the absorption coefficient for each design. Designs are then optimized based on the corresponding absorption coefficients using GA that consists of selection, crossover, and mutation. The density filtering technique is utilized to treat numerical instabilities. (b) Schematic illustration of a typical operation of selection, crossover, and mutation of GA within one evolving iteration. An initial generation of 6 individual designs (1,1~6) with elements is first created. Each element is known as a gene in GA. Designs (1,2), (1,3), (1,4), (1,5) with superior performance are selected to form the mating pool, i.e. designs (2,1~6). While designs (1,2) and (1,5) have been selected twice respectively due to their outstanding performance and keeping population constant. Then three mating pairs are randomly picked from the mating pool and each pair generates two offsprings, i.e. ((2,1), (2,3)) ((3,1), (3,2)), ((2,2), (2,4)) (3,3), (3,4)), ((2,3), (2,6)) ((3,5), (3,6)), respectively. During the crossover, genes of a mating pair at the same loci switch with each other stochastically, such as the highlighted gene loci in designs (2,1) and (2,3), and result in the highlighted gene loci in designs (3,1) and (3,2). After the crossover, genes in each design may mutate to their opposite phase at a certain probability. Designs (4,1) and (4,6) are obtained from designs (3,1) and (3,6) respectively with mutations at the highlighted gene loci, while the rest designs remain the same.