Molecular simulations using a genetic algorithm are conducted to investigate stable structures of clusters and deposited atoms on substrates. First, the stable structures of N-atom clusters are calculated, where an icosahedron is found to be the most stable form of a 13-atom cluster. Secondly, stable structures of deposited atoms on a solid surface are investigated. The simulation shows that deposited atoms have either an island or a layer structure, depending on the combination of intermolecular potentials between the deposited and substrate atoms. The present simulation is based on statics, which demands little computing power.