1: Input SeqA and SeqB; initialize the parameters: , , Inf_Rate, Spreed_Rate, Recovery_Rate
|
2: Initialize the population () with () search agents, each (), , locates two positions one in SeqA and the other in SeqB such that (Length (SeqA or SeqB) - LF) |
3: Cut two fragments starting from the positions of () in the two sequences (SeqA and |
SeqB) |
4: Apply SW algorithm on each pair of fragments of each search agent (), . |
5: Compute the alignment score (length of near-exact LCCS found) for each search agent based on Eq. (1). |
6: While (tT)
|
7: Update the first () and second () best solutions from the population () based on the alignment score. |
8: If (tT)
|
9: Update each solution () based on BA's operator using Eqs. (2) - (6). |
10: Else
|
11: Check the infection conditions for each solution (): |
12: IF () |
13: Infection () = 1 |
14: Else IF (rand () > Inf_Rate) |
15: Infection () = 1 |
16: Else
|
17: Infection () = 0 |
18: End IF
|
19: For
|
20: IF Infection () = 1 |
21: Update the solution () toward () based on Eqs. (11) - (12). |
22: For(propagate the infection through three agents)
|
23: Select randomly one solution () ,
|
24: IF (rand () > Spread_Rate): |
25: Update the solution () toward () according to Eqs. (13) - (14). |
26: Infection () = 1 |
27: End IF
|
28: IF (rand () > Recovery_Rate): Infection () = 0 End IF
|
30: End For
|
31: IF (rand () > Recovery_Rate): Infection () = 0 End IF
|
32: Else
|
33: Update the solution () toward () based on Eq. (15) - (16) |
34: End IF
|
35: End For
|
36: End IF
|
37: Cut two fragments starting from the positions of () in the two sequences (SeqA and SeqB) |
Compute the alignment score for the search agents based on Eq. (1). |
38: ;
|
39: End While
|
40: Output the near-exact LCCS pointed by the first best solution () and its length. |