## 3 Proposed Method  
Although [PERSON] et al. [4] developed evolutionary algorithms to solve the task assignment problem, their methods cannot guarantee the global optimality of the obtained solution. This study transforms the nonlinear model of the task assignment problem into a linear model that is solvable by the general linear programming technique to derive a globally optimal solution. The optimal task assignment problem in the cloud-fog computing environment discussed in this study, referring to [PERSON] et al. [4], can be described as follows. Assume \(T_{k}\) be the \(k\)th task, then \(n\) independent tasks in \(T\) are required to be completed in the system and expressed as follows:  
\[T=\{T_{1},T_{2},\ T_{3},\ldots,T_{n}\}. \tag{1}\]  
The cloud-fog computing system includes cloud nodes and fog nodes; the nodes of the same type have similar characteristics, such as CPU processing power, CPU usage cost, memory usage cost, and bandwidth usage cost. Typically, the cloud nodes have higher capabilities in computing and storage than the fog nodes, but running the tasks on the cloud nodes must pay higher costs. Assume that \(m\) nodes consisting of cloud and fog nodes in a set can be expressed as:  
\[\mathbf{N}=\{N_{1},N_{2},\ N_{3},\ldots,N_{m}\}, \tag{2}\]  
where \(N_{i}\) is the \(i\)th processing node. Each task \(T_{k}\) will be assigned to one processing node \(N_{i}\), which is represented as \(T_{k}^{i}\). Each processing node \(N_{i}\) (\(i=1,2,\ 3,\ldots,m\)) can be assigned multiple tasks, expressed as:  
\[\mathbf{N}_{i}^{\text{T}}=\Big{\{}T_{x}^{i},T_{y^{\prime}}^{i},\ \ldots,T_{z}^{i} \Big{\}}. \tag{3}\]  
The task assignment problem considered in this study could be formulated as a node assignment of the tasks in \(T\):  
\[\mathbf{T}^{\text{node}}=\Big{\{}T_{1}^{a},T_{2}^{b},\ T_{3}^{c},\ldots,T_{n}^{p} \Big{\}}. \tag{4}\]  
The execution time for node \(N_{i}\) to complete all assigned tasks in \(\mathbf{N}_{i}^{\text{T}}\) can be expressed as:  
\[E\_Time\ (N_{i})=\ \sum_{T_{i}^{i}\in\mathbf{N}_{i}^{\text{T}}}E\_Time\Big{(}T_{k}^{ i}\Big{)}=\ \frac{\sum_{T_{k}^{i}\in\mathbf{N}_{i}^{\text{T}}}L(T_{k}^{i})}{\text{CPUrate}(N_{i} )}, \tag{5}\]where \(L\big{(}T_{k}^{i}\big{)}\) is the number of instructions of task \(T_{k}^{i}\), and \(CPUrate(N_{i})\) is the CPU clock rate of node \(N_{i}\). \(E\_Time\big{(}T_{k}^{i}\big{)}=\frac{L\big{(}T_{k}^{i}\big{)}}{\text{CPUrate}(N_ {i})}\) is the execution time of \(T_{k}\) assigned in node \(N_{i}\). Assume _Timespan_ is the total time to complete all tasks in \(T\). _Timespan_ can be derived by the following formula:  
\[Timespan=Max_{1\leq i\leq m}E\_Time(N_{i}). \tag{6}\]  
Let \(Cost(T_{k}^{i})\) be a monetary amount that must be paid for executing task \(T_{k}^{i}\) in node \(N_{i}\), consisting of the processing cost \(C_{p}(T_{k}^{i})\), memory usage cost \(C_{m}(T_{k}^{i})\), and bandwidth usage cost \(C_{b}(T_{k}^{i})\). \(Cost(T_{k}^{i})\) can be expressed as:  
\[Cost\Big{(}T_{k}^{i}\Big{)}=\ C_{p}\Big{(}T_{k}^{i}\Big{)}+\ C_{m}\Big{(}T_{k }^{i}\Big{)}+\ C_{b}\Big{(}T_{k}^{i}\Big{)}. \tag{7}\]  
The above three costs can be defined as:  
\[C_{p}\Big{(}T_{k}^{i}\Big{)}=\ cost\_p_{i}\times E\_Time\Big{(}T_{k}^{i} \Big{)}, \tag{8}\]  
\[C_{m}\Big{(}T_{k}^{i}\Big{)}=\ cost\_m_{i}\times Memory\Big{(}T_{k}^{i}\Big{)}, \tag{9}\]  
\[C_{b}\Big{(}T_{k}^{i}\Big{)}=\ cost\_b_{i}\times Bandwidth\Big{(}T_{k}^{i} \Big{)}, \tag{10}\]  
where \(cost\_p_{i}\) is the usage cost of CPU per time unit in node \(N_{i}\), \(cost\_m_{i}\) is the usage cost of memory per data unit in node \(N_{i}\), \(Memory\big{(}T_{k}^{i}\big{)}\) is the memory required by task \(T_{k}\) in node \(N_{i}\), \(cost\_b_{i}\) is the usage cost of bandwidth per data unit, and \(Bandwidth\big{(}T_{k}^{i}\big{)}\) is the amount of bandwidth required by transmitting task \(T_{k}\) to be processed in node \(N_{i}\).