# Vehicular Edge-Computing Framework for Making Use of Parking and Charging Electric Vehicles
## 4 Problem Description and Optimal Solution
### Task Offloading Analysis Based on Starkelberg Game  
As mentioned above, there is a competition-cooperation relationship between the participants in VEC, and each participant wants to maximize its interest. We can model the interactions among the participants as a Starkelberg game, which is a two-stage full information dynamic game with sequential timing. The participants in the game are divided into two groups, the leaders and the followers. The leaders are the participants who make decisions first, and the remaining participants make decisions based on the leaders' decisions which are called followers. The main idea of the Starkelberg game is that each side chooses its strategy based on the possible strategies of the other side to ensure that it maximizes the benefit of the other side's strategy, thus achieving a Nash equilibrium [23].  
As shown in Figure 2, the framework proposed in this paper is a three-party game model based on the Starkelberg game. The participants are the requesting vehicle, the edge server, and the ECP. The edge server and the ECP, as the leaders of the game, make the price decision first, and the requesting vehicle, as the follower, makes the offloadingdecision later. Since the edge server has higher processing power than the parking vehicle, the requesting vehicle will offload the task to the edge server first. At the same time, the requesting vehicle can also offload tasks to the ECP to get relatively cheaper services. Once the ECP receives the task offload request, the ECP will divide the task into some sub-tasks and assign these sub-tasks to the parking vehicle for processing. In addition, there is a non-cooperative game between the edge server and the ECP. For example, when the VEC server offers a higher price, the requesting vehicle is more likely to offload more tasks to the ECP, even if the ECP has a lower computation rate. Likewise, when the ECP offers a higher price, the requesting vehicle is more likely to obtain compute services from the VEC server. Thus, the pricing strategies of the edge server and the ECP can influence each other. In this three-party game, each party is a rational, selfish individual who wants to achieve maximum utility. From the above, we can know that this game has obvious leaders and followers, and it is suitable to use Starkelberg game to analyze their behavior interaction. In the following, based on the inverse induction method, we will prove that there is a unique Nash equilibrium of the game, and find the optimal strategies for the participants in the game.  
**Definition 1**.: _It is supposed that the best strategy for requesting vehicles is (\(q_{iv}^{*}\), \(q_{iv}^{*}\)) which means the \(q_{iv}^{*}\) and \(q_{iv}^{*}\) task data amount are offloaded to the edge server and the ECP, respectively. Moreover, \(p_{iv}^{*}\) and \(p_{iv}^{*}\) are the best prices given by the edge server and the ECP, respectively. Then, for any combination of \(p_{iv}\), \(p_{iv}\), \(q_{iv}\) and \(q_{iv}\), if the inequality (17) holds, the (\(p_{iv}^{*}\),\(p_{iv}^{*}\),\(q_{iv}^{*}\)) is the solution of Starkelberg game equilibrium._  
\[\left\{\begin{array}{rcl}U_{R_{i}}(q_{iv}^{*},p_{iv}^{*},p_{iv}^{*})&\geq&U_{ R_{i}}(q_{iv},p_{iv},p_{ie})\\ U_{VEC}(q_{iv}^{*},p_{iv}^{*})&\geq&U_{VEC}(q_{iv},p_{iv})\\ U_{ECP}(q_{iv}^{*},p_{iv}^{*})&\geq&U_{ECP}(q_{iv},p_{ie})\end{array}\right. \tag{17}\]  
_In this two-stage game, we use the inverse induction method to analyze the interactions between participants, and the second stage is analyzed first._