Skip to main content
. 2023 Apr 13;25(4):653. doi: 10.3390/e25040653
Algorithm 1 The distribution algorithm
Input:
    H, the threshold n, area Q^l, and area Ql (l=1,2,,n).
Output:
    These n shares: S1,S2,,Sn.
  • 1:

    for x from 1toD do

  • 2:

       for y from 1toD do

  • 3:

         /* H consists of D×D modules.*/

  • 4:

         if H(x,y)areaQ^1orareaQ1 then

  • 5:

            S1(x,y)k.

  • 6:

         else

  • 7:

            S1(x,y)w.

  • 8:

         end if

  • 9:

         if H(x,y)areaQ^2orareaQ2 then

  • 10:

            S2(x,y)k.

  • 11:

         else

  • 12:

            S2(x,y)w.

  • 13:

         end if

  • 14:

         

  • 15:

         if H(x,y)areaQ^norareaQn then

  • 16:

            Sn(x,y)k.

  • 17:

         else

  • 18:

            Sn(x,y)w.

  • 19:

         end if

  • 20:

       end for

  • 21:

    end for

Output: S1,S2,,Sn