Next Article in Journal
Fighting the COVID-19 Infodemic in News Articles and False Publications: The NeoNet Text Classifier, a Supervised Machine Learning Algorithm
Previous Article in Journal
Bending Properties of Lightweight Copper Specimens with Different Infill Patterns Produced by Material Extrusion Additive Manufacturing, Solvent Debinding and Sintering
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

The Color Mix Problem

by
Alfonsas Misevičius
*,
Aleksandras Andrejevas
,
Armantas Ostreika
,
Tomas Blažauskas
and
Liudas Motiejūnas
Department of Multimedia Engineering, Kaunas University of Technology, Studentu st. 50-400, LT-51368 Kaunas, Lithuania
*
Author to whom correspondence should be addressed.
Appl. Sci. 2021, 11(16), 7263; https://doi.org/10.3390/app11167263
Submission received: 13 May 2021 / Revised: 16 July 2021 / Accepted: 30 July 2021 / Published: 6 August 2021
(This article belongs to the Section Computing and Artificial Intelligence)

Abstract

:
In this paper, we introduce a new combinatorial optimization problem entitled the color mix problem (CMP), which is a more general case of the grey pattern quadratic assignment problem (GP-QAP). Also, we propose an original hybrid genetic-iterated tabu search algorithm for heuristically solving the CMP. In addition, we present both analytical solutions and graphical visualizations of the obtained solutions, which clearly demonstrate the excellent performance of the proposed heuristic algorithm.

1. Introduction

The color mix problem (CMP; in this work we consider three colors) can be formulated as a particular case of the well-known problem—the quadratic assignment problem (QAP) [1]. The formulation is as follows. Given two integer quadratic matrices A = ( a i j ) n × n , B = ( b i j ) n × n , and a set Π n of all possible permutations of the integers from 0 to n 1 , find a permutation p Π n that minimizes the following function:
z ( p ) = i = 0 n 1 j = 0 n 1 a i j b p ( i ) p ( j ) ,
where a i j = 1 for i = 0 ,   ,   m 1 1 , j = m 1 ,   m 1 + 1 , ,   m 1 , i = m 1 , m 1 + 1 , ,   m 1 , j = 0 ,   ,   m 1 1 ; a i j = 2 for i , j = 0 ,   ,   m 1 1 ,   m 1 , m 1 + 1 , ,   m 1 , and a i j = 0 otherwise ( 1 m 1 < m , m 1 < m < n ) (see Figure 1). So, the objective can be transformed to finding the permutation elements p ( 0 ) ,   ,   p ( m 1 ) ( 0 p ( i ) n 1 , i = 0, …, m − 1) such that the following simplified function is minimized:
z ( p ) = i = 0 m 1 1 ( 2 j = 0 m 1 1 b p ( i ) p ( j ) + j = m 1 m 1 b p ( i ) p ( j ) ) + i = m 1 m 1 ( j = 0 m 1 1 b p ( i ) p ( j ) + 2 j = m 1 m 1 b p ( i ) p ( j ) ) .
The items in the matrix B are symmetric distances between every pair of n elements. The distances are calculated by adopting the definition as in [2]:
b k l = b r n 2 + s , t n 2 + u = ω r s t u ,   ω r s t u = max w 1 , w 2 { 1 , 0 , 1 } { 1 ( r t + w 1 n 1 ) 2 + ( s u + w 2 n 2 ) 2 } ,
where k , l = 0 , ,   n 1 , r , t = 0 , , n 1 1   , s , u = 0 , ,   n 2 1 , n = n 1 × n 2 (in our case, n 1 = n 2 ).
In other words, we have a grid (rectangle) of dimensions n 1 × n 2 (for simplicity, n 1 = n 2 ). More precisely, we have n = n 1 × n 2 squares (dots, points) of identical size. For convenience, it may be recommended that n be equal to 2 raised to a power λ , i.e., 2 λ (for example, 2 6 , 2 8 , and so on). The squares are evenly positioned in n 1 horizontal lines and n 2 vertical columns. There are m 1 squares of color c o l o r 1 (say, red). Also, there are m 2 = m m 1 squares of color c o l o r 2 (for example, green) and also m 3 = n m = n m 1 m 2 squares of color c o l o r 3 (say, blue). This forms a color mix pattern, i.e., a mixture (composition) of three colors (red, green, blue), which can be characterised by the parameters m 1 n , m 2 n , m 3 n . Then, the aim is to obtain a configuration of all the points, i.e., a color pattern, where the colors (color squares) are distributed in the most uniform possible way. In other words, we are seeking to get fine, well-balanced color combinations; that is, we wish to obtain the most uniform possible pattern for each color (see Figure 2). It should be noted that the color mix problem is a more complex case of the grey pattern problem (GPP) [2], where one has n points in the rectangle and there are m black points, while the remaining points are white. The goal is to have a grey pattern where the black points are scattered as regularly as possible on the rectangle.
The values of the elements of the analytical solution, i.e., permutation p are related to the corresponding coordinates ( r ,   s ) of the sites (locations) on the grid through the following formulas: r = p ( i ) n 2 , s = p ( i )   mod   n 2 , i = 0 ,   ,   n 1 . Note that the first m 1 elements in the permutation determine the sites on the grid where the red squares are placed in. The next m 2 elements define the positions of the green squares, and so on.
The CMP, thus, is a theoretical optimization problem of combinatorial character. However, we believe that the CMP can potentially have some important areas of practical applications, for example, color halftoning, fine digital textures, modern computer graphics/multimedia, computer visual arts [3,4,5,6,7]. Yet another application example would be the selection of groups of persons out of n available persons. In this case, the “distance” between persons would be, for example, a measure of the capability to cooperate and the ideal groups would have the least risk for conflict and the most potential for harmony.
For the solution of the color mix problem, (meta)heuristic optimization algorithms can be applied. Although heuristics do not guarantee the optimality of the found solutions, they enable us to obtain sufficiently high-quality solutions within an affordable computation time [8].
There are several heuristic algorithms—which although have not been examined on our considered problem yet—but still are thought to be potentially applicable to the CMP. As an example, single solution-based local search and simulated annealing algorithms were examined in [9] for solving the grey pattern problem [2], which is the “sibling” of the CMP. Modern tabu search methodology-based algorithms were considered in [9,10]. Population-based-evolutionary and swarm intelligence algorithms constitute another class of powerful (meta)heuristic algorithms [2,9,11]. The main feature of this kind of algorithms is that these algorithms deal with the sets of solutions, and this property seems to be of crucial importance [12]. More to this, the population-based algorithms are easy to hybridize with the single solution-based algorithms—which is a natural way to further enhance the efficiency of the population-based algorithms [13,14].
That said, the main contribution of this article is that a new combinatorial optimization problem—the color mix problem—is introduced and computationally studied. For the solution of this problem, a hybrid genetic-hierarchical iterated tabu search (HITS) algorithm is proposed. The basis of the HITS algorithm is, in turn, the multiple reuse of the (iterated) tabu search; it also encompasses a specific greedy adaptive search procedure combined with a random mutation process. (In ref. [14], it is clearly stated that “currently there is no known polynomial-time algorithm to exactly solve the grey pattern problem”. And we conjecture that this should be even more true for our considered color mix problem. So, the only rational option for obtaining high quality solutions in a reasonable amount of time is to employ heuristic algorithms. In [14], the state-of-the-art hybrid genetic-HITS algorithm was proposed for the GPP, which performed extremely well. Therefore, we have naturally chosen this sort of algorithm for the CMP. The obtained results from the computational experiments confirm the high performance of the proposed algorithm for the CMP.)
The remainder of this paper is organized as follows: In Section 2, some preliminaries (basic definitions) are given. The detailed description of the genetic-hierarchical iterated tabu search algorithm and its parts is presented in Section 3. Then, in Section 4, the results of the computational experiments are provided. The paper is completed with some concluding comments.

2. Preliminaries

