## 4 Algorithms
### Generation of Initial Solutions  
To enhance the learning efficiency of GAs, researchers usually use random functions to generate the initial generation to ensure the individuals are evenly spread throughout the feasible region. This is an effective approach because the values under consideration \begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline
**Index** & **Selected** & **Size Field** & **Cane Yield** & **Vegetable** & **Skyline** & **Summation of** & **Top-\(k\) Result** \\
**Numberof** & **Branch** & **Branch** & **Branch** & **Branch Yield** & **Branch** & **Branch** & **Branch** \\ \hline
1 & \(1,2,3\) & 35 & 21 & 17 & v & 73 & v \\
2 & \(1,2\) & 25 & 16 & 14 & & 55 & v \\
3 & \(1,4\) & 16 & 22 & 10 & v & 48 & \\
4 & \(1,3\) & 25 & 17 & 12 & & 54 & v \\
5 & \(1,5\) & 16 & 13 & 19 & v & 48 & \\
6 & \(1\) & 15 & 12 & 9 & & 36 & \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Skyline and top-\(k\) results, for example, in Figure 2.  
Figure 4: Flow chart of the proposed algorithm. are usually independent [61]. However, this approach can produce (1) solutions with discontinuous water supply conditions and (2) solutions with total water usage outside of the range set by the user. The first case is illustrated in Figure 5a, where the 1 and 0 on each branch represent values generated by a random function. We can clearly see that water should be allocated to Branch 5, but water cannot reach Branch 5 from upstream (Branch 1). The second case is illustrated in Figure 5b,c, where we assume that decision-makers allocate 30-50% of the water allocated in previous years. Again, the 1 and 0 on each branch indicate whether water is allocated. In Figure 5b, the values on all of the branches are 1, which means that the total water demand is far greater than the available water amount. In contrast, the values on all of the branches in Figure 5c are 0, so the total water demand is again not within the set range. To solve the problems described above, we designed the following approach to generate initial solutions, where the amount of available water [\(\alpha\), \(\alpha+\sigma\)] is set by the user:  
1. Calculate the total water demand \(\beta\) when all of the considered areas are given water and set the total water cutoff \(\gamma\) of the current irrigated region as 0. 2. Select the area most likely to have its water cut off, area \(e\), and calculate its total water demand downstream, \(\delta\). 3. Calculate the value of \(\beta-\alpha-\gamma-\delta\), which equals \(\eta\), and determine the next step based on \(\eta\), which may fit one of three cases: \(\eta>\sigma\), \(\sigma>\eta>0\), or \(\eta<0\). First, if \(\eta>\sigma\), it means that after the water supply to \(e\) has been cut off, the total water usage of the system will still be greater than the upper limit; in this case, we cut off the water to \(e\), update the total water cutoff from \(\gamma\) to \(\gamma+\delta\), find the next area most likely to have its water cut off, and return to Step 2 to repeat the cutoff action. Next, if \(\sigma>\eta>0\), it means that after the water supply to \(e\) has been cut off, the total water usage of the system falls within the set range; in this case, we cut off the water to \(e\), consider the current result as an initial solution, and end the selection operation. Finally, if \(\eta<0\), it means that after the water supply to \(e\) has been cut off, the total water usage of the system is below the lower limit. Thus, this cannot be one of the solutions. The system then finds the next area most likely to have its water cut off and returns to Step 2 to repeat the cutoff action. Figure 5: Irrigation diagrams explaining the problem of using GAs directly in the proposed problem. (**a**) The water cannot reach Branch 5 from upstream. (**b**) The total water demand is far greater than the available water amount. (**c**) The total water demand is far less than the available water amount.