## 4 Bi-Objective Optimization Allocation Problem Model and Algorithm
### Improved NSGA2 Based on Transcription Gene and Heuristic Recombination (INSGA2-TGHR)
#### 4.2.1 Genetic Factors: Transcription Gene  
In traditional genetic algorithms solving workflow assignment problems, all genetic operators are designed as integer arrays of task number length, where each gene made index symbolizes a specific task and gene refers to a specific resource, and matching tasks and resources by random assignment. This has the advantage of simplifying the relationship between tasks, resources, genes and fitness, but the problem is that the number of heterogeneous resources (monitors, edges, clouds) in CEN may not be equal, and then the probability of assigning tasks to different kinds of resources is also not equal. Therefore, the genetic factors are redesigned, and the concept of DNA transcription to generate RNA  
Figure 4: Flow chart of INSGA2-TGHR.  
Figure 3: Trigger mechanism flow chart for INSGA2-TGHR.  
in biology is used here. \"DNA\", a set of random real numbers of task length from 0 to N where N is the type of heterogeneous resources, will be generated first. Then, the \"DNA\" produces \"RNA\" by \"transcription\". For example, a certain edge-cloud network (CEN) is composed of (6, 4, 2) heterogeneous resources, which has 6 local monitors, 4 edge servers, and 2 cloud servers and numbered sequentially from #1 to #12. A random real number \"0.375402761769494\", its integer part \"0\", corresponds to the 1 st group (monitor), its fractional part \"0.375402761769494\" multiplied by the number of resources of the 1 st group \"6\" and then rounded to \"2\", corresponds to the third one, then its determined computing resources correspond to the third local monitors, #3. Similarly, a random real number \"2.501432671965211\" determined computing resource corresponds to the second cloud servers, #12, a random real number \"1.5705781532276744\" determined computing resource corresponds to the third edge servers, #9. the \"RNA\" is similar to traditional chromosome structure and can participate in evolution to produce offspring, as well as translate the allocation of resources and calculate fitness based on the encoding of genetic information. The \"transcription\" process divides the real numbers from 0 to N into an integer part and a decimal part, where the integer part determines the type of heterogeneous resources, and the decimal part determines the number of heterogeneous resources. The specific process is represented by Algorithm 1 and Figure 5, where \"DNA\" is a pre-obtained array, \"Resource\" is a dictionary nested array, the \"Key\" of the dictionary is the resource type and \"Value\" of the dictionary is an array of resource numbers of that type. In addition, the design of the genetic factors implicitly satisfies (3) (4), each subtask is assigned to only one computing resource.  
```
input :DNA, Resource output :RNA
1 init RNA;
2\(i\gets 0\);
3 while\(i\leq len(\text{DNA})\)do
4 Resource\(Type\gets int(\text{DNA}[i])\);
5 Resource\(Index\leftarrow int((\text{DNA}[i]-ResourceType)\times len(\text{Resource}[\text{Resource}Type]))\);
6 RNA\(\leftarrow\)Resource[ResourceType][ResourceIndex];
7\(i\gets i+1\);
8
9 end while
```  
**Algorithm 1**Transcription