A novel approach for optimizing the geometrical shape of an object designed to extremize a set of performance criteria is developed and applied to the problem of optimizing the shape of a cold neutron source. First, an analogy is drawn between the shape optimization problem and a state space search, which is one of the fundamental problems in artificial intelligence applications. Then, a description is given of the implementation of this new approach into the computer code DAIT in which the physical model is represented by a two-group, r-z geometry nodal diffusion method, and the search is conducted via a truncated breadth-first algorithm. This algorithm reduces to the traditional nearest neighbor algorithm if the search breadth is truncated at one. The accuracy of the nodal diffusion method solution on the meshes of interest in this work is established, as well as the adequacy of the diffusion approximation itself via comparisons with transport theory solutions. Next, the dependence of the optimum shape and its value on several physical and search parameters are investigated via several numerical experiments. Finally, it is shown that starting from different initial states, the same final optimum state can be obtained if the search breadth is increased sufficiently.