# Using the Guided Fireworks Algorithm for Local Backlight Dimming
## 3 Local Dimming Based on the Guided Fireworks Algorithm
### Guided Fireworks Algorithm
For a bad location, if the quality of its corresponding guided spark location is better, it will be replaced by the guided spark location. Because some bad locations in the population are replaced by better locations, the quality of the whole population is improved. As shown in Algorithm A3, the firework locations and the general spark locations are first mixed into set \(G\). The locations in \(G\) are then sorted from good to bad, and \(G(i)\) is used to represent the \(i\)th solution in the sorted set. Therefore, \(G(1)\) is the best location in set \(G\), while \(G(v)\) (\(v\) is the number of locations in set \(G\)) is the worst location in set \(G\). If there are \(\widetilde{Q}\) bad locations to be updated, the locations from \(G(v-\widetilde{Q}+1)\) to \(G(v)\) are selected. Supposing \(R^{\prime}_{bad}\) is one of the \(\widetilde{Q}\) bad locations to be updated, the corresponding guided spark location \(R^{\prime}_{guid}\) is generated by the guidance of the best location \(R^{\prime}_{best}\): \[\left[ \begin{array}{c}r^{\prime}_{11}\\ r^{\prime}_{2}\\ \vdots\\ r^{\prime}_{tk}\\ (R^{\prime}_{guid})\end{array} \right]=\left[ \begin{array}{c}r^{\prime}_{b1 }\\ r^{\prime}_{b2}\\ \vdots\\ r^{\prime}_{pk}\\ (R^{\prime}_{best})\end{array} \right]+\left[ \begin{array}{c}rand(0,1)\\ rand(0,1)\\ \vdots\\ rand(0,1)\end{array} \right]\times\left(\left[ \begin{array}{c}r^{\prime}_{s1} \\ r^{\prime}_{s2}\\ \vdots\\ r^{\prime}_{sk}\end{array} \right]-\left[ \begin{array}{c}r^{\prime}_{b1}\\ r^{\prime}_{b2}\\ \vdots\\ r^{\prime}_{tk}\end{array} \right]\right)\] (11) \[\left( \begin{array}{c}R^{\prime}_{best}\\ \end{array} \right)\left( \begin{array}{c}R^{\prime}_{bad}\\ \end{array} \right)\]  
Figure 3: The flow chart of the Guided Fireworks Algorithm (GFWA). If \(R^{\prime}_{guid}\) is better than \(R^{\prime}_{bad}\), \(R^{\prime}_{bad}\) is replaced by \(R^{\prime}_{guid}\). 3. By the guidance of \(R^{\prime}_{best}\), if a bad location can't find a better guided spark location to replace itself, it will be updated by the following strategy. In this strategy, a good location in the population is first selected to generate a new guided spark location, based on the Gaussian function. The bad location is then replaced by the new guided spark location. As shown in Algorithm A3, if \(R^{\prime}_{guid}\) generated by the guidance of \(R^{\prime}_{best}\) is not better than \(R^{\prime}_{bad}\), a new \(R^{\prime}_{guid}\) is generated based on \(R^{\prime}_{good}\) and the Gaussian function, where \(R^{\prime}_{good}\) represents the good locations in set \(G\), if \(R^{\prime}_{bad}=G(v+1-j)\), \(R^{\prime}_{good}=G(j)\). \(R^{\prime}_{bad}\) is then replaced by the new generated guided solution. This strategy is improved from Algorithm A2, the FWA. Compared with Algorithm A2 which may add spark locations with bad quality, the strategy of Algorithm A3, which uses new guided spark locations to replace the bad ones, can better ensure population quality under the condition of keeping the population diversity. In addition, because the new locations are generated based on good locations in the population, they can easily achieve high quality.