# Global Resource Scheduling for Distributed Edge Computing
## 3 System Formulation  
### Problem Definition  
The topology of the system is illustrated in Figure 2. Each resource node in the figure can represent any entity with resources, such as an intelligent edge node or an IoT base station as shown in Figure 1. Each resource node possesses multiple resources of the same type, and each resource is characterized by two key attributes \(\langle C,P\rangle\). Here, \(C\) denotes the quantity of resources the entity owns. If it is a positive number, the entity possesses \(C\) resources; if it is zero or negative, the entity must request at least \(C\) resources. The attribute \(P\) represents the resource price. If \(C>0\), then \(P\) signifies the unit price of the resource; if \(C\leq 0\), \(P\) represents the total resource budget requested. The weight value of the edge connecting any two nodes represents the contribution value of resource migration between them. This value primarily reflects factors such as the distance between nodes, migration history, and other relevant information. The value is automatically updated with each node resource migration. In Figure 2, nodes \(A\) and \(B\) are part of the same cell, denoted by dotted lines, indicating that the distance cost of resource migration (or communication cost in IoT edge computing applications) between these two nodes is relatively small. As an illustrative example, consider that node \(A\) requires at least three No. 0 resources, with a total budget of 23. Nodes \(B\), \(C\), and \(D\) each possess No. 0 resources, where the unit price of node \(D\) is 9, and node \(B\) is 8. If three resources are obtained from either \(D\) or \(B\), we have \(3\times 9>23\) and \(3\times 8>23\), which do not meet the budget requirements. Therefore, only one part can be selected from \(D\) and \(B\). In this example, there are multiple options, such as migrating 2 No. 0 resources from \(B\) and 1 No. 0 resource from \(C\), resulting in a total cost of \(2\times 8+1\times 7=23\), meeting the budget requirements. Alternatively, we can migrate 1 No. 0 resource from \(B\), \(C\), and \(D\), respectively, resulting in a total cost of \(8+7+9=24\). As the number of nodes and resource types increases, when multiple nodes are involved in resource migration, ensuring the minimum scheduling cost for each node becomes a challenging global optimization problem. Suppose there are \(I\) nodes in total, and each node has the same \(J\) resource type. \(\forall i\in\{0,1,\ldots,I-1\},j\in\{0,1,\ldots,J-1\}\), \(C_{i,j}\) represents the quantity of the \(j\)-th resource of the \(i\)-th node; \(P_{i,j}\) represents the unit price of the \(j\)-th resource at the \(i\)-th node. \(\forall i,i^{\prime}\in\{0,1,\ldots,I-1\}\wedge i\
eq i^{\prime}\), \(L_{i,j^{\prime}}\) represents the migration cost between node \(i\) and node \(i^{\prime}\). Suppose \(\mathsf{maxP}\) and \(\mathsf{maxL}\) are used to represent the upper limit of resource unit price and migration cost; then the quality of service (QoS) function of node \(i\) requesting \(i^{\prime}\) migration resource \(j\) is shown as follows:  
\[Q_{i,i}(j)=\frac{1}{\frac{X_{i,j^{\prime}}(i)\times P_{i,j}}{maxP}\times \alpha+\frac{L_{i,j^{\prime}}}{maxL}\times(1-\alpha)} \tag{1}\]  
where \(\alpha\) is a balance factor used to set the importance of price and migration cost according to user needs, where \(X_{i,j}(j)\) represents the number of resource \(j\) migrated from node \(j\) to node \(i\). \(L_{i,j^{\prime}}\) is not fixed. It includes the migration distance between nodes \(i\) and \(i^{\prime}\), historical migration records, etc. After each migration, we can modify the value of \(L_{i,i^{\prime}}\) according to the results of the previous migration. The modification principles can be determined according to the actual situation in specific engineering applications. For example, for the edge computing scenario of intelligent transportation, if the last scheduling effect between two edge nodes is good, \(L_{i,i^{\prime}}\) can be increased; otherwise, it can be reduced. **Definition 1**.