One of the important features of industrialized and developing countries is the presence of money, dynamic market and capital. In other words, if the saving of individuals will be directed by appropriate mechanism to the manufacturing sector it brings efficiency not only to the owners of capital but also it can be considered as the most important funding for launching economic projects of society. In present study, three stock selection and optimization ALGORITHMS including GENETIC algorithm, particle swarm algorithm, and cultural algorithm has been studied. So, 106 listed companies in Tehran Stock Exchange, since 2007 to 2014 were tested in order to investigate this. In this study, for plotting the efficient frontier and comprising of the optimal portfolio half of the variance is considered as the main factor of risk. This research investigates the significant difference between the averages of investment output in selected baskets based on three methods. The statistical analysis of the results shows that there is no difference between the three ALGORITHMS. However, in order to compare the two ALGORITHMS and analysis of superiority of ALGORITHMS, these two methods of optimization have been compared from two aspects of objective function, output ratio and risk. Since the objective function of particle swarm ALGORITHMS was less, in other word, it has the least error and gain the best result so in comparing to other ALGORITHMS it has been performed better which shows the relative superiority of this ALGORITHMS in the selection of the optimal portfolio.