Decreasing energy consumption in networks with limited resources, such as the Internet of Things, has always been one of the main challenges in guaranteeing network performance. In this article, cooperative game theory is employed to improve the cooperation patterns of fog computing resources. The EDLIoT method consists of two main steps: “Topology Construction” and “Determining Optimal Fog Computing Resources to Process IoT Object Tasks”. In the first step of the proposed method, the set of reliable communications in the network is identified to establish connections between IoT objects and fog computing resources in the form of a tree structure. Then, in the second step, a model based on cooperative game theory and the cost function is used to determine the optimal computing resources in the fog layer for outsourcing the processing tasks of IoT objects. In EDLIoT, active IoT objects perform computation in the fog layer instead of locally, to conserve energy. This is done so that IoT objects, if possible, discover the most suitable processing resources in the fog based on characteristics such as energy consumption, delay, and processing power of the computing resource. The efficiency of the proposed method has been evaluated in a simulated environment, and the results have been compared with those of previous algorithms. The results demonstrate that using the EDLIoT method, in addition to decreasing energy consumption and delay, more computing tasks can be processed through fog resources, thereby increasing the quality of service for IoT users.