A structural optimization method is presented for a problem with a discontinuous cost function. The method is based on the genetic algorithm which simulates the rules of biological growth. The proposed method is applied to topology optimization of trusses, where the nodal cost is included in the cost function. Since the gradient information is not needed in the genetic algorithm it can be successfully applied for problems with discontinuous cost functions. The cross-sectional area of a member is represented by a string of binary data. An extra bit to indicate the existence of a member is quite useful to find an approximate solution by a small number of population.