Structure optimization by heuristic algorithm in a coarse-grained off-lattice model