In this paper, we provide a genetic programming (GP) based method for generating quantum circuits preparing maximally multipartite entangled states (MMES). The presented method is faster that known realizations thanks to the applied fitness function and several modifications to the GP schema. Moreover, we enrich the described method by the unique possibility to define an arbitrary structure of a system. We use the developed method to find new quantum circuits, which are simpler from known results. We also analyze the efficiency of generating entanglement in the spin chain system and in the system of complete connections.