In the present work constructal design is employed to optimize the geometry of a convective, Y-shaped cavity that intrudes into a solid conducting wall. The main purpose is to investigate the influence of the dimensionless heat transfer parameter a over the optimal geometries of the cavity, i.e., the ones that minimize the maximum excess of temperature (or reduce the thermal resistance of the solid domain). The search for the best geometry has been performed with the help of a genetic algorithm (GA). For square solids (H/L = 1.0) the results obtained with an exhaustive search (which is based on solution of all possible geometries) were adopted to validate the GA method, while for H/L ≠ 1.0 GA is used to find the best geometry for all degrees of freedom investigated here: H/L, t1/t0, L1/L0, and α (four times optimized). The results demonstrate that there is no universal optimal shape that minimizes the thermal field for all values of a investigated. Moreover, the temperature distribution along the solid domain becomes more homogeneous with an increase of a, until a limit where the configuration of “optimal distribution of imperfections” is achieved and the shape tends to remain fixed. Finally, it has been highlighted that the GA method proved to be very effective in the search for the best shapes with the number of required simulations much lower (8 times for the most difficult situation) than that necessary for exhaustive search.