Distribution of distributed generation resources in distribution systems has several advantages, including reducing losses, improving voltage profiles, reducing pollution, and increasing system reliability. However, one of the most important points regarding the placement of these resources in distribution networks is economic issues and the return on investment and the increase in profits from the placement of these resources. On the other hand, due to the privatization of power systems, other distribution networks will not necessarily own the distributed generation resources. Therefore, despite choosing the location of scattered production resources by the owners of scattered production resources and pricing their production power, the selection of purchasing power from each of the scattered production units or the national electricity system is done by the distribution network operator. It will be for supply. Thus, owners of scattered production resources must choose the location and price of the production capacity of their resources in such a way that their profit is maximized and at the same time the amount of payment paid by the network operator is minimized. Therefore, in this paper, the issue of location and optimal pricing of distributed products is considered to increase the profit of the owner of scattered production resources provided that the distribution company pays the minimum payment cost and the method used to solve this problem is the ant-optimization algorithm. It is inspired by the ant's milk hunting mechanism and is a powerful optimization algorithm.