Materials are chemicals that we use every day for tools, tasks, and technology. For most of history, making a material required trial-and-error, synthesizing and testing, a costly endeavor in time and money. With modern computing, not only can the trial-and-error be hastened, but sometimes avoided altogether. The application of a material depends on its properties, which arise from its structure, thus by exploring chemical structure we can predict properties and design materials to suit. One tool to accomplish this is the genetic algorithm (GA), which can build and test chemical structures for a desired property, and then produce new chemical structures through reproduction. Genetic algorithms have been applied to chemistry for 30 years in solving X-ray diffraction patterns, protein folding, and predicting surface structures. Here a GA is applied to solve the structure of Li-Al layered double hydroxide (LDH), given an experimental X-ray diffraction pattern and debate in the literature. The resulting GA can build a wide variety of LDH structures by stacking layers of crystal and molecule together, eventually providing a set of structures that can be used for further quantum mechanical calculations. The GA was then generalized to a wider variety of layered structures, resulting in the development of the Genetic Algorithm for Layered Structures (GALS). GALS is able to generate LDH structures with multiple elements and molecules, structures with different coordinating groups, molecular crystals, and perovskites. Initial results are promising, with testing under a small number of generations showing significant improvements in fitness, and room for generalization down the road.