In this section, we propose a learning automata-based Multi-meme memetic algorithm called LAMACOL for solving the vertex coloring problem. In the proposed algorithm, before coloring process starts, a preprocessing algorithm may be applied to reduce a graph G to a graph G’ such that a feasible k-coloring for G can be derived by construction rules from any feasible k-coloring of G’. The preprocessing algorithm consists of two reduction rules presented in [41].
-
Rule 1: Remove all vertices in G where their degree are less than the k. Knowing that the degree of a vertex u is less than k guarantees that at least one color that is not used in the set of adjacent vertices can be assigned to u without breaking feasibility.
-
Rule 2: Remove any vertex \(\:\text{v}\in\:\text{V}\:\) for which there is a \(\:\text{u}\in\:\text{V}\), \(\:\text{u}\ne\:\text{v}\:\) and \(\:[\text{u},\text{v}]\notin\:\text{E}\), such that u is connected to every vertex to which v is connected. In this case, any color that can be assigned to u can also be assigned to v.
These two rules can be applied in any order and if one rule applies, it may make possible further reductions by the other rule. Hence, in the preprocessing stage, the two rules are applied iteratively until no vertex can be removed anymore.
The proposed algorithm is composed of two parts, genetic section and memetic section. In each iteration, evolution is performed in genetic section and local search is performed in memetic section. In what follows genetic and memetic sections are described.
Genetic section for proposed algorithm
Genetic section consist of a population of chromosomes with size 1 (N = 1). In this section, an ICLA isomorphic to input graph is generated. For this purpose, each vertex \(\:{\text{v}}_{\text{i}}\) of graph is associated with cell \(\:{\text{c}}_{\text{i}}\) of ICLA where is equipped with a learning automaton (\(\:{\text{L}\text{A}}_{\text{i}}\)). The set of actions of learning automaton \(\:{\text{L}\text{A}}_{\text{i}}\) constitute the set of color by which the cell \(\:{\text{c}}_{\text{i}}\) can be colored. The resulting ICLA can be model by a duple \(\:<\underset{\_}{\text{A}},\:\underset{\_}{\text{a}}>\) where \(\:\underset{\_}{\text{A}}=\{{\text{L}\text{A}}_{1},{\text{L}\text{A}}_{2},\dots\:,{\text{L}\text{A}}_{\text{n}}\}\) is the set of learning automata corresponding to vertex-set of graph and \(\:\underset{\_}{\text{a}}=\{\underset{\_}{{\text{a}}_{1}},\underset{\_}{{\text{a}}_{2}},\dots\:,\underset{\_}{{\text{a}}_{\text{n}}}\}\) denotes the action-set of learning automata in which \(\:\underset{\_}{{\text{a}}_{\text{i}}}=\{{\text{a}}_{\text{i}}^{1},\:{\text{a}}_{\text{i}}^{2},\:\dots\:,\:{\text{a}}_{\text{i}}^{{\varDelta\:}_{\text{i}}+1}\}\) is the set of actions (colors) that can be taken by learning automaton \(\:{\text{L}\text{A}}_{\text{i}}\) (the set of colors by which the vertex \(\:{\text{v}}_{\text{i}}\) can be colored) where n is the number of vertices and \(\:{\varDelta\:}_{\text{i}}\) is the degree of vertex \(\:{\text{v}}_{\text{i}}\). It has been shown in [42] that an arbitrary graph can be colored with at most \(\:\varDelta\:+1\) colors, where \(\:\varDelta\:\) denotes the graph degree. Therefore, it can be concluded that vertex \(\:{\text{v}}_{\text{i}}\) and its neighboring vertices can be colored with at most \(\:{\varDelta\:}_{\text{i}}+1\) colors in the worst case. That is why, in genetic section of proposed algorithm, the action-set of \(\:{\text{L}\text{A}}_{\text{i}}\) (corresponding to color set of vertex \(\:{\text{v}}_{\text{i}}\)) is composed of \(\:{\varDelta\:}_{\text{i}}+1\) actions (or colors).
The operation of genetic section of proposed algorithm which composed of a number of stages can be described as follows. The stage t of genetic section consists of two steps. In the first step, the learning automaton of each cell chooses one of its actions (colors) randomly, based on its action probability vector which is initially set to \(\:\frac{1}{{\varDelta\:}_{\text{i}}+1}\). The actions (colors) chosen by the set of learning automata generate a new solution for coloring of graph. The cardinality of the set of colors which are selected by the learning automaton at cell \(\:{\text{c}}_{\text{i}}\) and its neighboring cells named color-degree and denoted as \(\:{\text{D}}_{\text{i}}\). The action (color) which is selected by learning automaton \(\:{\text{L}\text{A}}_{\text{i}}\) at cell \(\:{\text{c}}_{\text{i}}\) is penalized, if this action (color) is also selected by the learning automata of at least one of its neighboring cells or color-degree of cell \(\:{\text{c}}_{\text{i}}\), i.e., \(\:{\text{D}}_{\text{i}}\), is greater than its own dynamic threshold, i.e., \(\:{\text{T}}_{\text{i}}\). Dynamic threshold \(\:{\text{T}}_{\text{i}}\) which retains the minimum value of \(\:{\text{D}}_{\text{i}}\) that has been seen so far for cell \(\:{\text{c}}_{\text{i}}\), can be initially set to \(\:{\varDelta\:}_{\text{i}}+1\). Otherwise, the selected action (color) by learning automaton \(\:{\text{L}\text{A}}_{\text{i}}\) is rewarded. In the second step of stage t, new solution which is created by combining the selected actions (colors) of all LAs, replaced with the current chromosome; if the genetic fitness of new solution is better than it. Otherwise, all automata penalize their selected actions. The genetic fitness function counts the number of edges that their end points have same color class. Formally, the genetic fitness of the only chromosome at stage t can be described as \(\:\text{G}\text{F}\left(\text{t}\right)=1/(1+\sum\:_{\text{i}=1}^{\text{k}}\left|{\text{E}}_{\text{i}}\right|)\), where \(\:{|\text{E}}_{\text{i}}|\) is the cardinality of set of edges with both end points in color class \(\:{\text{C}}_{\text{i}}.\)
Memetic section for proposed algorithm
Memetic section consists of a pool of memes of size L. The size of meme pool is equal to number of local search methods. Each local search method corresponds to one of the memes in the meme pool. Each meme saves the history of the effect of its corresponding local search method. Each meme is composed of n learning automata each of which corresponds to a gene of the current chromosome. Specifically, the \(\:{\text{i}}_{\text{t}\text{h}}\) automaton corresponds to the \(\:{\text{i}}_{\text{t}\text{h}}\) gene of the current chromosome. Each learning automaton has \(\:{\varDelta\:}_{\text{i}}+1\) actions corresponding to \(\:{\varDelta\:}_{\text{i}}+1\) possible colors that can be taken by vertex \(\:{\text{v}}_{\text{i}}\). The history of the effect of \(\:{\text{i}}_{\text{t}\text{h}}\) local search method at stage t is represented by the action probability vectors of learning automata in the \(\:{\text{i}}_{\text{t}\text{h}}\) meme as given Eq. (3).
$$\:\underset{\_}{{\text{M}}^{\text{i}}\left(\text{t}\right)}=[\underset{\_}{{\text{M}}_{1}^{\text{i}}\left(\text{t}\right)},\:\underset{\_}{{\text{M}}_{2}^{\text{i}}\left(\text{t}\right)},\:\dots\:,\:\underset{\_}{{\text{M}}_{\text{n}}^{\text{i}}\left(\text{t}\right)}]$$
3
where
$$\:\underset{\_}{{\text{M}}_{\text{j}}^{\text{i}}\left(\text{t}\right)}={[{\text{M}}_{\text{j}1}^{\text{i}}\left(\text{t}\right),\:{\text{M}}_{\text{j}2}^{\text{i}}\left(\text{t}\right),\:\dots\:,\:{\text{M}}_{\text{j}{(\varDelta\:}_{\text{j}}+1)}^{\text{i}}\left(\text{t}\right)]}^{{\prime\:}},\:1\le\:\text{j}\le\:\text{n}\:\text{a}\text{n}\text{d}\:\sum\:_{\text{p}=1}^{{\varDelta\:}_{\text{j}}+1}{\text{M}}_{\text{j}\text{p}}^{\text{i}}\left(\text{t}\right)=1\:\forall\:\text{i},\text{j}.$$
\(\:{\text{M}}_{\text{j}\text{p}}^{\text{i}}\left(\text{t}\right)\) denotes the probability that action p of \(\:{\text{j}}_{\text{t}\text{h}}\) leaning automaton in meme i (corresponding to the color p for gene j) is selected. The probability of selecting an action (color) by \(\:{\text{j}}_{\text{t}\text{h}}\) learning automaton is initially set to \(\:\frac{1}{{\varDelta\:}_{\text{j}}+1}\). The action probability vectors of a meme (the history) are updated according to a learning algorithm based on the reinforcement signal received from the genetic section after applying the corresponding local search method. The aim of the set of learning automata of a meme is to find those colors of the genes of chromosome that result in a better solution. That is, the set of learning automata of a meme collectively finds a set of actions (colors) that minimizes the average penalty received from the environment (genetic section).
\(\:{\text{M}\text{F}}_{{\beta\:}}\left(\text{t}\right)=\prod\:_{\text{j}=1}^{\text{n}}{\text{M}}_{\text{j}\text{p}}^{{\beta\:}}\left(\text{t}\right)\:\) where p is the action (color) selected by automaton j in meme β is the probability that the current chromosome is generated by applying local search method β at stage t. \(\:{\text{M}\text{F}}_{{\beta\:}}\left(\text{t}\right)\) is referred to as memetic fitness of the current chromosome after applying meme \(\:{\beta\:}\) at stage t. Memetic fitness changes when the action probability vectors of learning automata in the meme is updated. Updating is performed on the basis of the result of applying corresponding local search method on current chromosome. If the values of gene j of current chromosome are the same before and after applying local search method β on current chromosome, the action of \(\:{\text{j}}_{\text{t}\text{h}}\) learning automaton of meme β which corresponds to the value of \(\:{\text{j}}_{\text{t}\text{h}}\) gene is rewarded and penalized, otherwise. It has been shown in [43] that applying a local search method on current chromosome, for example local search method β, is beneficial if \(\:\frac{{(1-{\text{M}\text{F}}_{{\beta\:}}\left(\text{t}\right))}^{2}}{{\text{M}\text{F}}_{{\beta\:}}\left(\text{t}\right)}>\frac{(1-\text{G}\text{F}\left(\text{t}\right))}{\text{G}\text{F}\left(\text{t}\right)}\). The proposed algorithm is composed of a number of iterations and at each generation, evolution is performed in genetic section and then local search is performed in memetic section. This process continues until the choice probability of at least one action (color) of all automata in ICLA exceeds a pre-specified threshold, e.g.,\(\:\:{\pi\:}\).
The relationship between the genetic section and memetic section for proposed algorithm is shown in Fig. 2.
Different local search methods have been proposed for vertex coloring problem in the literature[8]. Next, we briefly review five local search methods used in new proposed algorithm.
1-exchange local search
The most frequently used local search is the 1-exchange local search in which one vertex \(\:{\text{v}}_{\text{i}}\) is selected randomly and moved from its current color class i.e., \(\:{\text{C}}_{\text{j}}\), into a different color class i.e., \(\:{\text{C}}_{\text{l}}\) where \(\:\text{l}\ne\:\text{j}\) and \(\:\text{l},\text{j}\in\:\{1,\dots\:,\:{\varDelta\:}_{\text{i}}+1\}\).
Restricted 1-exchange local search
The 1-exchange local search, which is restricted to change only the color class of vertices that are in conflict, since only these modifications can lead to a increase of the fitness function; called restricted 1-exchange local search.
Swap local search
In the swap local search exactly one vertex \(\:\text{v}\in\:{\text{V}}^{\text{C}}\:\) exchange the color class with another vertex \(\:\text{v}\in\:\text{V}\).
Cyclic exchange local search
An extension of the 1-exchange and swap local search is the cyclic exchange local search. The cyclic exchange local search is a sequence of 1-exchanges local search. A cyclic exchange of length m acts on a sequence of distinctly colored vertices \(\:({\text{u}}_{1},\:...,\:{\text{u}}_{\text{m}})\). For simplicity, we will denote the color class of any \(\:{\text{u}}_{\text{i}}\), \(\:\text{i}=1,\dots\:,\text{m}\), by \(\:{\text{C}}_{\text{i}}\). The cyclic exchange local search moves any vertex \(\:{\text{u}}_{\text{i}}\), \(\:\text{i}=1,\dots\:,\text{m}\), from \(\:{\text{C}}_{\text{i}}\) into \(\:{\text{C}}_{\text{i}+1}\). We use the convention \(\:{\text{C}}_{\text{m}+1}={\text{C}}_{1}\). A cyclic exchange local search does not change the cardinality of the color classes involved in the move. Figure 3 (a) gives an example of cycle exchange local search method.
Path exchange local search
The path exchange local search is the same as cycle exchange local search expect that the um remains in \(\:{\text{C}}_{\text{m}}\). Hence the sequence of exchanges is not closed and the cardinality of \(\:{\text{C}}_{1}\) and \(\:{\text{C}}_{\text{m}}\) is modified. Figure 3 (b) gives an example of path exchange local search method.
Pseudo code for proposed algorithm demonstrated in Fig. 4: