In today’s world, the development and continuation of life require energy. Supplying this energy demand requires careful and scientific planning of the energy provided by a variety of products, such as oil, gas, coal, electricity, etc. A new study on the operation of energy carriers called Energy Commitment (EC) is proposed. The purpose of the EC is to set a pattern for the use of energy carriers to supply energy demand, considering technical and economic constraints. EC is a constrained optimization problem that can be solved by using optimization methods. This study suggests the Following Optimization Algorithm (FOA) to solve the EC problem to achieve technical and economic benefits. Minimizing energy supply costs for the total study period is considered as an objective function. The FOA simulates social relationships among the community members who try to improve their community by following each other. Simulation is carried out on a 10-unit energy system supplied by various types of energy carriers that includes transportation, agriculture, industrial, residential, commercial, and public sectors. The results show that the optimal energy supply for a grid with 0.15447 Millions of Barrels of Oil Equivalent (MBOE) of energy demand costs 9.0922 millions dollar for a 24-h study period. However, if the energy supply is not optimal, the costs of operating energy carriers will increase and move away from the optimal economic situation. The economic distribution of electrical demand between 10 power plants and the amount of production units per hour of the study period is determined. The EC outputs are presented, which include an appropriate pattern of energy carrier utilization, energy demand supply costs, appropriate combination of units, and power plant production. The behavior and process of achieving the answer in the convergence curve for the implementation of FOA on EC indicates the exploration and exploitation capacity of FOA. Based on the simulated results, EC provides more information than Unit Commitment (UC) and analyzes the network more efficiently and deeply.