The secondary cooling has a considerable influence on cracks and other defects of the billets. The aim of this paper is to develop a optimization algorithm used for solving the optimal secondary cooling water flow rate under different casting speeds. For this purpose, an optimization algorithm based on ant colony system(ACS) algorithm was developed for solving an optimal control of secondary cooling water distribution according to certain metallurgical criteria and some technological constraints. The optimization method consists of the simulator of continuous casting process, ACS algorithm linked with aggregate cost function. The use of the developed optimization algorithm for determining optimal setting of cooling parameters demonstrate that better results can be attained in improving the surface temperature distribution.