Suppose that p ( v ) ( v = 0 ,   ,   n 1 ) and p ( w ) ( w = 0 ,   ,   n 1 , v w ) are two elements in the permutation p . Then p v , w is defined in the following way:
p v , w ( i ) = { p ( i ) , i v , w p ( v ) , i = w p ( w ) , i = v ;   i = 0 ,   ,   n 1 .
A neighbourhood function Θ : Π n 2 Π n assigns for each p Π n a set of neighbouring solutions Θ ( p ) Π n . In particular, the 1-exchange neighbourhood function Θ 1 is defined as follows:
Θ 1 ( p ) = { p : p Π n , ( δ 1 ( p , p ) = 1     δ 2 ( p , p ) = 1 )     δ 3 ( p , p ) 1 } ,
where p Π n and δ 1 ( p ,   p ) , δ 2 ( p ,   p ) , δ 3 ( p ,   p ) denote the corresponding distance measures between the solutions p and p . The distances δ 1 , δ 2 , δ 3 between two solutions p and p can be defined according to the following formulas:
δ 1 ( p , p ) = m 1 | { p ( i ) : i = 0 , , m 1 1 } { p ( i ) : i = 0 , , m 1 1 } | ,
δ 2 ( p , p ) = m 2 | { p ( i ) : i = m 1 , , m 1 } { p ( i ) : i = m 1 , , m 1 } | ,
δ 3 ( p , p ) = m | { p ( i ) : i = 0 , , m 1 } { p ( i ) : i = 0 , , m 1 } | ,
where m 2 = m m 1 .
The solution p v , w can simply be obtained from the existing solution p by accomplishing the pairwise interchange move ϕ ( p , v , w ) : Π n × N × N Π n , which swaps the v th and w th elements in the given solution. Thus, p v , w = ϕ ( p , v , w ) .
For the neighbouring solutions p and p v , w , the difference in the values of the objective function is calculated in O ( 1 ) time by using the following formula:
Δ z ( p v , w , p ) = z ( p v , w ) z ( p ) = { 2 ( c 1 ( p ( w ) ) c 1 ( p ( v ) ) 2 b p ( v ) p ( w ) ) ,   v { 0 , , m 1 1 } , w { m , , n 1 } 2 ( c 2 ( p ( w ) ) c 2 ( p ( v ) ) 2 b p ( v ) p ( w ) ) ,   v { m 1 , , m 1 } , w { m , , n 1 } 2 ( c 3 ( p ( w ) ) c 3 ( p ( v ) ) 2 b p ( v ) p ( w ) ) , v { 0 , , m 1 1 } , w { m 1 , , m 1 } ,
where c 1 ( x ) , c 2 ( x ) , c 3 ( x ) are contributions of the element x (the sum of related distances):
c 1 ( x ) = 2 y = 0 m 1 1 b x , p ( y ) + y = m 1 m 1 b x , p ( y ) , x = 0 , n 1 ,
c 2 ( x ) = y = 0 m 1 1 b x , p ( y ) + 2 y = m 1 m 1 b x , p ( y ) , x = 0 , ,   n 1 ,
c 3 ( x ) = y = 0 m 1 1 b x , p ( y ) y = m 1 m 1 b x , p ( y ) , x = 0 , , n 1 .
Note that, after the exchange of the permutation elements p ( v ) and p ( w ) , the contributions must be updated according to these equations:
c 1 ( x ) = { c 1 ( x ) + 2 ( b x , p ( v ) b x , p ( w ) ) , v { 0 , , m 1 1 } , w { m , , n 1 } c 1 ( x ) + ( b x , p ( v ) b x , p ( w ) ) ,   v { m 1 , , m 1 } , w { m , , n 1 } c 1 ( x ) + ( b x , p ( v ) b x , p ( w ) ) ,   v { 0 , , m 1 1 } , w { m 1 , , m 1 } , x = 0 , ,   n 1 ,
c 2 ( x ) = { c 2 ( x ) + ( b x , p ( v ) b x , p ( w ) ) ,   v { 0 , , m 1 1 } , w { m , , n 1 } c 2 ( x ) + 2 ( b x , p ( v ) b x , p ( w ) ) , v { m 1 , , m 1 } , w { m , , n 1 } c 2 ( x ) ( b x , p ( v ) b x , p ( w ) ) ,   v { 0 , , m 1 1 } , w { m 1 , , m 1 } , x = 0 , ,   n 1 ,
c 3 ( x ) = { c 3 ( x ) + ( b x , p ( v ) b x , p ( w ) ) ,   v { 0 , , m 1 1 } , w { m , , n 1 } c 3 ( x ) ( b x , p ( v ) b x , p ( w ) ) ,   v { m 1 , , m 1 } , w { m , , n 1 } c 3 ( x ) + 2 ( b x , p ( v ) b x , p ( w ) ) , v { 0 , , m 1 1 } , w { m 1 , , m 1 } , x = 0 , ,   n 1 .
Using the above Equations (9)–(15), the computational complexity of complete evaluation of the neighbourhood Θ 1 is proportional to O ( m n + m 1 m 2 ) , where m 2 = m m 1 .

3. Hybrid Genetic Algorithm for the Solution of the Color Mix Problem

The principle of the used algorithm is similar to that of the hybrid genetic algorithm [15] (for more complete information on the functioning of genetic algorithms, the reader is referred to [16]), where global explorative/diversified search of the genetic operators is in teamwork with the local exploitative/intensified search. The exploitative search, in particular, is performed by the iterated hierarchical tabu search procedure (see Section 3.4.1).
In our algorithm, the permutation elements p ( 0 ) ,   p ( 1 ) ,   ,   p ( n 1 ) are simply linked to the genes of individuals’ chromosomes. No encoding is required. Meanwhile, the objective function value of the given solution, z ( p ) , is associated with the fitness of individuals.
The basic components of our hybrid genetic algorithm are as follows: (1) construction of initial population; (2) parent selection for crossover procedure; (3) crossover procedure; (4) improvement of the offspring by the HITS algorithm; (5) population replacement. The top-level pseudocode of the genetic algorithm is provided in Algorithm 1.
Algorithm 1  Hybrid _ Genetic _ Algorithm
// top-level pseudocode of the hybrid genetic algorithm
// input: B , n , m , m 1
// output: P
// parameters: G , P S , D T , i d l e _ g e n _ l i m i t
begin
  P I n i t i a l _ P o p u l a t i o n _ C o n s t r u c t i o n ( P S ) ; i 0 ; i 0 ;
 do
   p , p S e l e c t i o n ( P ) ;
   p ° , c 1 , c 2 , c 3 G r e e d y _ C r o s s o v e r ( B , n , m , m 1 , p , p ) ;
   p k , z k k _ L e v e l _ H i e r a r c h i c a l _ I t e r a t e d _ T a b u _ S e a r c h ( B , n , m , m 1 , p ° , z ( p ° ) , c 1 , c 2 , c 3 ) ;
   j 0 ; i n c l u d e _ s o l u t i o n TRUE ;
   do
    if ( ( D i s t a n c e ( P ( j ) , p k ) < D T   z k = z ( P ( j ) ) )     z k z ( P ( 0 ) ) ) i n c l u d e _ s o l u t i o n FALSE
    endif;
    j j + 1
   while ( j P S );
   if ( i n c l u d e _ s o l u t i o n )
    if ( z ( P ( 0 ) ) > z k ) P ( 0 ) p k ;
    elseif ( z ( P ( P S 1 ) ) > z k )
      P ( U p p e r _ I n d e x ( P   ) )   p k
    endif;
     i i ;
   elseif ( i i > i d l e _ g e n _ l i m i t     i < G i d l e _ g e n _ l i m i t )
     P P o p u l a t i o n _ R e s t a r t ( P S ) ; i i
   endif;
    i i + 1
  while ( i G )
end.
Notes. 1. G , P S denote the total number of generations and the population size, respectively. 2. The distance ( Distance ) is calculated using the Equations (6) and (7). 3. D T denotes the distance threshold between solutions. 4. i d l e _ g e n _ l i m i t denotes the limit of idle generations (we used i d l e _ g e n _ l i m i t = max { 3 ,   0.05 G } ). 5. The mutation process is embedded into the k-level hierarchical iterated tabu search algorithm. 6. The population restart ( Population _ Restart ) is performed by applying the “clone” of the initial population construction procedure.

3.1. Construction of Initial Population

There are two stages of the construction of initial population. In the first one, the pre-initial (primordial) population is generated and improved; in the second one, the truncation (culling) of the obtained population is performed. Firstly, P S = P S × C 1 members of the pre-initial population P are randomly generated, where P S denotes the population size, and C 1 ( C 1 1 ) is the predefined parameter to control the size of the pre-initial population.
Every generated solution is subject to improvement by the HITS algorithm. There is a special condition. If the improved solution ( p ) is better than the best-found solution, then the improved solution substitutes the best-found solution. Otherwise, it is checked if the minimum distance ( min p P { δ 1 ( p ,   p ) + δ 2 ( p ,   p ) } ) between the solution p and the present population solutions is greater than the predetermined distance threshold, D T . If this is the case, then the new solution enters the population. Otherwise, the new solution is ignored and a random solution is included instead. The distance threshold is related to the value of m through the following equation: D T = max { 2 ,   ε m } , where ε is the distance threshold coefficient ( 0 < ε 1 ). In the second stage, ( C 1 1 ) P S worst members of the primordial population are deleted and just P S members survive for the future generations.

3.2. Parent Selection

In our algorithm, the parents are selected using a random selection rule.

3.3. Crossover Procedure

One of the main purposes of crossover is to diversify the search process by recombining the genetic information present in the parental chromosomes. In our hybrid genetic algorithm, the crossover operator takes place at each generation of GA, that is, the crossover probability is equal to exactly 1 . Note that the straightforward application of the standard bit-string-based crossovers to the color mix problem may not be necessary effective, because the factual chromosomal locations of genes are irrelevant in the CMP. Still, it is rational to preserve the common genes of parents in the recombination process. Meanwhile, the other genes are formed by adopting the heuristic greedy-based approach by choosing the genes from the parents. More precisely, the genes are chosen from either the first or the second parent such that the currently selected gene contributes least to the value of the objective function. The pseudocode of the greedy crossover procedure is given in Algorithm 2. More details on this procedure can be found in [13].
It can be seen that the computational time complexity of the greedy crossover operator is proportional to O ( m n + ( m 1 ) 2 + ( m 2 ) 2 ) .
Algorithm 2  Greedy _ Crossover
// pseudocode of the greedy crossover procedure
// input: B , n , m , m 1 , p , p
// output: p ° , c 1 , c 2 , c 3
begin
  p ° { p ( i ) | i = 0 ,   ,   m 1 1 } { p ( i ) | i = 0 , ,   m 1 1 } ; c o m m o n _ e l e m e n t s | p ° | ;
  i 0 ;
 do
   j 0 ; s u m 0 ; while ( j c o m m o n _ e l e m e n t s ) s u m s u m + b i , p ( j ) ; j j + 1  endwhile;
   c 1 ( i ) 2 × s u m ; c 2 ( i ) s u m ; c 3 ( i ) s u m ; i i + 1
 while ( i n );
 while ( c o m m o n _ e l e m e n t s m 1 )
   # _ o f _ p o i n t s m 1 ;
p , c o m m o n _ e l e m e n t s , c 1 , c 2 , c 3                                                                                     G r e e d y _ O f f s p r i n g _ C r e a t i o n ( B , n , m , m 1 , p , c 1 , c o m m o n _ e l e m e n t s , # _ o f _ p o i n t s ) ;
p , c o m m o n _ e l e m e n t s , c 1 , c 2 , c 3
                                                                                              G r e e d y _ O f f s p r i n g _ C r e a t i o n ( B , n , m , m 1 , p , c 1 , c o m m o n _ e l e m e n t s , # _ o f _ p o i n t s )
 endwhile;
  p ° p ° ( { p ( i ) | i = m 1 , ,   m 1 } { p ( i ) | i = m 1 , ,   m 1 } ) ; c o m m o n _ e l e m e n t s | p ° | ;
  i 0 ;
 do
   j m 1 ; s u m 0 ; while ( j c o m m o n _ e l e m e n t s ) s u m s u m + b i , p ( j ) ; j j + 1  endwhile;
   c 1 ( i ) c 1 ( i ) + s u m ; c 2 ( i ) c 2 ( i ) + 2 × s u m ; c 3 ( i ) c 3 ( i ) s u m ; i i + 1
 while ( i n );
 while ( c o m m o n _ e l e m e n t s m )
   # _ o f _ p o i n t s m ;
p , c o m m o n _ e l e m e n t s , c 1 , c 2 , c 3                                                                                     G r e e d y _ O f f s p r i n g _ C r e a t i o n ( B , n , m , m 1 , p , c 2 , c o m m o n _ e l e m e n t s , # _ o f _ p o i n t s ) ;
p , c o m m o n _ e l e m e n t s , c 1 , c 2 , c 3
                                                                                    G r e e d y _ O f f s p r i n g _ C r e a t i o n ( B , n , m , m 1 , p , c 2 , c o m m o n _ e l e m e n t s , # _ o f _ p o i n t s )
 endwhile;
  p ° F i l l i n g _ R e m a i n i n g _ E l e m e n t s ( p ° , p , p )
end.
Notes. 1. The pseudocode of the offspring creation procedure ( G r e e d y _ O f f s p r i n g _ C r e a t i o n ) is presented in Algorithm 3. 2. The (unoccupied) positions p ( m ) , p ( m + 1 ) , …, p ( n 1 ) are filled in with the remaining unselected elements using the procedure F i l l _ R e m a i n i n g _ E l e m e n t s .
Algorithm 3  Greedy _ Offspring _ Creation
// pseudocode of the greedy offspring creation sub-procedure
// input: B , n , m , m 1 , p , t h i s _ c , c o m m o n _ e l e m e n t s , # _ o f _ p o i n t s , c 1 , c 2 , c 3
// output: p , c o m m o n _ e l e m e n t s , c 1 , c 2 , c 3
begin
 if ( c o m m o n _ e l e m e n t s # _ o f _ p o i n t s )
   m i n i m u m _ c o n t r i b u t i o n ; j 0 ;
  do
   if (element p ( j ) is not yet selected)
    if ( t h i s _ c ( p ( j ) ) < m i n i m u m _ c o n t r i b u t i o n ) m i n i m u m _ c o n t r i b u t i o n t h i s _ c ( p ( j ) ) ; k j  endif;
    j j + 1
  while ( j # _ o f _ p o i n t s );
  if ( m i n i m u m _ c o n t r i b u t i o n )
   if ( # _ o f _ p o i n t s = m 1 )
     i 0 ;
    do
      c 1 ( i ) c 1 ( i ) + 2 × b i , p ( k ) ; c 2 ( i ) c 2 ( i ) + b i , p ( k ) ; c 3 ( i ) c 3 ( i ) + b i , p ( k ) ; i i + 1
    while ( i n );
   elseif ( # _ o f _ p o i n t s = m )
     i 0 ;
    do
      c 1 ( i ) c 1 ( i ) + b i , p ( k ) ; c 2 ( i ) c 2 ( i ) + 2 × b i , p ( k ) ; c 3 ( i ) c 3 ( i ) b i , p ( k ) ; i i + 1
    while ( i n );
   endif;
    p ( c o m m o n _ e l e m e n t s ) p ( k ) ; c o m m o n _ e l e m e n t s c o m m o n _ e l e m e n t s + 1
  endif
 endif
end.

3.4. Offspring Improvement

3.4.1. Hierarchical Iterated Tabu Search Algorithm

Every produced offspring is subject to improvement by the hierarchical iterated tabu search procedure which can also be seen as a multi-level tabu search [17] procedure, where the basic idea is the cyclic (multiple) reuse of the tabu search algorithm. The k -level hierarchical iterated tabu search algorithm is consisting of three main ingredients: (1) call of the k 1 -level hierarchical iterated tabu search procedure; (2) selection (acceptance) of the solution for perturbation, i.e., mutation; (3) perturbation of the selected solution.
The perturbed solution serves as an input for the autonomous (self-contained) TS procedure. The TS algorithm gives back an optimized solution, and so on. The solution acceptance rule is very simple: we always accept the recently found improved solution.
The overall iterative process is continued until a given total number of iterations have been accomplished (see Algorithm 4). The time complexity of HITS is proportional to O ( m n + m 1 m 2 ) , although the proportionality coefficient may be quite large.
We recall that we have used the 2 -level hierarchical tabu search algorithm ( k = 2 ).
Algorithm 4  k _ Level _ Hierarchical _ Iterated _ Tabu _ Search
// pseudocode of the k -level hierarchical iterated tabu search algorithm
// input: B , n , m , m 1 , p , z , c 1 , c 2 , c 3
// output: p k , z k
// parameters: Q k
begin
  p k p ; z k z ;   c 1 k c 1 ; c 2 k c 2 ; c 3 k c 3 ; q k 0 ;
 do
p k 1 , z k 1 , c 1 k 1 , c 2 k 1 , c 3 k 1                     k 1 _ L e v e l _ H i e r a r c h i c a l _ I t e r a t e d _ T a b u _ S e a r c h ( B , n , m , m 1 , p k , z k , c 1 k , c 2 k , c 3 k ) ;
   if ( z k > z k 1 ) p k p k 1 ; z k z k 1 ;   c 1 k c 1 k 1 ; c 2 k c 2 k 1 ; c 3 k c 3 k 1  endif;
    q k q k + 1 ;
   if ( q k Q k ) // perturbation of the solution p k
     p k M u t a t i o n _ P r o c e d u r e ( p k ) ;
p k , c 1 k , c 2 k , c 3 k G r e e d y _ A d a p t i v e _ S e a r c h _ P r o c e d u r e ( B , n , m , m 1 , p k , c 1 k , c 2 k , c 3 k )
   endif
  while ( q k Q k )
end.
Note. The (zero-level) 0 -level HITS procedure is correspondent to the iterated tabu search (ITS) procedure (see Algorithm 5).
Algorithm 5  Iterated _ Tabu _ Search
// pseudocode of the iterated tabu search algorithm
// input: B , n , m , m 1 , p , z , c 1 , c 2 , c 3
// output: p 0 , z 0 , c 1 0 , c 2 0 , c 3 0
// parameters: Q 0
begin
  p 0 p ; z 0 z ;   c 1 0 c 1 ; c 2 0 c 2 ; c 3 0 c 3 ; q 0 0 ;
 do
   p , z , c 1 , c 2 , c 3 T a b u _ S e a r c h ( B , n , m , m 1 , p 0 , z 0 , c 1 0 , c 2 0 , c 3 0 ) ;
  if ( z 0 > z ) p 0 p ; z 0 z ;   c 1 0 c 1 ; c 2 0 c 2 ; c 3 0 c 3  endif;
   q 0 q 0 + 1 ;
  if ( q 0 Q 0 ) // perturbation of the solution p 0
    p 0 M u t a t i o n _ P r o c e d u r e ( p 0 ) ;
p 0 , c 1 0 , c 2 0 , c 3 0 G r e e d y _ A d a p t i v e _ S e a r c h _ P r o c e d u r e ( B , n , m , m 1 , p 0 , c 1 0 , c 2 0 , c 3 0 )
  endif
 while ( q 0 Q 0 )
 end.

3.4.2. Tabu Search Algorithm

The 0-level HITS algorithm (the ITS algorithm) uses a self-contained (“kernel”) tabu search (TS) procedure (a more detailed discussion of the principles of TS algorithms can be found in [18]).
It is this procedure that is wholly responsible for the improvement of a given solution. At the same time, this procedure is in the role of the intensification of the search process, while the perturbation process rather serves as the search diversification mechanism. Briefly speaking, the TS procedure analyses the neighbourhood of the incumbent solution and accepts the non-tabu (non-prohibited) move that most improves the objective function. In order to avoid cycling search trajectories, the return to recently visited solutions is forbidden for some time period. The tabu list (list of prohibitions), T , is operationalized as a matrix of size n × n . In this case, the entry t i j memorizes the sum of the current iteration number and the tabu tenure, h . The value of h depends on the problem size, n (we have chosen h = 0.5 n ).
It should be noted that the tabu status is disregarded at accident moments with a very small probability α ( α < 0.1 ). This strategy enables to increase the number of non-prohibited solutions and not to confine the search directions too much. The tabu status is also ignored if an aspiration criterion is satisfied, i.e., the currently attained solution appears better than the best obtained solution.
Moreover, our TS algorithm utilizes an additional memory known as a secondary memory, S M . The goal of this memory is to archive high-quality solutions, which although are evaluated as quite good, but are not elected. Thus, if the best solution stays unchanged for more than i d l e _ i t e r _ l i m i t = γ τ iterations, then the tabu list is wiped out and the search is reset to the one of the “second” solutions in S M (here, τ denotes the number of iterations of the TS algorithm, and γ is a futile (idle) iterations limit factor in such a way that 1 γ τ τ ).
The overall TS process is finished as soon as the maximum number of TS iterations, τ , have been executed. The pseudo-code of the tabu search algorithm is shown in Algorithm 6. After finishing the tabu search procedure, the obtained solution is subjected to perturbation, which is described in the next section.
Algorithm 6  Tabu _ Search
// pseudocode of the tabu search algorithm
// input: B , n , m , m 1 , p , z , c 1 , c 2 , c 3
// output: p , z , c 1 , c 2 , c 3
// parameters: τ , h , α , β , i d l e _ i t e r _ l i m i t
begin
 clear tabu list T a b u L i s t ; clear hash table H a s h T a b l e ;
  p p ; z z ; c 1 c 1 ; c 2 c 2 ; c 3 c 3 ; q 0 ; q 0 ; S M _ S i z e 0 ;
 do
   Δ m i n ; Δ m i n ;
   Δ m i n , Δ m i n , v , v , w , w , f l a g , f l a g N e i g h b o u r h o o d _ S e a r c h ( 0 , m 1 , m , n , q , p , z , z , c 1 , 1 ) ;
   Δ m i n , Δ m i n , v , v , w , w , f l a g , f l a g N e i g h b o u r h o o d _ S e a r c h ( m 1 , m , m , n , q , p , z , z , c 2 , 2 ) ;
   Δ m i n , Δ m i n , v , v , w , w , f l a g , f l a g N e i g h b o u r h o o d _ S e a r c h ( 0 , m 1 , m 1 , m , q , p , z , z , c 3 , 3 ) ;
  if ( Δ m i n ) S M ( S M _ S i z e ) p , z + Δ m i n , c 1 , c 2 , c 3 , v , w , f l a g ; S M _ S i z e S M _ S i z e + 1  endif;
  if ( Δ m i n )
    p ϕ ( p , v , w ) ; recalculate c 1 , c 2 , c 3 depending on v , w , f l a g ;
    T a b u L i s t ( p ( v ) , p ( w ) ) q + h ; T a b u L i s t ( p ( w ) , p ( v ) ) q + h ;
    z z + Δ m i n ; H a s h T a b l e ( z ) FALSE ;
   if ( z > z ) p p ; z z ; c 1 c 1 ; c 2 c 2 ; c 3 c 3 ; q q  endif
  endif;
  if ( q q > i d l e _ i t e r _ l i m i t     q < τ i d l e _ i t e r _ l i m i t )
   clear tabu list T a b u L i s t ;
    p , z , c 1 , c 2 , c 3 , v , w , f l a g S M ( R a n d o m ( β × S M _ S i z e , S M _ S i z e ) ) ;
    p ϕ ( p , v , w ) ; recalculate c 1 , c 2 , c 3 depending on v , w , f l a g ;
    T a b u L i s t ( p ( v ) , p ( w ) ) q + h ; T a b u L i s t ( p ( w ) , p ( v ) ) q + h ;
    H a s h T a b l e ( z ) FALSE ;
    q q
  endif;
   q q + 1
 while ( q τ )
end.
Notes. 1. τ denotes the total number of iterations. 2. h denotes the tabu tenure (prohibition period). 3. i d l e _ i t e r _ l i m i t denotes the limit of idle search iterations (we used i d l e _ i t e r _ l i m i t = max { 3 , 0.2 τ } ). 4. S M denotes the secondary memory for archiving “second” solutions, i.e., solutions that are left second after the evaluation of the neighbourhood Θ 1 ; S M _ S i z e denotes the size of the secondary memory. 5. α denotes a randomization coefficient (we used α = 0.02 ), and β is a random access parameter (we used = 0.8 ). 6. The pseudocode of the neighbourhood search procedure ( N e i g h b o u r h o o d _ S e a r c h ) is presented in Algorithm 7. 7. The function R a n d o m ( x 1 ,   x 2 ) returns a random number in the interval [ x 1 ,   x 2 ) .
Algorithm 7  Neighbourhood _ Search
// pseudocode of the neighbourhood search sub-procedure
// input: n e i g h b o u r h o o d _ i n d e x 1 , n e i g h b o u r h o o d _ i n d e x 2
//    n e i g h b o u r h o o d _ i n d e x 3 , n e i g h b o u r h o o d _ i n d e x 4
//    T a b u L i s t , H a s h T a b l e , q , p , z , z , c , f l a g ( f l a g = 1 | 2 | 3 )
// output: Δ m i n , Δ m i n , v , v , w , w , f l a g , f l a g
// parameters: α
begin
  f l a g empty ; i n e i g h b o u r h o o d _ i n d e x 1 ;
 do
   j n e i g h b o u r h o o d _ i n d e x 3 ;
   do
     Δ 2 × ( c ( p ( j ) ) c ( p ( i ) ) + 2 × b p ( i ) , p ( j ) ) ;
    if ( ( Δ < Δ m i n     H a s h T a b l e ( z + Δ )     ( T a b u L i s t ( p ( i ) , p ( j ) ) < q     R a n d o m (   ) < α ) )     z + Δ < z )
     if ( Δ < Δ m i n )
       Δ m i n Δ m i n ; v v ; w w ; f l a g f l a g ; Δ m i n Δ ; v i ; w j ; f l a g f l a g ;
     elseif ( Δ < Δ m i n )
       Δ m i n Δ ; v i ; w j ; f l a g f l a g
     endif
    endif
     j j + 1
    while ( j n e i g h b o u r h o o d _ i n d e x 4 )
     i i + 1
  while ( i n e i g h b o u r h o o d _ i n d e x 2 )
end.
Note. The function R a n d o m (   ) returns a random number in the interval [ 0 ,   1 ) .

3.4.3. Perturbation Process

The perturbation procedure contains only two steps: (1) mutation (random shuffling) and (2) re-construction (recreation) of mutated solution.
Let p ~ be the candidate solution to the mutation process. Then, after shuffling the elements p ~ ( 0 ) , …, p ~ ( m 1 1 ) , p ~ ( m 1 ) , …, p ~ ( m 1 ) , the elements p ~ ( m 1 r 1 ) , …, p ~ ( m 1 1 ) , p ~ ( m r 2 ) , …, p ~ ( m 1 ) are abandoned (no action is required). In our algorithm, r 1 = max { 1 ,   ξ m 1 } , r 2 = max { 1 ,   ξ m 2 } . The parameter ξ ( 0 < ξ 1 ) is called a mutation rate coefficient. The pseudocode of the mutation procedure is given in Algorithm 8.
Algorithm 8  Mutation _ Procedure
// pseudocode of the mutation procedure
// input: m , m 1 , p
// output: p ~
begin
  p ~ p ;
  i 0 ; while ( i m 1 1 ) p ~ ϕ ( p ~ , i , R a n d o m ( i , m 1 ) ) ; i i + 1  endwhile;
  i m 1 ; while ( i m 1 ) p ~ ϕ ( p ~ , i , R a n d o m ( i , m ) ) ;
  i i + 1  endwhile
end.
The re-construction is performed by a so-called greedy adaptive search procedure (GASP) (see Algorithm 9). It is deterministic and also adaptive since it respects the selected solution elements. At every step of the first phase of procedure, s t e p ( s t e p = 0 ,   ,   r 1 1 ), an element ( j m i n { p ( m 1 r 1 + s t e p ) ,   ,   p ( m 1 1 ) } { p ( m r 2 ) ,   ,   p ( n 1 ) } ) is picked up, one at a time, so that the sum i = 0 m 1 r 1 + s t e p 1 c 1 ( p ( i ) ) + c 1 ( j m i n ) is minimized (see Algorithm 10). After adding the element, the contributions are recomputed accordingly. The second phase is executed in a similar fashion (see Algorithm 10). All the calculations take approximately O ( ξ m n ) time. This results in a quite fast execution of GASP when the value of ξ is not large.
Algorithm 9  Greedy _ Adaptive _ Search _ Procedure
// pseudocode of the greedy adaptive search procedure
// input: B , n , m , m 1 , p , c 1 , c 2 , c 3
// output: p , c 1 , c 2 , c 3
// parameters: ξ
begin
  i 0 ; r 1 = max { 1 ,   ξ m 1 } ; r 2 = max { 1 ,   ξ m 2 } ;
 do
   j m 1 l 1 ; s u m 1 0 ; while ( j m 1 ) s u m 1 s u m 1 + b i , p ( j ) ; j j + 1  endwhile;
   j m l 2 ; s u m 2 0 ; while ( j m ) s u m 2 s u m 2 + b i , p ( j ) ; j j + 1  endwhile;
    c 1 ( i ) c 1 ( i ) 2 × s u m 1 s u m 2 ; c 2 ( i ) c 2 ( i ) s u m 1 2 × s u m 2 ; c 3 ( i ) c 3 ( i ) s u m 1 + s u m 2 ;
    i i + 1
  while ( i n );
   z 0 ; i 0 ; while ( i m 1 r 1 ) z z + c 1 ( p ( i ) ) ; i i + 1  endwhile;
   i m 1 ; while ( i m r 2 ) z z + c 2 ( p ( i ) ) ; i i + 1  endwhile;
   i m 1 r 1 ;
  while ( i m 1 )
    p , z , c 1 , c 2 , c 3 G r e e d y _ S o l u t i o n _ C o n s t r u c t i o n ( B , n , m , m 1 , i , c 1 ) ; i i + 1
  endwhile;
   i m r 2 ;
  while ( i m )
    p , z , c 1 , c 2 , c 3 G r e e d y _ S o l u t i o n _ C o n s t r u c t i o n ( B , n , m , m 1 , i , c 2 ) ; i i + 1
  endwhile;
   p F i l l i n g _ R e m a i n i n g _ E l e m e n t s ( p )
end.
Algorithm 10  Greedy _ Solution _ Construction
// pseudocode of the greedy solution construction sub-procedure
// input: B , n , m , m 1 , i , t h i s _ c , c 1 , c 2 , c 3
// output: p , z , c 1 , c 2 , c 3
begin
  m i n i m u m _ c o n t r i b u t i o n ; j 0 ;
 do
  if (element j is not yet selected)
   if ( t h i s _ c ( j ) < m i n i m u m _ c o n t r i b u t i o n ) m i n i m u m _ c o n t r i b u t i o n t h i s _ c ( j ) ; j m i n j  endif;
   j j + 1
 while ( j n );
  p ( i ) j m i n ;
 if ( t h i s _ c = c 1 )
   j 0 ;
  do
     c 1 ( j ) c 1 ( j ) + 2 × b i , j m i n ; c 2 ( j ) c 2 ( j ) + b i , j m i n ; c 3 ( j ) c 3 ( j ) + b i , j m i n ; j j + 1
   while ( j n );
  elseif ( t h i s _ c = c 2 )
   j 0 ;
   do
     c 1 ( j ) c 1 ( j ) + b i , j m i n ; c 2 ( j ) c 2 ( j ) + 2 × b i , j m i n ; c 3 ( j ) c 3 ( j ) b i , j m i n ; j j + 1
   while ( j n )
 endif;
  z z + m i n i m u m _ c o n t r i b u t i o n
end.

3.5. Population Replacement

For the replacement of a population, we apply a modified replacement rule to respect not only the quality of the solutions, but also the distances (differences) between solutions. In particular, we have implemented an enhanced version of the “ μ + 1 ” update rule. The idea is to preserve the minimum distance ( D T ) between population members. So, if the newly created offspring violates the minimum distance criterion, then it is simply omitted. The exception is the situation where the produced offspring is better than the best population individual. Note that the offspring is included into the population only if it is better than the worst population individual.

4. Computational Experiments

The hybrid genetic algorithm is coded by using C# programming language. For converting the analytical solutions to graphical images, however, Java programming language is used. The computational experiments have been conducted using an ×86 series personal computer equipped with an Intel (Intel Corp., Santa Clara, CA, USA) 2 GHz 4 cores processor, 8 GB RAM and the 64-bit MS Windows operating system.
We experimented with the distance matrix B of size 64 ( n = 64 ), which is available at the public electronic library of the benchmark data instances of the QAP—QAPLIB (http://www.seas.upenn.edu/qaplib (accessed on 30 June 2021), also see [19]). The grid size is 8 × 8 ( n 1 = n 2 = 8 ). The value of the parameter m varies between 2 and n 1 , while the parameter m 1 varies between 1 and m 1 (in fact, m 2 is enough since solutions with m 2 + 1 , m 2 + 2 , … can be obtained by symmetry from solutions with m 2 1 , m 2 2 , …). We recall that m 2 = m m 1 , m 3 = n m , where m 1 , m 2 , m 3 denote the numbers of dots (squares) of first, second and third color, respectively.
As main algorithm performance criteria, we adopt the success rate ( S R ) of the algorithm and the average deviation ( A D ) of the objective function. The success rate is calculated by the following formula: S R = N b k v R × 100 [ % ] , where N b k v is the total number of the best-known solutions (BKSs) over R = 10 independent runs of the algorithm. The average deviation is derived from this formula: A D = z ¯ B K V B K V × 100 [ % ] , where z ¯ is the average objective function value over R runs of the algorithm and B K V denotes the best- known value of the objective function.
At every run, the algorithm is applied to the given particular values of n , m and m 1 . Each time, the genetic algorithm starts from a new, distinct random initial population. The current run of the algorithm is terminated if the total number of generations, G , has been reached.
The particular values of the control parameters of the genetic algorithm are shown in Table 1.
The results of the conducted experiments are presented in Table 2. All these results were achieved without fine-tuning of the parameters—only using the prescribed, default values of the control parameters of the genetic algorithm.
In Table 2, we provide the following information: n—the total number of dots (squares), m, m1, BKV—best known value of the objective function, BFV—best found objective function value, AD—average deviation of the objective function, SR—success rate, t—the average time (CPU time) per one run of the algorithm. Only the part of the results are shown for the sake of brevity. More results of the computational experiments (including the graphical images) will be available at https://www.personalas.ktu.lt/~alfmise/, accessed on 30 June 2021. Also, electronic copies of the additional results can be freely requested by contacting the authors.
The results in Table 2 demonstrate the astonishingly excellent performance (and reliability) of the proposed genetic algorithm from both the quality of solutions and the computational budget point of view. 100-percentage success rate was achieved in all 126 examined cases (scenarios). The cumulative average CPU time per run is equal to approximately 3.904 s.
The lasting, steady stability of the results and the almost linear character of the run time of the algorithm can be observed (see Table 2 and Figure 3).
In order to reveal the importance and usefulness of the hierarchical iterated tabu search used within the hybrid genetic algorithm, we carried out some additional experiments using the pure genetic algorithm without the HITS procedure (under equal other conditions). The obtained results are shown in Table 3. The results clearly demonstrate that: (i) the performance of the hybrid genetic algorithm heavily depends on the HITS procedure used; (ii) the dominance of hybrid GA over pure GA is strongly pronounced both in terms of the average deviation of the objective function and the success rate of the algorithm—thus our designed HITS procedure is very well suited for implementation in the hybrid genetic algorithm.
The analytical solutions can be quite easily transformed to their “visual counter-parts” and it is for the readers to judge about the quality of different generated color frames (see Figure 4 and Figure 5).
Every square (dot) of the depicted graphical images is consisting of 100 = 10 × 10 pixels in Figure 4a,c,e and Figure 5a,c,e and 4 = 2 × 2 pixels in Figure 4b,d,f and Figure 5b,d,f. 64 = 8 × 8 squares constitute a single “template” and each 64-square-template is replicated times horizontally and times vertically in patterns pattern-1, pattern-3, pattern-5, pattern-7, pattern-9, pattern-11 and 20 times horizontally and 20 times vertically in patterns pattern-2, pattern-4, pattern-6, pattern-8, pattern-10, pattern-12 (see Figure 4 and Figure 5). Quantitative characteristics (specifications) for each color pattern are summarized in Table 4.

5. Conclusions

In this paper, we have introduced a new combinatorial optimization problem entitled the color mix problem, which has practical potential applications in modern computer graphics, multimedia, as well as the visual arts.
We have also proposed the hybrid genetic-iterated tabu search algorithm for heuristically solving the color mix problem. The most important feature of the algorithm used is that the genetic algorithm operators are hybridized with the hierarchical iterated tabu search procedure, which, in turn, incorporates the efficient tabu search algorithm combined with mutations of solutions and fast greedy adaptive search procedure. This results in a smart hybridization scheme with effective optimizer of the offspring solutions.
The genetic algorithm was examined by using various data instances. The results from the experiments confirm the promising performance of the proposed algorithm for the solution of the color mix problem.
As to the future research direction, it is worthwhile to study the behaviour of the proposed algorithm on bigger data instances and also to adapt our algorithm for problems with larger numbers of colors.

Author Contributions

Conceptualization, A.M. and A.A.; methodology, A.M. and A.A; software, A.A.; validation, A.M., A.A., A.O., T.B. and L.M.; formal analysis, A.M., A.A., A.O., T.B. and L.M; investigation, A.M.; resources, A.M. and A.O.; data curation, A.M. and A.A.; writing—original draft preparation, A.M. and A.A; writing—review and editing, A.M., A.A., A.O., T.B. and L.M.; visualization, A.A.; supervision, A.M.; project administration, A.M.; funding acquisition, A.M. and A.O. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Çela, E. The Quadratic Assignment Problem: Theory and Algorithms; Kluwer: Dordrecht, The Netherlands, 1998. [Google Scholar]
  2. Taillard, E.D. Comparison of iterative searches for the quadratic assignment problem. Locat. Sci. 1995, 3, 87–105. [Google Scholar] [CrossRef]
  3. Kang, H.R. Digital Color Halftoning; The SPIE Optical Engineering Press: Bellingham, WA, USA; IEEE Press: Piscataway, NJ, USA, 1999. [Google Scholar]
  4. Kuznetsov, Y.V. Principles of Image Printing Technology; Springer: Cham, Switzerland, 2021. [Google Scholar]
  5. Lau, D.L.; Arce, G.R. Modern Digital Halftoning; Marcel Dekker: New York, NY, USA; Basel, Switzerland, 2008. [Google Scholar]
  6. Ulichney, R. Digital Halftoning; MIT Press: London, UK, 1987. [Google Scholar]
  7. Wong, P.W.; Memon, N.D. Image processing for halftones. IEEE Sig. Proc. Magaz. 2003, 20, 59–70. [Google Scholar]
  8. Martí, R.; Pardalos, P.M.; Resende, M.G.C. (Eds.) Handbook of Heuristics; Springer: Cham, Switzerland, 2018. [Google Scholar]
  9. Drezner, Z. Finding a cluster of points and the grey pattern quadratic assignment problem. OR Spectrum 2006, 28, 417–436. [Google Scholar] [CrossRef]
  10. Talbi, E.-G.; Hafidi, Z.; Geib, J.-M. Parallel tabu search for large optimization problems. In Meta-Heuristics: Advances and Trends in Local Search Paradigms for Optimization; Voß, S., Martello, S., Osman, I.H., Roucairol, C., Eds.; Kluwer: Boston, MA, USA, 1999; pp. 345–358. [Google Scholar]
  11. Taillard, E.D.; Gambardella, L.M. Adaptive Memories for the Quadratic Assignment Problem; Technical Report IDSIA-87-97; CiteSeerX: Lugano, Switzerland, 1997. [Google Scholar]
  12. Misevičius, A. Experiments with hybrid genetic algorithm for the grey pattern problem. Informatica 2006, 17, 237–258. [Google Scholar] [CrossRef]
  13. Misevičius, A.; Stanevičienė, E. A new hybrid genetic algorithm for the grey pattern quadratic assignment problem. Inf. Technol. Control 2018, 47, 503–520. [Google Scholar] [CrossRef] [Green Version]
  14. Misevičius, A.; Palubeckis, G.; Drezner, Z. Hierarchicity-based (self-similar) hybrid genetic algorithm for the grey pattern quadratic assignment problem. Memet. Comput. 2021, 13, 69–90. [Google Scholar] [CrossRef]
  15. Misevičius, A.; Verenė, D. A hybrid genetic-hierarchical algorithm for the quadratic assignment problem. Entropy 2021, 23, 108. [Google Scholar] [CrossRef] [PubMed]
  16. Goldberg, D.E. Genetic Algorithms in Search, Optimization and Machine Learning; Addison-Wesley: Reading, MA, USA, 1989. [Google Scholar]
  17. Mehrdoost, Z.; Bahrainian, S.S. A multilevel tabu search algorithm for balanced partitioning of unstructured grids. Int. J. Numer. Meth. Engng. 2016, 105, 678–692. [Google Scholar] [CrossRef]
  18. Glover, F.; Laguna, M. Tabu Search; Kluwer: Dordrecht, The Netherlands, 1997. [Google Scholar]
  19. Burkard, R.E.; Karisch, S.; Rendl, F. QAPLIB—A quadratic assignment problem library. J. Global Optim. 1997, 10, 391–403. Available online: http://anjos.mgi.polymtl.ca/qaplib/ (accessed on 30 June 2021).
  20. Hexadecimal Color. Available online: https://cgtweb1.tech.purdue.edu/courses/cgt215/141/Htmlhowto/hexcolor.html (accessed on 30 June 2021).
Figure 1. Illustration of entries of matrix A ( n = 16 , m = 8 , m 1 = 3 ).
Figure 1. Illustration of entries of matrix A ( n = 16 , m = 8 , m 1 = 3 ).
Applsci 11 07263 g001
Figure 2. Illustration of the (optimal) color mix pattern ( n = 64 , n 1 = n 2 = 8 , m = 8 , m 1 = 11 , m 2 = 12 , m 3 = 41 ).
Figure 2. Illustration of the (optimal) color mix pattern ( n = 64 , n 1 = n 2 = 8 , m = 8 , m 1 = 11 , m 2 = 12 , m 3 = 41 ).
Applsci 11 07263 g002
Figure 3. Illustration of run time behaviour of the hybrid genetic algorithm for different values of m.
Figure 3. Illustration of run time behaviour of the hybrid genetic algorithm for different values of m.
Applsci 11 07263 g003
Figure 4. Illustrations of color patterns: (a) pattern-1, (b) pattern-2, (c) pattern-3, (d) pattern-4, (e) pattern-5, (f) pattern-6.
Figure 4. Illustrations of color patterns: (a) pattern-1, (b) pattern-2, (c) pattern-3, (d) pattern-4, (e) pattern-5, (f) pattern-6.
Applsci 11 07263 g004
Figure 5. Illustrations of color patterns: (a) pattern-7, (b) pattern-8, (c) pattern-9, (d) pattern-10, (e) pattern-11, (f) pattern-12.
Figure 5. Illustrations of color patterns: (a) pattern-7, (b) pattern-8, (c) pattern-9, (d) pattern-10, (e) pattern-11, (f) pattern-12.
Applsci 11 07263 g005
Table 1. Values of the control parameters of the hybrid genetic algorithm used in the experiments.
Table 1. Values of the control parameters of the hybrid genetic algorithm used in the experiments.
ParameterValueRemarks
Population size, PS20
Number of generations, G50
Distance threshold, DTmax {2, ⎣0.1m⎦} 0 < D T m
Idle generations limit, i d l e _ g e n _ l i m i t max {3, ⎣0.05G⎦} 0 < i d l e _ g e n _ l i m i t G
Number of iterations of hierarchical iterated tabu search, Q h i e r 100 Q h i e r = Q ( 0 ) × Q ( 1 ) × Q ( 2 )  
Number of iterations of tabu search, τ 30
Idle iterations limit, i d l e _ i t e r _ l i m i t max {3, ⎣0.2τ⎦} 0 < i d l e _ i t e r _ l i m i t τ
Tabu tenure, h ⎣0.5nh > 0
Randomization coefficient for tabu search, α 0.02 0 α < 1
Mutation rate factor, ξ 0.25 0 < ξ 1
Number of runs of the algorithm, R 10
Q ( 0 ) = 10 , Q ( 1 ) = 5 , Q ( 2 ) = 2 .
Table 2. Results of the computational experiments (part I).
Table 2. Results of the computational experiments (part I).
nmm1BKVBFVAD [%]SR [%]t [sec]nmm1BKVBFVAD [%]SR [%]t [sec]
6421625062500.0001000.773641684,020,0004,020,0000.0001004.016
643137,50037,5000.0001001.434641716,544,4486,544,4480.0001003.678
644193,75093,7500.0001001.524641726,180,0166,180,0160.0001003.845
644275,000750,000.0001001.431641735,837,7205,837,7200.0001003.617
6451225,000225,0000.0001001.908641745,498,5525,498,5520.0001003.925
6452207,384207,3840.0001001.900641755,288,3245,288,3240.0001003.886
6461423,248423,2480.0001002.014641765,120,4165,120,4160.0001003.782
6462337,500337,5000.0001001.862641774,994,1724,994,1720.0001003.788
6463341,022341,0220.0001002.101641784,926,6724,926,6720.0001003.949
6471662,500662,5000.0001002.180641817,743,6467,743,6460.0001003.797
6472559,448559,4480.0001002.166641827,161,3967,161,3960.0001004.036
6473487,500487,5000.0001002.217641836,812,2466,812,2460.0001003.884
6481918,750918,7500.0001002.327641846,452,1286,452,1280.0001003.992
6482800,000800,0000.0001002.326641856,217,1166,217,1160.0001004.062
6483718,750718,7500.0001002.410641865,991,7165,991,7160.0001003.777
6484650,000650,0000.0001002.484641875,854,9525,854,9520.0001004.039
64911,290,0001,290,0000.0001002.888641885,768,6245,768,6240.0001003.867
64921,154,1881,154,1880.0001003.344641895,761,8145,761,8140.0001004.099
64931,057,7301,057,7300.0001003.801641918,958,4148,958,4140.0001003.654
6494976,980976,9800.0001003.676641928,394,6068,394,6060.0001004.358
641011,748,2801,748,2800.0001003.104641937,815,8447,815,8440.0001004.482
641021,542,5001,542,5000.0001003.241641947,481,5127,481,5120.0001004.727
641031,416,9541,416,9540.0001003.234641957,198,8827,198,8820.0001004.057
641041,304,9241,304,9240.0001003.011641966,961,4606,961,4600.0001003.868
641051,297,9321,297,9320.0001003.693641976,767,3786,767,3780.0001004.052
641112,225,7382,225,7380.0001003.782641986,629,5006,629,5000.0001004.235
641122,023,0442,023,0440.0001003.759641996,578,4106,578,4100.0001004.808
641131,832,5001,832,5000.0001003.4006420110,226,44810,226,4480.0001004.246
641141,708,5081,708,5080.0001003.465642029,639,7329,639,7320.0001004.222
641151,666,6741,666,6740.0001003.452642039,055,9909,055,9900.0001004.664
641212,772,8942,772,8940.0001003.382642048,482,7928,482,7920.0001005.065
641222,530,3002,530,3000.0001003.440642058,242,6548,242,6540.0001004.332
641232,332,4502,332,4500.0001003.627642067,947,3807,947,3800.0001004.206
641242,135,0002,135,0000.0001003.541642077,733,3487,733,3480.0001004.096
641252,094,5422,094,5420.0001003.160642087,541,5367,541,5360.0001004.441
641262,058,8082,058,8080.0001003.282642097,452,0987,452,0980.0001004.763
641313,391,5103,391,5100.0001003.1916420107,419,4047,419,4040.0001004.697
641323,117,6063,117,6060.0001003.2136421111,537,30411,537,3040.0001004.605
641332,883,8782,883,8780.0001003.3506421210,944,26210,944,2620.0001004.390
641342,682,1282,682,1280.0001003.3676421310,359,22410,359,2240.0001004.364
641352,575,0002,575,0000.0001003.354642149,791,6889,791,6880.0001005.261
641362,535,6802,535,6800.0001003.292642159,287,2409,287,2400.0001005.036
641414,073,4424,073,4420.0001003.354642169,030,7029,030,7020.0001005.125
641423,767,1643,767,1640.0001003.334642178,795,1828,795,1820.0001005.358
641433,504,3183,504,3180.0001003.387642188,571,8288,571,8280.0001005.686
641443,248,6043,248,6040.0001003.364642198,442,6468,442,6460.0001005.311
641453,131,9063,131,9060.0001003.4716421108,349,1428,349,1420.0001005.732
641463,027,5003,027,5000.0001003.4936422112,922,75412,922,7540.0001005.163
641473,020,7563,020,7560.0001003.6506422212,252,80012,252,8000.0001005.106
641514,803,0164,803,0160.0001003.4536422311,671,95811,671,9580.0001005.248
641524,467,5024,467,5020.0001003.3636422411,113,08411,113,0840.0001004.511
641534,167,2344,167,2340.0001003.6236422510,602,38610,602,3860.0001005.285
641543,909,1083,909,1080.0001003.6586422610,104,18810,104,1880.0001005.329
641553,746,8443,746,8440.0001003.689642279,872,6629,872,6620.0001005.306
641563,609,5803,609,5800.0001003.621642289,618,0529,618,0520.0001005.380
641573,517,5003,517,5000.0001003.679642299,483,7149,483,7140.0001005.865
641615,568,7505,568,7500.0001003.7116422109,344,1049,344,1040.0001006.292
641625,210,0005,210,0000.0001003.7866422119,342,5569,342,5560.0001005.886
641634,888,7504,888,7500.0001004.2076423114,411,076144,110,760.0001005.790
641644,580,0004,580,0000.0001004.0136423213,718,23613,718,2360.0001005.500
641654,408,7504,408,7500.0001004.3906423313,051,23613,051,2360.0001005.568
641664,250,0004,250,0000.0001004.2416423412,471,98012,471,9800.0001006.146
641674,128,7504,128,7500.0001003.9816423511,942,53211,942,5320.0001005.976
Table 3. Results of the computational experiments (part II).
Table 3. Results of the computational experiments (part II).
nmm1BKVBFVAD [%]SR [%]t [sec]nmm1BKVBFVAD [%]SR [%]t [sec]
6421625062502.80090.0000.001641684,020,0004,486,46414.2540.0000.001
643137,50037,50011.06310.0000.000641716,544,4486,992,5888.5530.0000.001
644193,75093,75014.32610.0000.000641726,180,0166,584,4967.8510.0000.001
644275,00080,52829.2460.0000.000641735,837,7206,220,0548.2190.0000.001
6451225,000237,24012.2630.0000.000641745,498,5525,857,5008.0620.0000.001
6452207,384210,2546.5470.0000.000641755,288,3245,608,2088.5860.0000.001
6461423,248441,2006.8960.0000.000641765,120,4165,403,8787.5210.0000.001
6462337,500364,44412.4360.0000.000641774,994,1725,308,5347.9450.0000.001
6463341,022350,2085.9580.0000.000641784,926,6725,144,9767.9860.0000.001
6471662,500675,1484.8390.0000.000641817,743,6467,979,2945.8020.0000.001
6472559,448593,8329.0390.0000.000641827,161,3967,560,6147.8210.0000.001
6473487,500530,46413.5740.0000.000641836,812,2467,132,0947.4900.0000.001
6481918,7501,003,10210.5860.0000.000641846,452,1286,808,5127.3020.0000.001
6482800,000871,47211.0570.0000.000641856,217,1166,502,7366.6010.0000.001
6483718,750799,07813.8770.0000.000641865,991,7166,295,0047.1900.0000.001
6484650,000757,61619.5200.0000.000641875,854,9526,120,3706.5990.0000.001
64911,290,0001,358,2468.4380.0000.000641885,768,6246,079,6706.6380.0000.001
64921,154,1881,207,8068.6830.0000.000641895,761,8145,964,4625.2990.0000.001
64931,057,7301,104,3528.1680.0000.000641918,958,4149,156,8964.0630.0000.001
6494976,9801,044,9209.9890.0000.000641928,394,6068,607,3285.3240.0000.001
641011,748,2801,788,4604.3240.0000.000641937,815,8448,222,3167.1250.0000.001
641021,542,5001,634,2126.8380.0000.000641947,481,5127,875,5266.6790.0000.001
641031,416,9541,501,5367.9970.0000.000641957,198,8827,574,8166.5390.0000.001
641041,304,9241,392,3889.9500.0000.000641966,961,4607,309,5206.3880.0000.001
641051,297,9321,332,1128.4340.0000.000641976,767,3787,064,9185.9810.0000.001
641112,225,7382,290,7485.2880.0000.000641986,629,5006,952,5526.7870.0000.001
641122,023,0442,076,6845.5140.0000.000641996,578,4106,830,7825.4010.0000.001
641131,832,5001,915,1706.9520.0000.0006420110,226,44810,517,4343.6990.0000.001
641141,708,5081,795,4228.4130.0000.000642029,639,7329,910,5204.2740.0000.001
641151,666,6741,753,0827.8410.0000.000642039,055,9909,416,6765.5630.0000.001
641212,772,8942,854,2425.7500.0000.000642048,482,7928,888,3766.9150.0000.001
641222,530,3002,610,0406.4480.0000.000642058,242,6548,594,0845.8270.0000.001
641232,332,4502,432,7107.4640.0000.000642067,947,3808,334,3105.7620.0000.001
641242,135,0002,244,2608.9710.0000.000642077,733,3488,129,7286.0400.0000.001
641252,094,5422,199,8127.4570.0000.000642087,541,5367,959,0086.2390.0000.001
641262,058,8082,185,7229.0720.0000.000642097,4520,987,695,5865.5760.0000.001
641313,391,5103,516,4125.2600.0000.0006420107,419,4047,681,7945.5350.0000.001
641323,117,6063,247,5666.7890.0000.0006421111,537,30411,779,9983.4400.0000.001
641332,883,8783,054,2648.0150.0000.0006421210,944,26211,233,2343.7370.0000.001
641342,682,1282,883,9489.3640.0000.0006421310,359,22410,691,4924.5620.0000.001
641352,575,00027637469.0170.0000.000642149,791,68810,301,1985.9780.0000.001
641362,535,6802,645,8767.0060.0000.001642159,287,2409,813,6446.8220.0000.001
641414,073,4424,124,7486.9060.0000.001642169,030,7029,414,5085.7310.0000.001
641423,767,1643,938,1166.4870.0000.001642178,795,1829,193,4205.6860.0000.001
641433,504,3183,739,0588.1210.0000.001642188,571,8288,927,1045.8780.0000.001
641443,248,6043,460,3369.2050.0000.001642198,442,6468,770,3725.5750.0000.001
641453,131,9063,357,1368.9180.0000.0016421108,349,1428,770,9905.9040.0000.001
641463,027,5003,218,3308.9260.0000.0016422112,922,75413,137,4302.6860.0000.001
641473,020,7563,155,4568.3180.0000.0016422212,252,80012,637,7343.9350.0000.001
641514,803,0164,998,6547.1160.0000.0016422311,671,95811,983,7484.1570.0000.001
641524,467,5024,630,8607.9290.0000.0016422411,113,08411,539,6305.0170.0000.001
641534,167,2344,451,4808.7680.0000.0016422510,602,38610,990,0084.8410.0000.001
641543,909,1084,226,46410.2620.0000.0016422610,104,18810,547,5946.1310.0000.001
641553,746,8443,960,8808.5560.0000.001642279,872,66210,275,7165.9150.0000.001
641563,609,5803,919,9349.9320.0000.001642289,618,05210,004,5725.3900.0000.001
641573,517,5003,697,0849.6930.0000.001642299,483,7149,902,3005.6080.0000.001
641615,568,7506,023,9109.7660.0000.0016422109,344,1049,782,9685.6660.0000.001
641625,210,0005,656,5889.6160.0000.0016422119,342,5569,675,6464.8710.0000.001
641634,888,7505,203,5009.4430.0000.0016423114,411,07614,606,4702.7970.0000.001
641644,580,0005,013,78810.9010.0000.0016423213,718,23614,031,9863.4350.0000.001
641654,408,7504,827,87210.7790.0000.0016423313,051,23613,353,8103.3970.0000.001
641664,250,0004,540,83810.7440.0000.0016423412,471,98012,812,2724.1380.0000.001
641674,128,7504,575,03412.4840.0000.0016423511,942,53212,371,0924.5700.0000.001
Table 4. Quantitative characteristics (specifications) of color patterns.
Table 4. Quantitative characteristics (specifications) of color patterns.
Color Pattern IDm1m2m3Color1Color2Color3# Pixels Per Square
RGBRGBRGB
pattern-1212221E4C4821B3B7DFFFF00100
pattern-2212221E4C4821B3B7DFFFF004
pattern-3212221F151550EAEAAFFFF00100
pattern-4212221F151550EAEAAFFFF004
pattern-5111241A066F15F990EFFFF00100
pattern-6111241A066F15F990EFFFF004
pattern-7111241FF000000FF00FFFF00100
pattern-8111241FF000000FF00FFFF004
pattern-9101044116B8AEE9475FFFF00100
pattern-10101044116B8AEE9475FFFF004
pattern-11101044E040AA1FBF55FFFF00100
pattern-12101044E040AA1FBF55FFFF004
Remarks: 1. m2 = mm1, m3 = nm; m1, m2, m3 denote the numbers of squares (dots) of colors color1, color2, color3, respectively. 2. The values of the colors’ components R (red), G (green), B (blue) are presented in a hexadecimal form (in accordance with RGB color model) [20]. 3. The values of the components R, G, B of colors color1, color2 are generated randomly, while the third color color2 is always yellow (FF FF 00).
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Misevičius, A.; Andrejevas, A.; Ostreika, A.; Blažauskas, T.; Motiejūnas, L. The Color Mix Problem. Appl. Sci. 2021, 11, 7263. https://doi.org/10.3390/app11167263

AMA Style

Misevičius A, Andrejevas A, Ostreika A, Blažauskas T, Motiejūnas L. The Color Mix Problem. Applied Sciences. 2021; 11(16):7263. https://doi.org/10.3390/app11167263

Chicago/Turabian Style

Misevičius, Alfonsas, Aleksandras Andrejevas, Armantas Ostreika, Tomas Blažauskas, and Liudas Motiejūnas. 2021. "The Color Mix Problem" Applied Sciences 11, no. 16: 7263. https://doi.org/10.3390/app11167263

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop