Skip to main content
. 2020 Dec 29;21(1):184. doi: 10.3390/s21010184
Algorithm 4: MTCLM_COLOUR (G, SU).
  • Input:

    graph G, SU

  • Output:

    X,CT.

  • 1:

    X={xij0:iS,jJU};

  • 2:

    CT;

  • 3:

    computer the optimal solution to the LP: x*,y*;

  • 4:

    y^tyt*H/H;

  • 5:

    x^ijxij*H/H;

  • 6:

    build auxiliary graph G¯;

  • 7:

    obtain a legal colouring of G¯ greedily;

  • 8:

    for k[1,H] do

  • 9:

      calculate the number of targets covered by each colour k;

  • 10:

    end for

  • 11:

    obtain colour q with the maximum number of covered targets;

  • 12:

    obtain the edges Eq coloured by q in graph G¯;

  • 13:

    for (i,j)Eq do

  • 14:

      ifj is the duplication nodes of j in graph G then

  • 15:

       set xij=1;

  • 16:

       CT=CTUj;

  • 17:

      end if

  • 18:

    end for

  • 19:

    returnX,CT;