<?xml version='1.0'?>
<!DOCTYPE art SYSTEM 'http://www.biomedcentral.com/xml/article.dtd'>
<art>
   <ui>1748-7188-2-11</ui>
   <ji>1748-7188</ji>
   <fm>
      <dochead>Research</dochead>
      <bibl>
         <title>
            <p>Mapping sequences by parts</p>
         </title>
         <aug>
            <au id="A1" ca="yes">
               <snm>Didier</snm>
               <fnm>Gilles</fnm>
               <insr iid="I1"/>
               <email>didier@iml.univ-mrs.fr</email>
            </au>
            <au id="A2">
               <snm>Guziolowski</snm>
               <fnm>Carito</fnm>
               <insr iid="I2"/>
               <email>cvargas@irisa.fr</email>
            </au>
         </aug>
         <insg>
            <ins id="I1">
               <p>Institut de Math&#233;matiques de Luminy, 163 avenue de Luminy, Case 907, 13288 Marseille Cedex 9, France.</p>
            </ins>
            <ins id="I2">
               <p>Projet Symbiose, IRISA &#8211; campus de Beaulieu, 35042 Rennes Cedex, France.</p>
            </ins>
         </insg>
         <source>Algorithms for Molecular Biology</source>
         <issn>1748-7188</issn>
         <pubdate>2007</pubdate>
         <volume>2</volume>
         <issue>1</issue>
         <fpage>11</fpage>
         <url>http://www.almob.org/content/2/1/11</url>
         <xrefbib>
            <pubidlist>
               <pubid idtype="pmpid">17880695</pubid>
               <pubid idtype="doi">10.1186/1748-7188-2-11</pubid>
            </pubidlist>
         </xrefbib>
      </bibl>
      <history>
         <rec>
            <date>
               <day>02</day>
               <month>2</month>
               <year>2007</year>
            </date>
         </rec>
         <acc>
            <date>
               <day>19</day>
               <month>9</month>
               <year>2007</year>
            </date>
         </acc>
         <pub>
            <date>
               <day>19</day>
               <month>9</month>
               <year>2007</year>
            </date>
         </pub>
      </history>
      <cpyrt>
         <year>2007</year>
         <collab>Didier and Guziolowski; licensee BioMed Central Ltd.</collab>
         <note>This is an Open Access article distributed under the terms of the Creative Commons Attribution License (<url>http://creativecommons.org/licenses/by/2.0</url>), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.</note>
      </cpyrt>
      <abs>
         <sec>
            <st>
               <p>Abstract</p>
            </st>
            <sec>
               <st>
                  <p>Background:</p>
               </st>
               <p>We present the <it>N</it>-map method, a pairwise and asymmetrical approach which allows us to compare sequences by taking into account evolutionary events that produce shuffled, reversed or repeated elements. Basically, the optimal <it>N</it>-map of a sequence <it>s </it>over a sequence <it>t </it>is the best way of partitioning the first sequence into <it>N </it>parts and placing them, possibly complementary reversed, over the second sequence in order to maximize the sum of their gapless alignment scores.</p>
            </sec>
            <sec>
               <st>
                  <p>Results:</p>
               </st>
               <p>We introduce an algorithm computing an optimal <it>N</it>-map with time complexity <it>O </it>(|<it>s</it>| &#215; |<it>t</it>| &#215; <it>N</it>) using <it>O </it>(|<it>s</it>| &#215; |<it>t</it>| &#215; <it>N</it>) memory space. Among all the numbers of parts taken in a reasonable range, we select the value <it>N </it>for which the optimal <it>N</it>-map has the most significant score. To evaluate this significance, we study the empirical distributions of the scores of optimal <it>N</it>-maps and show that they can be approximated by normal distributions with a reasonable accuracy. We test the functionality of the approach over random sequences on which we apply artificial evolutionary events.</p>
            </sec>
            <sec>
               <st>
                  <p>Practical Application:</p>
               </st>
               <p>The method is illustrated with four case studies of pairs of sequences involving non-standard evolutionary events.</p>
            </sec>
         </sec>
      </abs>
   </fm>
   <bdy>
      <sec>
         <st>
            <p>Background</p>
         </st>
         <p>Classic alignments methods are unable to extract homologies involving shuffled, reverse-complemented or repeated elements between sequences, despite the fact that there are identified mechanisms of evolution of sequences which lead to such types of homologies. This can happen on large scale with genome rearrangements but it can also occur on a smaller scale, for instance within genes, with domain recombinations, duplications, exon shufflings, <it>etc</it>.</p>
         <p>On the other hand, there are few methods allowing us to compare sequences with relaxed assumptions about conservation of linear order and one-to-one association of positions between sequences <abbrgrp><abbr bid="B1">1</abbr><abbr bid="B2">2</abbr><abbr bid="B3">3</abbr></abbrgrp>. In particular, as it is pairwise and asymmetrical, the approach proposed in <abbrgrp><abbr bid="B1">1</abbr></abbrgrp> is similar to the work presented here. The authors introduce the transformation distance, similar to the Levenstein distance between sequences, which includes editing operations like transposition, duplication, <it>etc</it>. The algorithmic complexity of the computation of this distance, which was initially high, has been improved in <abbrgrp><abbr bid="B4">4</abbr></abbrgrp>.</p>
         <p>However, the transformation distance has some drawbacks; mainly, it does not take into account mutations. In <abbrgrp><abbr bid="B2">2</abbr></abbrgrp>, the authors introduce the Glocal alignment method which allows one to compare sequences with shuffled or inverted elements. The main idea of their work is to combine local and global alignments. During the first stage, the method selects conserved segments (local) and during the second stage, it chains an optimal subset of the pairs of segments previously selected (global). Many specialized approaches have been developed to model the specific evolutions "by blocks" of certain elements of sequences: minisatellites <abbrgrp><abbr bid="B5">5</abbr></abbrgrp> or swaps in proteins sequences <abbrgrp><abbr bid="B6">6</abbr></abbrgrp>. In the latter, the method is based on selection of common segments by local alignments scores and can be applied in a more general framework. The approach proposed in <abbrgrp><abbr bid="B3">3</abbr></abbrgrp>, mostly applied to more than two sequences, proceeds in similar manner in its first stage, then performs post-treatments and a graph representation of common elements of sequences.</p>
         <p>For simplicity, we present the <it>N</it>-maps without taking into account inversions. Some hints will be given about how to extend the definitions and the algorithms in order to handle this type of evolution. Under this restriction, the (optimal) <it>N</it>-map of a sequence <it>s </it>over a sequence <it>t </it>is basically the way of cutting <it>s </it>into <it>N </it>parts that maximizes the sums of the scores of the gapless alignments of all the <it>N </it>parts against <it>t</it>. The gapless alignments can be local or global and so can be the <it>N</it>-map. This approach can be seen as a generalization of the "alignment with a fixed number of gaps" method initially introduced in <abbrgrp><abbr bid="B7">7</abbr></abbrgrp> and recently studied in <abbrgrp><abbr bid="B8">8</abbr><abbr bid="B9">9</abbr></abbrgrp>. As this method, our approach is an attempt to avoid the introduction of some arbitrary costs on the transformations between sequences (like gap penalties in the case of alignment). For this purpose, we need a concrete way to determine the "best" number <it>N </it>of parts for mapping a sequence <it>s </it>over a sequence <it>t</it>. As in <abbrgrp><abbr bid="B9">9</abbr></abbrgrp>, we define this problem from a probabilistic point of view. Practically, we choose the number of parts leading to the most significant optimal score. The significance is empirically evaluated among pairs of independent identically distributed (iid) random sequences of same lengths and symbols distributions as <it>s </it>and <it>t</it>.</p>
         <p>The rest of this paper is organized as follows. Section 1 is devoted to formal definitions and basic properties of the <it>N</it>-maps. We present the algorithms computing the optimal scores and correponding <it>N</it>-maps of a sequence <it>s </it>over a sequence <it>t </it>in Section 2. The algorithmic complexities of these computations are <it>O </it>(|<it>s</it>| &#215; |<it>t</it>| &#215; <it>N</it>) in time and <it>O </it>(|<it>s</it>| + |<it>t</it>| &#215; <it>N</it>) in memory space. These complexities have an extra factor <it>N </it>with regard to the classical pairwise alignment algorithms. However typical values of interest of <it>N </it>are small compared to the lengths of the sequences: choosing a number of parts of the same order as the lengths of the sequences does not make any sense. The choice of the number of parts is discussed in Section 3, in which we investigate the distributions of the scores of the optimal <it>N</it>-maps of random sequences. In particular, empirical evidences lead us to approximate these distributions by normal ones and to measure the significance of optimal scores in terms of <it>Z</it>-values. The approach is evaluated in Section 4 by applying artificial evolutionary events over random sequences and by measuring the ability of the approach to retrieve the corresponding homologous segments. Section 5 shows four case studies of sequences (two pairs of proteins, a pair of DNA sequences of transposon elements and a pair of sequences of genes of microbial genomes) in which the homologies cannot be reported by a classic alignment. Finally in Section 6, we discuss the approach and present some research directions we plan to explore.</p>
         <p>The sources of the software computing <it>N</it>-maps are available at <abbrgrp><abbr bid="B10">10</abbr></abbrgrp>. We also provide additional utilities to estimate <it>Z</it>-values, represent <it>N</it>-maps as pictures (see Section 5), filter, merge and extract common segments.</p>
      </sec>
      <sec>
         <st>
            <p>1 Notations and Definitions</p>
         </st>
         <p>We consider sequences (or strings) over some finite alphabet <inline-formula><m:math name="1748-7188-2-11-i1" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mi mathvariant="script">A</m:mi><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaat0uy0HwzTfgDPnwy1egaryqtHrhAL1wy0L2yHvdaiqaacqWFaeFqaaa@3820@</m:annotation></m:semantics></m:math></inline-formula> of elements called letters or symbols. In practical applications, symbols can represent nucleotides, amino acids or genes. The elements of a sequence <it>s </it>are indexed from 1 to |<it>s</it>|, where |<it>s</it>| denotes the length of <it>s</it>, <it>i.e</it>. <it>s </it>= <it>s</it><sub>1 </sub><it>s</it><sub>2 </sub>... <it>s</it><sub>|<it>s</it>|</sub>. For 1 &#8804; <it>i </it>&#8804; <it>j </it>&#8804; |<it>s</it>|, the notation <it>s</it><sub>[<it>i</it>, <it>j</it>] </sub>designates the substring <it>s</it><sub><it>i </it></sub><it>s</it><sub><it>i</it>+1 </sub>... <it>s</it><sub><it>j</it></sub>. We note <inline-formula><m:math name="1748-7188-2-11-i2" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mover accent="true"><m:mi>s</m:mi><m:mo>^</m:mo></m:mover><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaacuWGZbWCgaqcaaaa@2E2B@</m:annotation></m:semantics></m:math></inline-formula> the reverse sequence of <it>s</it>, <it>i.e</it>.</p>
         <p><inline-formula><m:math name="1748-7188-2-11-i2" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mover accent="true"><m:mi>s</m:mi><m:mo>^</m:mo></m:mover><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaacuWGZbWCgaqcaaaa@2E2B@</m:annotation></m:semantics></m:math></inline-formula> = <it>s</it><sub>|<it>s</it>| </sub><it>s</it><sub>|<it>s</it>|</sub>-1 ...<it>s</it><sub>1</sub>. The set of all sequences of length <it>l </it>over <inline-formula><m:math name="1748-7188-2-11-i1" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mi mathvariant="script">A</m:mi><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaat0uy0HwzTfgDPnwy1egaryqtHrhAL1wy0L2yHvdaiqaacqWFaeFqaaa@3820@</m:annotation></m:semantics></m:math></inline-formula> is noted <inline-formula><m:math name="1748-7188-2-11-i3" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:msup><m:mi mathvariant="script">A</m:mi><m:mi>l</m:mi></m:msup></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaat0uy0HwzTfgDPnwy1egaryqtHrhAL1wy0L2yHvdaiqaacqWFaeFqdaahaaWcbeqaaiabdYgaSbaaaaa@39AE@</m:annotation></m:semantics></m:math></inline-formula>. Let <it>s </it>and <it>t </it>be two sequences. A pair of intervals of positions ([<it>a</it>, <it>b</it>], [<it>c</it>, <it>d</it>]) is a <it>diagonal </it>of (<it>s</it>, <it>t</it>) if 1 &#8804; <it>a </it>
&#8804; <it>b </it>&#8804; |<it>s</it>|, 1 &#8804; <it>c </it>&#8804; <it>d </it>&#8804; |<it>t</it>| and <it>b </it>- <it>a </it>= <it>d </it>- <it>c</it>. The first (<it>resp</it>. the second) interval of a diagonal <it>D </it>of (<it>s</it>, <it>t</it>) will be designated as the <it>s-interval </it>(<it>resp</it>. the <it>t-interval</it>) of <it>D</it>. In order to avoid to deal specifically with some "pathological cases", we allow diagonals to be empty (of length 0).</p>
         <p><b>Definition 1 </b><it>Let s and t be two sequences. A N-map of s over t is a N-tuple of diagonals of </it>(<it>s</it>, <it>t</it>): [([<it>a</it><sub>1</sub>, <it>b</it><sub>1</sub>], [<it>c</it><sub>1</sub>, <it>d</it><sub>1</sub>]), ([<it>a</it><sub>2</sub>, <it>b</it><sub>2</sub>], [<it>c</it><sub>2</sub>, <it>d</it><sub>2</sub>]), ...,([<it>a</it><sub><it>N</it></sub>, <it>b</it><sub><it>N</it></sub>], [<it>c</it><sub><it>N</it></sub>, <it>d</it><sub><it>N</it></sub>])] <it>such that </it>[<it>a</it><sub><it>i</it></sub>, <it>b</it><sub><it>i</it></sub>] &#8745; [<it>a</it><sub><it>j</it></sub>, <it>b</it><sub><it>j</it></sub>] = &#8709; <it>for all </it>1 &#8804; <it>i, j </it>&#8804; <it>N with j </it>&#8800; <it>i</it>.</p>
         <p>Without loss of generality, we assume in the following that the diagonals of a <it>N</it>-map of <it>s </it>over <it>t </it>are indexed according to the positions of their <it>s</it>-intervals. In particular, the <it>first diagonal </it>(<it>resp</it>. the <it>last diagonal</it>) is the one with the smallest (<it>resp</it>. the greatest) start position of <it>s</it>-interval. Notation <inline-formula><m:math name="1748-7188-2-11-i4" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:msubsup><m:mi>&#937;</m:mi><m:mrow><m:mo stretchy="false">(</m:mo><m:mi>s</m:mi><m:mo>,</m:mo><m:mi>t</m:mi><m:mo stretchy="false">)</m:mo></m:mrow><m:mi>N</m:mi></m:msubsup></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaacqqHPoWvdaqhaaWcbaGaeiikaGIaem4CamNaeiilaWIaemiDaqNaeiykaKcabaGaemOta4eaaaaa@34FE@</m:annotation></m:semantics></m:math></inline-formula> denotes the set of all the <it>N</it>-maps of <it>s </it>over <it>t</it>.</p>
         <p>A <it>N</it>-map of <it>s </it>over <it>t </it>is nothing but a peculiar type of map from a subset of positions of <it>s </it>to the set of positions of <it>t</it>. In other words, it associates at most one position of <it>t </it>to a position of <it>s</it>; and none, one or several positions of <it>s </it>to a position of <it>t </it>(See Figure <figr fid="F1">1</figr> or Figure <figr fid="F2">2</figr> for dotplot representation).</p>
         <fig id="F1">
            <title>
               <p>Figure 1</p>
            </title>
            <caption>
               <p>Representation of the 3-map [([2, 3], [1,2]), ([4,8], [7,11]), ([11,13], [5,7])] of <it>s </it>over <it>t</it></p>
            </caption>
            <text>
               <p>Representation of the 3-map [([2, 3], [1,2]), ([4,8], [7,11]), ([11,13], [5,7])] of <it>s </it>over <it>t</it>. The positions associated in a diagonal are connected by a line.</p>
            </text>
            <graphic file="1748-7188-2-11-1"/>
         </fig>
         <fig id="F2">
            <title>
               <p>Figure 2</p>
            </title>
            <caption>
               <p>Dotplot representations of two 4-maps</p>
            </caption>
            <text>
               <p>Dotplot representations of two 4-maps. a) Position <it>m </it>is inside a diagonal. b) Position <it>m </it>is not inside a diagonal.</p>
            </text>
            <graphic file="1748-7188-2-11-2"/>
         </fig>
         <p>A given classical alignment (which is also a map between positions) can be seen, for a certain positive integer <it>N</it>, as a <it>N</it>-map, both of <it>s </it>over <it>t </it>and of <it>t </it>over <it>s</it>. More precisely, an alignment with a fixed number <it>K </it>of gaps, like studied in <abbrgrp><abbr bid="B7">7</abbr><abbr bid="B8">8</abbr><abbr bid="B9">9</abbr></abbrgrp>, is a (<it>K </it>+ 1)-map which, with notations of Definition 1, verifies the additional conditions: [<it>c</it><sub><it>i</it></sub>, <it>d</it><sub><it>i</it></sub>] &#8745; [<it>c</it><sub><it>j</it></sub>, <it>d</it><sub><it>j</it></sub>] = &#8709; and (<it>a</it><sub><it>i </it></sub>- <it>a</it><sub><it>j</it></sub>) &#215; (<it>c</it><sub><it>i </it></sub>- <it>c</it><sub><it>j</it></sub>) > 0 for all 1 &#8804; <it>i</it>, <it>j </it>&#8804; <it>K </it>+ 1 with <it>j </it>&#8800; <it>i</it>. For 0 &lt;<it>N </it>&#8804; <it>K </it>&#8804; |<it>s</it>| and a given <it>N</it>-map of <it>s </it>over <it>t</it>, there is at least one <it>K</it>-map defining the same map from positions of <it>s </it>to positions of <it>t</it>.</p>
         <p>Let <inline-formula><m:math name="1748-7188-2-11-i5" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mi mathvariant="script">S</m:mi><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaat0uy0HwzTfgDPnwy1egaryqtHrhAL1wy0L2yHvdaiqaacqWFse=uaaa@3844@</m:annotation></m:semantics></m:math></inline-formula> be a <it>scoring scheme, i.e</it>. a map from <inline-formula><m:math name="1748-7188-2-11-i6" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:mstyle displaystyle="true"><m:msub><m:mo>&#8746;</m:mo><m:mrow><m:mi>l</m:mi><m:mo>&#8712;</m:mo><m:mi>&#8469;</m:mi></m:mrow></m:msub><m:mrow><m:msup><m:mi mathvariant="script">A</m:mi><m:mi>l</m:mi></m:msup><m:mo>&#215;</m:mo><m:msup><m:mi mathvariant="script">A</m:mi><m:mi>l</m:mi></m:msup></m:mrow></m:mstyle></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaadaWeqaqaamrtHrhAL1wy0L2yHvtyaeHbnfgDOvwBHrxAJfwnaGabaiab=bq8bnaaCaaaleqabaGaemiBaWgaaOGaey41aqRae8haXh0aaWbaaSqabeaacqWGSbaBaaaabaGaemiBaWMaeyicI48efv3ySLgznfgDOjdarCqr1ngBPrginfgDObcv39gaiuaacqGFveItaeqaniablQIivbaaaa@4E0E@</m:annotation></m:semantics></m:math></inline-formula> to &#8477;. The score associated to a <it>N</it>-map following <inline-formula><m:math name="1748-7188-2-11-i5" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mi mathvariant="script">S</m:mi><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaat0uy0HwzTfgDPnwy1egaryqtHrhAL1wy0L2yHvdaiqaacqWFse=uaaa@3844@</m:annotation></m:semantics></m:math></inline-formula> is:</p>
         <p>
            <display-formula>
               <m:math name="1748-7188-2-11-i7" xmlns:m="http://www.w3.org/1998/Math/MathML">
                  <m:semantics>
                     <m:mrow>
                        <m:mi mathvariant="script">S</m:mi>
                        <m:mo stretchy="false">[</m:mo>
                        <m:mo stretchy="false">(</m:mo>
                        <m:mo stretchy="false">[</m:mo>
                        <m:msub>
                           <m:mi>a</m:mi>
                           <m:mn>1</m:mn>
                        </m:msub>
                        <m:mo>,</m:mo>
                        <m:msub>
                           <m:mi>b</m:mi>
                           <m:mn>1</m:mn>
                        </m:msub>
                        <m:mo stretchy="false">]</m:mo>
                        <m:mo>,</m:mo>
                        <m:mo stretchy="false">[</m:mo>
                        <m:msub>
                           <m:mi>c</m:mi>
                           <m:mn>1</m:mn>
                        </m:msub>
                        <m:mo>,</m:mo>
                        <m:msub>
                           <m:mi>d</m:mi>
                           <m:mn>1</m:mn>
                        </m:msub>
                        <m:mo stretchy="false">]</m:mo>
                        <m:mo stretchy="false">)</m:mo>
                        <m:mo>,</m:mo>
                        <m:mn>...</m:mn>
                        <m:mo>,</m:mo>
                        <m:mo stretchy="false">(</m:mo>
                        <m:mo stretchy="false">[</m:mo>
                        <m:msub>
                           <m:mi>a</m:mi>
                           <m:mi>N</m:mi>
                        </m:msub>
                        <m:mo>,</m:mo>
                        <m:msub>
                           <m:mi>b</m:mi>
                           <m:mi>N</m:mi>
                        </m:msub>
                        <m:mo stretchy="false">]</m:mo>
                        <m:mo>,</m:mo>
                        <m:mo stretchy="false">[</m:mo>
                        <m:msub>
                           <m:mi>c</m:mi>
                           <m:mi>N</m:mi>
                        </m:msub>
                        <m:mo>,</m:mo>
                        <m:msub>
                           <m:mi>d</m:mi>
                           <m:mi>N</m:mi>
                        </m:msub>
                        <m:mo stretchy="false">]</m:mo>
                        <m:mo stretchy="false">)</m:mo>
                        <m:mo stretchy="false">]</m:mo>
                        <m:mo>=</m:mo>
                        <m:mstyle displaystyle="true">
                           <m:munderover>
                              <m:mo>&#8721;</m:mo>
                              <m:mrow>
                                 <m:mi>k</m:mi>
                                 <m:mo>=</m:mo>
                                 <m:mn>1</m:mn>
                              </m:mrow>
                              <m:mi>N</m:mi>
                           </m:munderover>
                           <m:mrow>
                              <m:mi mathvariant="script">S</m:mi>
                              <m:mo stretchy="false">(</m:mo>
                              <m:msub>
                                 <m:mi>s</m:mi>
                                 <m:mrow>
                                    <m:mo stretchy="false">[</m:mo>
                                    <m:msub>
                                       <m:mi>a</m:mi>
                                       <m:mi>k</m:mi>
                                    </m:msub>
                                    <m:mo>,</m:mo>
                                    <m:msub>
                                       <m:mi>b</m:mi>
                                       <m:mi>k</m:mi>
                                    </m:msub>
                                    <m:mo stretchy="false">]</m:mo>
                                 </m:mrow>
                              </m:msub>
                              <m:mo>,</m:mo>
                              <m:msub>
                                 <m:mi>t</m:mi>
                                 <m:mrow>
                                    <m:mo stretchy="false">[</m:mo>
                                    <m:msub>
                                       <m:mi>c</m:mi>
                                       <m:mi>k</m:mi>
                                    </m:msub>
                                    <m:mo>,</m:mo>
                                    <m:msub>
                                       <m:mi>d</m:mi>
                                       <m:mi>k</m:mi>
                                    </m:msub>
                                    <m:mo stretchy="false">]</m:mo>
                                 </m:mrow>
                              </m:msub>
                              <m:mo stretchy="false">)</m:mo>
                           </m:mrow>
                        </m:mstyle>
                     </m:mrow>
                     <m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaat0uy0HwzTfgDPnwy1egaryqtHrhAL1wy0L2yHvdaiqaacqWFse=ucqGGBbWwcqGGOaakcqGGBbWwcqWGHbqydaWgaaWcbaGaeGymaedabeaakiabcYcaSiabdkgaInaaBaaaleaacqaIXaqmaeqaaOGaeiyxa0LaeiilaWIaei4waSLaem4yam2aaSbaaSqaaiabigdaXaqabaGccqGGSaalcqWGKbazdaWgaaWcbaGaeGymaedabeaakiabc2faDjabcMcaPiabcYcaSiabc6caUiabc6caUiabc6caUiabcYcaSiabcIcaOiabcUfaBjabdggaHnaaBaaaleaacqWGobGtaeqaaOGaeiilaWIaemOyai2aaSbaaSqaaiabd6eaobqabaGccqGGDbqxcqGGSaalcqGGBbWwcqWGJbWydaWgaaWcbaGaemOta4eabeaakiabcYcaSiabdsgaKnaaBaaaleaacqWGobGtaeqaaOGaeiyxa0LaeiykaKIaeiyxa0Laeyypa0ZaaabCaeaacqWFse=ucqGGOaakcqWGZbWCdaWgaaWcbaGaei4waSLaemyyae2aaSbaaWqaaiabdUgaRbqabaWccqGGSaalcqWGIbGydaWgaaadbaGaem4AaSgabeaaliabc2faDbqabaGccqGGSaalcqWG0baDdaWgaaWcbaGaei4waSLaem4yam2aaSbaaWqaaiabdUgaRbqabaWccqGGSaalcqWGKbazdaWgaaadbaGaem4AaSgabeaaliabc2faDbqabaGccqGGPaqkaSqaaiabdUgaRjabg2da9iabigdaXaqaaiabd6eaobqdcqGHris5aaaa@8817@</m:annotation>
                  </m:semantics>
               </m:math>
            </display-formula>
         </p>
         <p>As in classical alignment methods, we will consider in the following only additive scoring schemes, <it>i.e</it>. defined from a <inline-formula><m:math name="1748-7188-2-11-i8" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:mi mathvariant="script">A</m:mi><m:mo>&#215;</m:mo><m:mi mathvariant="script">A</m:mi></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaat0uy0HwzTfgDPnwy1egaryqtHrhAL1wy0L2yHvdaiqaacqWFaeFqcqGHxdaTcqWFaeFqaaa@3BEE@</m:annotation></m:semantics></m:math></inline-formula> substitution matrix <it>&#960;</it>, for all lengthes <it>l </it>and all pairs of sequences (<it>u, v</it>) &#8712; <inline-formula><m:math name="1748-7188-2-11-i3" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:msup><m:mi mathvariant="script">A</m:mi><m:mi>l</m:mi></m:msup></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaat0uy0HwzTfgDPnwy1egaryqtHrhAL1wy0L2yHvdaiqaacqWFaeFqdaahaaWcbeqaaiabdYgaSbaaaaa@39AE@</m:annotation></m:semantics></m:math></inline-formula> &#215; <inline-formula><m:math name="1748-7188-2-11-i3" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:msup><m:mi mathvariant="script">A</m:mi><m:mi>l</m:mi></m:msup></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaat0uy0HwzTfgDPnwy1egaryqtHrhAL1wy0L2yHvdaiqaacqWFaeFqdaahaaWcbeqaaiabdYgaSbaaaaa@39AE@</m:annotation></m:semantics></m:math></inline-formula>, by:</p>
         <p>
            <display-formula>
               <m:math name="1748-7188-2-11-i9" xmlns:m="http://www.w3.org/1998/Math/MathML">
                  <m:semantics>
                     <m:mrow>
                        <m:mi mathvariant="script">S</m:mi>
                        <m:mo stretchy="false">(</m:mo>
                        <m:mi>u</m:mi>
                        <m:mo>,</m:mo>
                        <m:mi>v</m:mi>
                        <m:mo stretchy="false">)</m:mo>
                        <m:mo>=</m:mo>
                        <m:mstyle displaystyle="true">
                           <m:munderover>
                              <m:mo>&#8721;</m:mo>
                              <m:mrow>
                                 <m:mi>j</m:mi>
                                 <m:mo>=</m:mo>
                                 <m:mn>1</m:mn>
                              </m:mrow>
                              <m:mi>l</m:mi>
                           </m:munderover>
                           <m:mrow>
                              <m:msub>
                                 <m:mi>&#960;</m:mi>
                                 <m:mrow>
                                    <m:mo stretchy="false">[</m:mo>
                                    <m:msub>
                                       <m:mi>u</m:mi>
                                       <m:mi>j</m:mi>
                                    </m:msub>
                                    <m:mo>,</m:mo>
                                    <m:msub>
                                       <m:mi>v</m:mi>
                                       <m:mi>j</m:mi>
                                    </m:msub>
                                    <m:mo stretchy="false">]</m:mo>
                                 </m:mrow>
                              </m:msub>
                           </m:mrow>
                        </m:mstyle>
                     </m:mrow>
                     <m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaat0uy0HwzTfgDPnwy1egaryqtHrhAL1wy0L2yHvdaiqaacqWFse=ucqGGOaakcqWG1bqDcqGGSaalcqWG2bGDcqGGPaqkcqGH9aqpdaaeWbqaaGGaciab+b8aWnaaBaaaleaacqGGBbWwcqWG1bqDdaWgaaadbaGaemOAaOgabeaaliabcYcaSiabdAha2naaBaaameaacqWGQbGAaeqaaSGaeiyxa0fabeaaaeaacqWGQbGAcqGH9aqpcqaIXaqmaeaacqWGSbaBa0GaeyyeIuoaaaa@5110@</m:annotation>
                  </m:semantics>
               </m:math>
            </display-formula>
         </p>
         <p>The score of an empty diagonal (<it>l </it>= 0) is 0.</p>
         <p>The maximum of the scores over all the <it>N</it>-maps of <it>s </it>over <it>t </it>is noted <inline-formula><m:math name="1748-7188-2-11-i10" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:msup><m:mi>&#8499;</m:mi><m:mi>N</m:mi></m:msup></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaat0uy0HwzTfgDPnwy1egaryqtHrhAL1wy0L2yHvdaiqaacqWFZestdaahaaWcbeqaaiabd6eaobaaaaa@38E1@</m:annotation></m:semantics></m:math></inline-formula> (<it>s</it>, <it>t</it>):</p>
         <p>
            <display-formula>
               <m:math name="1748-7188-2-11-i11" xmlns:m="http://www.w3.org/1998/Math/MathML">
                  <m:semantics>
                     <m:mrow>
                        <m:msup>
                           <m:mi>&#8499;</m:mi>
                           <m:mi>N</m:mi>
                        </m:msup>
                        <m:mo stretchy="false">(</m:mo>
                        <m:mi>s</m:mi>
                        <m:mo>,</m:mo>
                        <m:mi>t</m:mi>
                        <m:mo stretchy="false">)</m:mo>
                        <m:mo>=</m:mo>
                        <m:munder>
                           <m:mrow>
                              <m:mi>max</m:mi>
                              <m:mo>&#8289;</m:mo>
                           </m:mrow>
                           <m:mrow>
                              <m:mi>&#915;</m:mi>
                              <m:mo>&#8712;</m:mo>
                              <m:msubsup>
                                 <m:mi>&#937;</m:mi>
                                 <m:mrow>
                                    <m:mo stretchy="false">(</m:mo>
                                    <m:mi>s</m:mi>
                                    <m:mo>,</m:mo>
                                    <m:mi>t</m:mi>
                                    <m:mo stretchy="false">)</m:mo>
                                 </m:mrow>
                                 <m:mi>N</m:mi>
                              </m:msubsup>
                           </m:mrow>
                        </m:munder>
                        <m:mi mathvariant="script">S</m:mi>
                        <m:mo stretchy="false">(</m:mo>
                        <m:mi>&#915;</m:mi>
                        <m:mo stretchy="false">)</m:mo>
                     </m:mrow>
                     <m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaat0uy0HwzTfgDPnwy1egaryqtHrhAL1wy0L2yHvdaiqaacqWFZestdaahaaWcbeqaaiabd6eaobaakiabcIcaOiabdohaZjabcYcaSiabdsha0jabcMcaPiabg2da9maaxababaGagiyBa0MaeiyyaeMaeiiEaGhaleaacqqHtoWrcqGHiiIZcqqHPoWvdaqhaaadbaGaeiikaGIaem4CamNaeiilaWIaemiDaqNaeiykaKcabaGaemOta4eaaaWcbeaakiab=jr8tjabcIcaOiabfo5ahjabcMcaPaaa@540B@</m:annotation>
                  </m:semantics>
               </m:math>
            </display-formula>
         </p>
         <p>An <it>optimal N</it>-map of <it>s </it>over <it>t </it>is a <it>N</it>-map with score <inline-formula><m:math name="1748-7188-2-11-i10" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:msup><m:mi>&#8499;</m:mi><m:mi>N</m:mi></m:msup></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaat0uy0HwzTfgDPnwy1egaryqtHrhAL1wy0L2yHvdaiqaacqWFZestdaahaaWcbeqaaiabd6eaobaaaaa@38E1@</m:annotation></m:semantics></m:math></inline-formula> (<it>s</it>, <it>t</it>). By convention, a 0-map is the empty set and <inline-formula><m:math name="1748-7188-2-11-i12" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:msup><m:mi>&#8499;</m:mi><m:mn>0</m:mn></m:msup></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaat0uy0HwzTfgDPnwy1egaryqtHrhAL1wy0L2yHvdaiqaacqWFZestdaahaaWcbeqaaiabicdaWaaaaaa@38AA@</m:annotation></m:semantics></m:math></inline-formula> (<it>s</it>, <it>t</it>) = 0.</p>
         <p>Depending on whether the substitution matrix contains negative values or not, the optimal <it>N</it>-map is said to be local or global. These concepts are used by analogy with the case of alignment. When the matrix contains only non-negative values (global case), a corresponding optimal <it>N</it>-map of <it>s </it>over <it>t </it>will attempt to associate each position of <it>s </it>with a position of <it>t</it>, as in a global alignment. When the matrix contains some negative values (local case), the optimal <it>N</it>-map will be reached by considering only subparts of <it>s </it>which lead to a positive contribution of the total score when associated with a segment of <it>t</it>, once more as in local alignment. Basically, a global <it>N</it>-map of <it>s </it>over <it>t </it>spans the entire length of <it>s </it>(except possibly some boundary positions) while a local <it>N</it>-map identifies <it>N </it>non-overlapping segments of <it>s </it>with maximum scores against <it>t</it>.</p>
         <p>Some pathological situations could arise in the local case. In particular there could be some positions <it>i </it>of <it>s </it>such that <it>&#960; </it>[<it>s</it><sub><it>i</it></sub>, <it>t</it><sub><it>j</it></sub>] is negative for all positions <it>j </it>of <it>t</it>. Without considering empty diagonals, <inline-formula><m:math name="1748-7188-2-11-i10" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:msup><m:mi>&#8499;</m:mi><m:mi>N</m:mi></m:msup></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaat0uy0HwzTfgDPnwy1egaryqtHrhAL1wy0L2yHvdaiqaacqWFZestdaahaaWcbeqaaiabd6eaobaaaaa@38E1@</m:annotation></m:semantics></m:math></inline-formula> (<it>s</it>, <it>t</it>) would be not always growing with <it>N</it>.</p>
         <p>The current software implementation incorporates various substitution matrices in particular for amino acids (PAM, BLOSUM, <it>etc</it>.).</p>
         <p>For handling inversions, which is not allowed by Definition 1, it is first needed to extend this definition by adding a sign to the pair of intervals:</p>
         <p>&#8226; (+, [<it>a</it>, <it>b</it>], [<it>c</it>, <it>d</it>]) means that the positions [(<it>a</it>, <it>c</it>), (<it>a </it>+ 1, <it>c </it>+ 1),...] are associated (normal case),</p>
         <p>&#8226; (-, [<it>a</it>, <it>b</it>], [<it>c</it>, <it>d</it>]) means that the positions [(<it>a</it>, <it>d</it>), (<it>a </it>+ 1, <it>d </it>- 1),...] are associated (inversion case).</p>
         <p>Another required extension concerns the way of calculating the score for "reverse diagonals". This point depends on the nature of sequences. For instance in the case of DNA sequences, the score of (-, [<it>a</it>, <it>b</it>], [<it>c</it>, <it>d</it>]) is computed by summing the individual substitution scores of <it>s</it><sub>[<it>a</it>, <it>b</it>] </sub>against the complementary-reverse of <it>t</it><sub>[<it>c</it>, <it>d</it>]</sub>. If <it>s </it>and <it>t </it>are sequences of genes, this score is obtained by considering <it>s</it><sub>[<it>a</it>, <it>b</it>] </sub>against the reverse of <it>t</it><sub>[<it>c</it>, <it>d</it>]</sub>.</p>
      </sec>
      <sec>
         <st>
            <p>2 Algorithms</p>
         </st>
         <p>Given two sequences <it>s</it>, <it>t </it>and a positive integer <it>N</it>, we address two problems:</p>
         <p>&#8226; <b>Problem 1</b>: computing the optimal scores <inline-formula><m:math name="1748-7188-2-11-i13" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:msup><m:mi>&#8499;</m:mi><m:mi>K</m:mi></m:msup></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaat0uy0HwzTfgDPnwy1egaryqtHrhAL1wy0L2yHvdaiqaacqWFZestdaahaaWcbeqaaiabdUealbaaaaa@38DB@</m:annotation></m:semantics></m:math></inline-formula> (<it>s</it>, <it>t</it>) with <it>K </it>running from 1 to <it>N</it>.</p>
         <p>&#8226; <b>Problem 2</b>: outputting the diagonals of an optimal <it>N</it>-map.</p>
         <sec>
            <st>
               <p>Computing the optimal scores</p>
            </st>
            <p>Let Best<sub>[<it>i</it>, <it>j</it>, <it>K</it>] </sub>be the maximal score obtained by a <it>K</it>-map of <it>s</it><sub>[1, <it>i</it>] </sub>over <it>t ending at </it>(<it>i</it>, <it>j</it>), <it>i.e</it>. such that its last diagonal ([<it>a</it><sub><it>K</it></sub>, <it>b</it><sub><it>K</it></sub>], [<it>c</it><sub><it>K</it></sub>, <it>d</it><sub><it>K</it></sub>]) verifies <it>b</it><sub><it>K </it></sub>= <it>i </it>and <it>d</it><sub><it>K </it></sub>= <it>j</it>. By setting Best<sub>[0, <it>j</it>, <it>K</it>]</sub>, Best<sub>[<it>i</it>, 0 , <it>K</it>] </sub>and Best<sub>[<it>i</it>, <it>j</it>, 0] </sub>to 0 for all integers <it>i</it>, <it>j </it>and <it>K</it>, we have the following recurrence relation:</p>
            <p>
               <display-formula>
                  <m:math name="1748-7188-2-11-i14" xmlns:m="http://www.w3.org/1998/Math/MathML">
                     <m:semantics>
                        <m:mrow>
                           <m:msub>
                              <m:mrow>
                                 <m:mtext>Best</m:mtext>
                              </m:mrow>
                              <m:mrow>
                                 <m:mo stretchy="false">[</m:mo>
                                 <m:mi>i</m:mi>
                                 <m:mo>+</m:mo>
                                 <m:mn>1</m:mn>
                                 <m:mo>,</m:mo>
                                 <m:mi>j</m:mi>
                                 <m:mo>+</m:mo>
                                 <m:mn>1</m:mn>
                                 <m:mo>,</m:mo>
                                 <m:mi>K</m:mi>
                                 <m:mo stretchy="false">]</m:mo>
                              </m:mrow>
                           </m:msub>
                           <m:mo>=</m:mo>
                           <m:msub>
                              <m:mi>&#960;</m:mi>
                              <m:mrow>
                                 <m:mo stretchy="false">[</m:mo>
                                 <m:msub>
                                    <m:mi>s</m:mi>
                                    <m:mrow>
                                       <m:mi>i</m:mi>
                                       <m:mo>+</m:mo>
                                       <m:mn>1</m:mn>
                                    </m:mrow>
                                 </m:msub>
                                 <m:mo>,</m:mo>
                                 <m:msub>
                                    <m:mi>t</m:mi>
                                    <m:mrow>
                                       <m:mi>j</m:mi>
                                       <m:mo>+</m:mo>
                                       <m:mn>1</m:mn>
                                    </m:mrow>
                                 </m:msub>
                                 <m:mo stretchy="false">]</m:mo>
                              </m:mrow>
                           </m:msub>
                           <m:mo>+</m:mo>
                           <m:mi>max</m:mi>
                           <m:mo>&#8289;</m:mo>
                           <m:mrow>
                              <m:mo>{</m:mo>
                              <m:mrow>
                                 <m:mtext>Best</m:mtext>
                                 <m:msub>
                                    <m:malignmark/>
                                    <m:mrow>
                                       <m:mo stretchy="false">[</m:mo>
                                       <m:mi>i</m:mi>
                                       <m:mo>,</m:mo>
                                       <m:mi>j</m:mi>
                                       <m:mo>,</m:mo>
                                       <m:mi>K</m:mi>
                                       <m:mo stretchy="false">]</m:mo>
                                    </m:mrow>
                                 </m:msub>
                                 <m:mo>,</m:mo>
                                 <m:munder>
                                    <m:mrow>
                                       <m:mi>max</m:mi>
                                       <m:mo>&#8289;</m:mo>
                                    </m:mrow>
                                    <m:mrow>
                                       <m:mi>k</m:mi>
                                       <m:mo>&#8804;</m:mo>
                                       <m:mi>i</m:mi>
                                       <m:mo>,</m:mo>
                                       <m:mi>l</m:mi>
                                       <m:mo>&#8804;</m:mo>
                                       <m:mrow>
                                          <m:mo>|</m:mo>
                                          <m:mi>t</m:mi>
                                          <m:mo>|</m:mo>
                                       </m:mrow>
                                    </m:mrow>
                                 </m:munder>
                                 <m:msub>
                                    <m:mrow>
                                       <m:mtext>Best</m:mtext>
                                    </m:mrow>
                                    <m:mrow>
                                       <m:mo stretchy="false">[</m:mo>
                                       <m:mi>k</m:mi>
                                       <m:mo>,</m:mo>
                                       <m:mi>l</m:mi>
                                       <m:mo>,</m:mo>
                                       <m:mi>K</m:mi>
                                       <m:mo>&#8722;</m:mo>
                                       <m:mn>1</m:mn>
                                       <m:mo stretchy="false">]</m:mo>
                                    </m:mrow>
                                 </m:msub>
                              </m:mrow>
                              <m:mo>}</m:mo>
                           </m:mrow>
                           <m:malignmark/>
                        </m:mrow>
                        <m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaacqqGcbGqcqqGLbqzcqqGZbWCcqqG0baDdaWgaaWcbaGaei4waSLaemyAaKMaey4kaSIaeGymaeJaeiilaWIaemOAaOMaey4kaSIaeGymaeJaeiilaWIaem4saSKaeiyxa0fabeaakiabg2da9GGaciab=b8aWnaaBaaaleaacqGGBbWwcqWGZbWCdaWgaaadbaGaemyAaKMaey4kaSIaeGymaedabeaaliabcYcaSiabdsha0naaBaaameaacqWGQbGAcqGHRaWkcqaIXaqmaeqaaSGaeiyxa0fabeaakiabgUcaRiGbc2gaTjabcggaHjabcIha4naacmaabaGaeeOqaiKaeeyzauMaee4CamNaeeiDaqNaaCjaVpaaBaaaleaacqGGBbWwcqWGPbqAcqGGSaalcqWGQbGAcqGGSaalcqWGlbWscqGGDbqxaeqaaOGaeiilaWYaaCbeaeaacyGGTbqBcqGGHbqycqGG4baEaSqaaiabdUgaRjabgsMiJkabdMgaPjabcYcaSiabdYgaSjabgsMiJoaaemaabaGaemiDaqhacaGLhWUaayjcSdaabeaakiabbkeacjabbwgaLjabbohaZjabbsha0naaBaaaleaacqGGBbWwcqWGRbWAcqGGSaalcqWGSbaBcqGGSaalcqWGlbWscqGHsislcqaIXaqmcqGGDbqxaeqaaaGccaGL7bGaayzFaaGaaCjaVdaa@875A@</m:annotation>
                     </m:semantics>
                  </m:math>
               </display-formula>
            </p>
            <p>The correctness of this relation is straightforwardly proved by induction. Let us consider the maximum involved in the right part of this equation. It is equal to:</p>
            <p>&#8226; Best<sub>[<it>i</it>, <it>j</it>, <it>K</it>]</sub>, if the greatest score is obtained by incrementing the length of the last diagonal of an optimal <it>K</it>-map of <it>s</it><sub>[1, <it>i</it>] </sub>over <it>t </it>ending at (<it>i</it>, <it>j</it>) &#8211; then the last diagonal will end at (<it>i </it>+ 1, <it>j </it>+ 1).</p>
            <p>&#8226; <inline-formula><m:math name="1748-7188-2-11-i15" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:munder><m:mrow><m:mi>max</m:mi><m:mo>&#8289;</m:mo></m:mrow><m:mrow><m:mi>k</m:mi><m:mo>&#8804;</m:mo><m:mi>i</m:mi><m:mo>,</m:mo><m:mi>l</m:mi><m:mo>&#8804;</m:mo><m:mi>j</m:mi></m:mrow></m:munder><m:msub><m:mrow><m:mtext>Best</m:mtext></m:mrow><m:mrow><m:mo stretchy="false">[</m:mo><m:mi>k</m:mi><m:mo>,</m:mo><m:mi>l</m:mi><m:mo>,</m:mo><m:mi>K</m:mi><m:mo>&#8722;</m:mo><m:mn>1</m:mn><m:mo stretchy="false">]</m:mo></m:mrow></m:msub></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaadaWfqaqaaiGbc2gaTjabcggaHjabcIha4bWcbaGaem4AaSMaeyizImQaemyAaKMaeiilaWIaemiBaWMaeyizImQaemOAaOgabeaakiabbkeacjabbwgaLjabbohaZjabbsha0naaBaaaleaacqGGBbWwcqWGRbWAcqGGSaalcqWGSbaBcqGGSaalcqWGlbWscqGHsislcqaIXaqmcqGGDbqxaeqaaaaa@4A37@</m:annotation></m:semantics></m:math></inline-formula>, if the greatest score is obtained by adding the diagonal of length 1 ([<it>i </it>+ 1, <it>i </it>+ 1], [<it>j </it>+ 1, <it>j </it>+ 1]) to an optimal (<it>K </it>- 1)-map of <it>s</it><sub>[1, <it>i</it>] </sub>over <it>t</it>.</p>
            <p>To compute the entries of Best referred to the index (<it>i </it>+ 1), we only need to know the entries referred to the index <it>i</it>. Thus computing the optimal scores of all the <it>K</it>-maps of <it>s </it>over <it>t</it>, with <it>K </it>from 1 to <it>N</it>, can be done in <it>O </it>(|<it>s</it>| &#215; |<it>t</it>| &#215; <it>N</it>) time using <it>O </it>(|<it>t</it>| &#215; <it>N</it>) memory space to store the dynamic programming variables. We can introduce now the formal algorithm <b>Alg_1 </b>which solves the problem of computing the optimal scores for global or local <it>N</it>-maps without inversion.</p>
            <p>Algorithm <b>Alg_1 </b>takes as input two sequences <it>s</it>, <it>t </it>and a number of parts <it>N </it>and returns:</p>
            <p>&#8226; B<sub>s </sub>and B<sub>l</sub>, two |<it>t</it>| &#215; <it>N </it>matrices where the entry B<sub>s[<it>j</it>, <it>K</it>] </sub>contains the maximal score of a <it>K</it>-map of <it>s </it>over <it>t </it>ending at (|<it>s</it>|, <it>j</it>) &#8211; with the preceding notations B<sub>s[<it>j</it>, <it>K</it>] </sub>= Best<sub>[|<it>s</it>|, <it>j</it>, <it>K</it>] </sub>&#8211; and the entry B<sub>l[<it>j</it>, <it>K</it>] </sub>stores the length of the last diagonal of a <it>K</it>-map ending at (|<it>s</it>|, <it>j</it>) with score B<sub>s[<it>j</it>, <it>K</it>]</sub>;</p>
            <p>&#8226; M<sub>s </sub>and M<sub>d</sub>, two arrays of size <it>N </it>where the entry M<sub>s[<it>K</it>] </sub>stores the optimal score of a <it>K</it>-map of <it>s </it>over <it>t </it>&#8211; with the preceding notations M<sub>s[<it>K</it>] </sub>= <inline-formula><m:math name="1748-7188-2-11-i13" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:msup><m:mi>&#8499;</m:mi><m:mi>K</m:mi></m:msup></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaat0uy0HwzTfgDPnwy1egaryqtHrhAL1wy0L2yHvdaiqaacqWFZestdaahaaWcbeqaaiabdUealbaaaaa@38DB@</m:annotation></m:semantics></m:math></inline-formula> (<it>s</it>, <it>t</it>) = max<sub><it>q </it>&#8804; |<it>s</it>|, <it>p </it>&#8804; |<it>t</it>| </sub>Best<sub>[<it>q</it>, <it>p</it>, <it>K</it>] </sub>&#8211; and the entry M<sub>d[<it>K</it>] </sub>stores the last diagonal of a <it>K</it>-map with score M<sub>s[<it>K</it>]</sub>.</p>
            <p>The correctness of Algorithm <b>Alg_1 </b>is proved by induction over the positions of <it>s</it>. The time and memory space complexities are straightforwardly analyzed.</p>
            <p>The variables B<sub>l </sub>and M<sub>d </sub>are not involved in the computation of the maximal scores of <it>K</it>-maps for 1 &#8804; <it>K </it>&#8804; <it>N </it>(they will be used by the algorithm in charge of outputting the diagonals). If we are only interested in solving Problem 1, these variables as well as the lines 7, 10, 14 and 19 can be deleted. Algorithm <b>Alg_1 </b>will still return the optimal scores of <it>K</it>-maps with 0 &#8804; <it>K </it>&#8804; <it>N </it>in the array M<sub>s</sub>.</p>
            <p><b>Algorithm 1 Alg_1 </b>(<it>s</it>, <it>t</it>, <it>N</it>, B<sub>s</sub>, B<sub>l</sub>, M<sub>s</sub>, M<sub>d</sub>)</p>
            <p>1: B<sub>s[<it>j</it>, <it>K</it>] </sub>&#8592; 0 ; B<sub>l[<it>j</it>, <it>K</it>] </sub>&#8592; 0 ; M<sub>s[<it>K</it>] </sub>&#8592; 0 ; M<sub>d[<it>K</it>] </sub>&#8592; NULL ; (<it>j </it>= 0 ... |<it>t</it>|, <it>K </it>= 0 ... <it>N</it>)</p>
            <p>2: <b>for </b><it>i </it>= 1 <b>to </b>|<it>s</it>| <b>do</b></p>
            <p>3:&#160;&#160;&#160;<b>for </b><it>j </it>= 1 <b>to </b>|<it>t</it>| <b>do</b></p>
            <p>4:&#160;&#160;&#160;&#160;&#160;&#160;<b>for </b><it>K </it>= <it>N </it><b>to </b>1 <b>do</b></p>
            <p>5:&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<b>if </b>B<sub>s[<it>j</it>-1, <it>K</it>] </sub>&#8805; M<sub>s[<it>k</it>-1] </sub><b>then</b></p>
            <p>6:&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<inline-formula><m:math name="1748-7188-2-11-i16" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:msub><m:msup><m:mtext>B</m:mtext><m:mo>&#8242;</m:mo></m:msup><m:mrow><m:mtext>s</m:mtext><m:mo stretchy="false">[</m:mo><m:mi>j</m:mi><m:mo>,</m:mo><m:mi>K</m:mi><m:mo stretchy="false">]</m:mo></m:mrow></m:msub></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaacuqGcbGqgaqbamaaBaaaleaacqqGZbWCcqGGBbWwcqWGQbGAcqGGSaalcqWGlbWscqGGDbqxaeqaaaaa@3538@</m:annotation></m:semantics></m:math></inline-formula> &#8592; <it>&#960;</it><sub>[<it>s</it><sub><it>i</it></sub>, <it>t</it><sub><it>j</it></sub>] </sub>+ B<sub>s[<it>j</it>-1, <it>K</it>] </sub>;</p>
            <p>7:&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<inline-formula><m:math name="1748-7188-2-11-i17" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:msub><m:msup><m:mtext>B</m:mtext><m:mo>&#8242;</m:mo></m:msup><m:mrow><m:mtext>l</m:mtext><m:mo stretchy="false">[</m:mo><m:mi>j</m:mi><m:mo>,</m:mo><m:mi>K</m:mi><m:mo stretchy="false">]</m:mo></m:mrow></m:msub></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaacuqGcbGqgaqbamaaBaaaleaacqqGSbaBcqGGBbWwcqWGQbGAcqGGSaalcqWGlbWscqGGDbqxaeqaaaaa@352A@</m:annotation></m:semantics></m:math></inline-formula> &#8592; B<sub>l[<it>j</it>-1, <it>K</it>] </sub>+ 1 ;</p>
            <p>8:&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<b>else</b></p>
            <p>9:&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<inline-formula><m:math name="1748-7188-2-11-i16" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:msub><m:msup><m:mtext>B</m:mtext><m:mo>&#8242;</m:mo></m:msup><m:mrow><m:mtext>s</m:mtext><m:mo stretchy="false">[</m:mo><m:mi>j</m:mi><m:mo>,</m:mo><m:mi>K</m:mi><m:mo stretchy="false">]</m:mo></m:mrow></m:msub></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaacuqGcbGqgaqbamaaBaaaleaacqqGZbWCcqGGBbWwcqWGQbGAcqGGSaalcqWGlbWscqGGDbqxaeqaaaaa@3538@</m:annotation></m:semantics></m:math></inline-formula> &#8592; <it>&#960;</it><sub>[<it>s</it><sub><it>i</it></sub>, <it>t</it><sub><it>j</it></sub>] </sub>+ M<sub>s[<it>K</it>-1] </sub>;</p>
            <p>10:&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<inline-formula><m:math name="1748-7188-2-11-i17" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:msub><m:msup><m:mtext>B</m:mtext><m:mo>&#8242;</m:mo></m:msup><m:mrow><m:mtext>l</m:mtext><m:mo stretchy="false">[</m:mo><m:mi>j</m:mi><m:mo>,</m:mo><m:mi>K</m:mi><m:mo stretchy="false">]</m:mo></m:mrow></m:msub></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaacuqGcbGqgaqbamaaBaaaleaacqqGSbaBcqGGBbWwcqWGQbGAcqGGSaalcqWGlbWscqGGDbqxaeqaaaaa@352A@</m:annotation></m:semantics></m:math></inline-formula> &#8592; 1;</p>
            <p>11:&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<b>end if</b></p>
            <p>12:&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<b>if </b><inline-formula><m:math name="1748-7188-2-11-i16" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:msub><m:msup><m:mtext>B</m:mtext><m:mo>&#8242;</m:mo></m:msup><m:mrow><m:mtext>s</m:mtext><m:mo stretchy="false">[</m:mo><m:mi>j</m:mi><m:mo>,</m:mo><m:mi>K</m:mi><m:mo stretchy="false">]</m:mo></m:mrow></m:msub></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaacuqGcbGqgaqbamaaBaaaleaacqqGZbWCcqGGBbWwcqWGQbGAcqGGSaalcqWGlbWscqGGDbqxaeqaaaaa@3538@</m:annotation></m:semantics></m:math></inline-formula> &#8805; M<sub>s[<it>K</it>] </sub><b>then</b></p>
            <p>13:&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;M<sub>s[<it>K</it>] </sub>&#8592; <inline-formula><m:math name="1748-7188-2-11-i16" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:msub><m:msup><m:mtext>B</m:mtext><m:mo>&#8242;</m:mo></m:msup><m:mrow><m:mtext>s</m:mtext><m:mo stretchy="false">[</m:mo><m:mi>j</m:mi><m:mo>,</m:mo><m:mi>K</m:mi><m:mo stretchy="false">]</m:mo></m:mrow></m:msub></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaacuqGcbGqgaqbamaaBaaaleaacqqGZbWCcqGGBbWwcqWGQbGAcqGGSaalcqWGlbWscqGGDbqxaeqaaaaa@3538@</m:annotation></m:semantics></m:math></inline-formula> ;</p>
            <p>14:&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;M<sub>d[<it>K</it>] </sub>&#8592; ([<it>i </it>- <inline-formula><m:math name="1748-7188-2-11-i17" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:msub><m:msup><m:mtext>B</m:mtext><m:mo>&#8242;</m:mo></m:msup><m:mrow><m:mtext>l</m:mtext><m:mo stretchy="false">[</m:mo><m:mi>j</m:mi><m:mo>,</m:mo><m:mi>K</m:mi><m:mo stretchy="false">]</m:mo></m:mrow></m:msub></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaacuqGcbGqgaqbamaaBaaaleaacqqGSbaBcqGGBbWwcqWGQbGAcqGGSaalcqWGlbWscqGGDbqxaeqaaaaa@352A@</m:annotation></m:semantics></m:math></inline-formula> + 1, <it>i</it>], [<it>j </it>- <inline-formula><m:math name="1748-7188-2-11-i17" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:msub><m:msup><m:mtext>B</m:mtext><m:mo>&#8242;</m:mo></m:msup><m:mrow><m:mtext>l</m:mtext><m:mo stretchy="false">[</m:mo><m:mi>j</m:mi><m:mo>,</m:mo><m:mi>K</m:mi><m:mo stretchy="false">]</m:mo></m:mrow></m:msub></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaacuqGcbGqgaqbamaaBaaaleaacqqGSbaBcqGGBbWwcqWGQbGAcqGGSaalcqWGlbWscqGGDbqxaeqaaaaa@352A@</m:annotation></m:semantics></m:math></inline-formula> + 1, <it>j</it>]) ;</p>
            <p>15:&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<b>end if</b></p>
            <p>16:&#160;&#160;&#160;&#160;&#160;&#160;<b>end for</b></p>
            <p>17:&#160;&#160;&#160;<b>end for</b></p>
            <p>18:&#160;&#160;&#160;<b>swap </b>(B<sub>s</sub>, <inline-formula><m:math name="1748-7188-2-11-i18" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:msub><m:msup><m:mtext>B</m:mtext><m:mo>&#8242;</m:mo></m:msup><m:mtext>s</m:mtext></m:msub></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaacuqGcbGqgaqbamaaBaaaleaacqqGZbWCaeqaaaaa@2F5C@</m:annotation></m:semantics></m:math></inline-formula>) ;</p>
            <p>19:&#160;&#160;&#160;<b>swap </b>(B<sub>l</sub>, <inline-formula><m:math name="1748-7188-2-11-i19" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:msub><m:msup><m:mtext>B</m:mtext><m:mo>&#8242;</m:mo></m:msup><m:mtext>l</m:mtext></m:msub></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaacuqGcbGqgaqbamaaBaaaleaacqqGSbaBaeqaaaaa@2F4E@</m:annotation></m:semantics></m:math></inline-formula>) ;</p>
            <p>20: <b>end for</b></p>
            <p><b>Theorem 1 </b><it>Algorithm </it><b>Alg_1 </b><it>computes the optimal score of the K-maps of a sequence s over a sequence t, for K from </it>1 <it>to N, in time O </it>(|<it>s</it>| &#215; |<it>t</it>| &#215; <it>N</it>) <it>using O </it>(|<it>s</it>| + |<it>t</it>| &#215; <it>N</it>) <it>memory space</it>.</p>
         </sec>
         <sec>
            <st>
               <p>Outputting the diagonals of an optimal <it>N</it>-map</p>
            </st>
            <p>Before presenting the formal algorithm, we need to introduce some additional notations and results about "dividing maps".</p>
            <p>We say that a position <it>m </it>of <it>s </it>is <it>inside a diagonal </it>of a <it>N</it>-map &#915; if there is a diagonal ([<it>a</it>, <it>b</it>], [<it>c</it>, <it>d</it>]) &#8712; &#915; such that <it>a </it>&#8804; <it>m </it>&lt;<it>b </it>(Figure <figr fid="F2">2a</figr>). This notion excludes two cases:</p>
            <p>1. when <it>m </it>is not contained by any diagonal (this is usual with local <it>N</it>-maps),</p>
            <p>2. when a diagonal is exactly ending at <it>m </it>in its first interval.</p>
            <p>We denote as <inline-formula><m:math name="1748-7188-2-11-i20" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:msub><m:mrow><m:mover accent="true"><m:mrow><m:mtext>Best</m:mtext></m:mrow><m:mo stretchy="true">&#175;</m:mo></m:mover></m:mrow><m:mrow><m:mo stretchy="false">[</m:mo><m:mi>i</m:mi><m:mo>,</m:mo><m:mi>j</m:mi><m:mo>,</m:mo><m:mi>K</m:mi><m:mo stretchy="false">]</m:mo></m:mrow></m:msub></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaadaqdaaqaaiabbkeacjabbwgaLjabbohaZjabbsha0baadaWgaaWcbaGaei4waSLaemyAaKMaeiilaWIaemOAaOMaeiilaWIaem4saSKaeiyxa0fabeaaaaa@3A38@</m:annotation></m:semantics></m:math></inline-formula> the maximal score obtained by a <it>K</it>-map of <it>s</it><sub>[<it>i</it>,|<it>s</it>|] </sub>over <it>t</it><sub>[<it>j</it>,|<it>t</it>|] </sub><it>starting at </it>(<it>i</it>, <it>j</it>), <it>i.e</it>. such that its first diagonal ([<it>a</it><sub>1</sub>, <it>b</it><sub>1</sub>], [<it>c</it><sub>1</sub>, <it>d</it><sub>1</sub>]) verifies <it>a</it><sub>1 </sub>= <it>i </it>and <it>c</it><sub>1 </sub>= <it>j</it>.</p>
            <p><b>Lemma 1 </b><it>Let s and t be two sequences, m a position of s and N a positive integer. The optimal score of a N-map </it><inline-formula><m:math name="1748-7188-2-11-i10" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:msup><m:mi>&#8499;</m:mi><m:mi>N</m:mi></m:msup></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaat0uy0HwzTfgDPnwy1egaryqtHrhAL1wy0L2yHvdaiqaacqWFZestdaahaaWcbeqaaiabd6eaobaaaaa@38E1@</m:annotation></m:semantics></m:math></inline-formula> (<it>s</it>, <it>t</it>) <it>is equal to the maximum of the two following quantities:</it></p>
            <p>
               <display-formula>&#8226; <m:math name="1748-7188-2-11-i21" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:msub><m:mi mathvariant="script">Q</m:mi><m:mn>1</m:mn></m:msub><m:mo>=</m:mo><m:munder><m:mrow><m:mi>max</m:mi><m:mo>&#8289;</m:mo></m:mrow><m:mrow><m:mn>1</m:mn><m:mo>&#8804;</m:mo><m:mi>K</m:mi><m:mo>&#8804;</m:mo><m:mi>N</m:mi><m:mo>;</m:mo><m:mn>1</m:mn><m:mo>&#8804;</m:mo><m:mi>p</m:mi><m:mo>&lt;</m:mo><m:mrow><m:mo>|</m:mo><m:mi>t</m:mi><m:mo>|</m:mo></m:mrow></m:mrow></m:munder><m:mo>{</m:mo><m:msub><m:mrow><m:mtext>Best</m:mtext></m:mrow><m:mrow><m:mo stretchy="false">[</m:mo><m:mi>m</m:mi><m:mo>,</m:mo><m:mi>p</m:mi><m:mo>,</m:mo><m:mi>K</m:mi><m:mo stretchy="false">]</m:mo></m:mrow></m:msub><m:mo>+</m:mo><m:msub><m:mrow><m:mover accent="true"><m:mrow><m:mtext>Best</m:mtext></m:mrow><m:mo stretchy="true">&#175;</m:mo></m:mover></m:mrow><m:mrow><m:mo stretchy="false">[</m:mo><m:mi>m</m:mi><m:mo>+</m:mo><m:mn>1</m:mn><m:mo>,</m:mo><m:mi>p</m:mi><m:mo>+</m:mo><m:mn>1</m:mn><m:mo>,</m:mo><m:mi>N</m:mi><m:mo>&#8722;</m:mo><m:mi>K</m:mi><m:mo>+</m:mo><m:mn>1</m:mn><m:mo stretchy="false">]</m:mo></m:mrow></m:msub><m:mo>}</m:mo></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaat0uy0HwzTfgDPnwy1egaryqtHrhAL1wy0L2yHvdaiqaacqWFqeFudaWgaaWcbaGaeGymaedabeaakiabg2da9maaxababaGagiyBa0MaeiyyaeMaeiiEaGhaleaacqaIXaqmcqGHKjYOcqWGlbWscqGHKjYOcqWGobGtcqGG7aWocqaIXaqmcqGHKjYOcqWGWbaCcqGH8aapdaabdaqaaiabdsha0bGaay5bSlaawIa7aaqabaGccqGG7bWEcqqGcbGqcqqGLbqzcqqGZbWCcqqG0baDdaWgaaWcbaGaei4waSLaemyBa0MaeiilaWIaemiCaaNaeiilaWIaem4saSKaeiyxa0fabeaakiabgUcaRmaanaaabaGaeeOqaiKaeeyzauMaee4CamNaeeiDaqhaamaaBaaaleaacqGGBbWwcqWGTbqBcqGHRaWkcqaIXaqmcqGGSaalcqWGWbaCcqGHRaWkcqaIXaqmcqGGSaalcqWGobGtcqGHsislcqWGlbWscqGHRaWkcqaIXaqmcqGGDbqxaeqaaOGaeiyFa0haaa@76C3@</m:annotation></m:semantics></m:math></display-formula>
            </p>
            <p>
               <display-formula>&#8226; <m:math name="1748-7188-2-11-i22" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:msub><m:mi mathvariant="script">Q</m:mi><m:mn>2</m:mn></m:msub><m:mo>=</m:mo><m:munder><m:mrow><m:mi>max</m:mi><m:mo>&#8289;</m:mo></m:mrow><m:mrow><m:mn>1</m:mn><m:mo>&#8804;</m:mo><m:mi>K</m:mi><m:mo>&#8804;</m:mo><m:mi>N</m:mi></m:mrow></m:munder><m:mo>{</m:mo><m:msup><m:mi>&#8499;</m:mi><m:mi>K</m:mi></m:msup><m:mo stretchy="false">(</m:mo><m:msub><m:mi>s</m:mi><m:mrow><m:mo stretchy="false">[</m:mo><m:mn>1</m:mn><m:mo>,</m:mo><m:mi>m</m:mi><m:mo stretchy="false">]</m:mo></m:mrow></m:msub><m:mo>,</m:mo><m:mi>t</m:mi><m:mo stretchy="false">)</m:mo><m:mo>+</m:mo><m:msup><m:mi>&#8499;</m:mi><m:mrow><m:mi>N</m:mi><m:mo>&#8722;</m:mo><m:mi>K</m:mi></m:mrow></m:msup><m:mo stretchy="false">(</m:mo><m:msub><m:mi>s</m:mi><m:mrow><m:mo stretchy="false">[</m:mo><m:mi>m</m:mi><m:mo>+</m:mo><m:mn>1</m:mn><m:mo>,</m:mo><m:mo>|</m:mo><m:mi>s</m:mi><m:mo>|</m:mo><m:mo stretchy="false">]</m:mo></m:mrow></m:msub><m:mo>,</m:mo><m:mi>t</m:mi><m:mo stretchy="false">)</m:mo><m:mo>}</m:mo></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaat0uy0HwzTfgDPnwy1egaryqtHrhAL1wy0L2yHvdaiqaacqWFqeFudaWgaaWcbaGaeGOmaidabeaakiabg2da9maaxababaGagiyBa0MaeiyyaeMaeiiEaGhaleaacqaIXaqmcqGHKjYOcqWGlbWscqGHKjYOcqWGobGtaeqaaOGaei4EaSNae83mH00aaWbaaSqabeaaieGacqGFlbWsaaGccqGGOaakcqWGZbWCdaWgaaWcbaGaei4waSLaeGymaeJaeiilaWIaemyBa0Maeiyxa0fabeaakiabcYcaSiabdsha0jabcMcaPiabgUcaRiab=ntinnaaCaaaleqabaGaemOta4KaeyOeI0Iaem4saSeaaOGaeiikaGIaem4Cam3aaSbaaSqaaiabcUfaBjabd2gaTjabgUcaRiabigdaXiabcYcaSiabcYha8jabdohaZjabcYha8jabc2faDbqabaGccqGGSaalcqWG0baDcqGGPaqkcqGG9bqFaaa@6C6E@</m:annotation></m:semantics></m:math></display-formula>
            </p>
            <p><b>Proof: </b>Let &#915; = [([<it>a</it><sub>1</sub>, <it>b</it><sub>1</sub>], [<it>c</it><sub>1</sub>, <it>d</it><sub>1</sub>]), ..., ([<it>a</it><sub><it>N</it></sub>, <it>b</it><sub><it>N</it></sub>], [<it>c</it><sub><it>N</it></sub>, <it>d</it><sub><it>N</it></sub>])] be a <it>N</it>-map of <it>s </it>over <it>t </it>with score <inline-formula><m:math name="1748-7188-2-11-i10" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:msup><m:mi>&#8499;</m:mi><m:mi>N</m:mi></m:msup></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaat0uy0HwzTfgDPnwy1egaryqtHrhAL1wy0L2yHvdaiqaacqWFZestdaahaaWcbeqaaiabd6eaobaaaaa@38E1@</m:annotation></m:semantics></m:math></inline-formula> (<it>s</it>, <it>t</it>). There are two possibilities: either the position <it>m </it>is inside a diagonal <it>K </it>of &#915;, or not. In the first case, there are a <it>K</it>-map &#915;<it>' </it>ending at [<it>m</it>, <it>c</it><sub><it>K </it></sub>+ <it>m </it>- <it>a</it><sub><it>K</it></sub>] and a (<it>N </it>- <it>K </it>+ 1)-map &#915;<it>" </it>starting at position [<it>m </it>+ 1, <it>c</it><sub><it>K </it></sub>+ <it>m </it>- <it>a</it><sub><it>K </it></sub>+ 1] such that <inline-formula><m:math name="1748-7188-2-11-i23" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:mi mathvariant="script">S</m:mi><m:mo stretchy="false">(</m:mo><m:msup><m:mi>&#915;</m:mi><m:mo>&#8242;</m:mo></m:msup><m:mo stretchy="false">)</m:mo><m:mo>+</m:mo><m:mi mathvariant="script">S</m:mi><m:mo stretchy="false">(</m:mo><m:msup><m:mi>&#915;</m:mi><m:mo>&#8243;</m:mo></m:msup><m:mo stretchy="false">)</m:mo><m:mo>=</m:mo><m:msup><m:mi>&#8499;</m:mi><m:mi>N</m:mi></m:msup><m:mo stretchy="false">(</m:mo><m:mi>s</m:mi><m:mo>,</m:mo><m:mi>t</m:mi><m:mo stretchy="false">)</m:mo></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaat0uy0HwzTfgDPnwy1egaryqtHrhAL1wy0L2yHvdaiqaacqWFse=ucqGGOaakcuqHtoWrgaqbaiabcMcaPiabgUcaRiab=jr8tjabcIcaOiqbfo5ahzaagaGaeiykaKIaeyypa0Jae83mH00aaWbaaSqabeaacqWGobGtaaGccqGGOaakcqWGZbWCcqGGSaalcqWG0baDcqGGPaqkaaa@4A48@</m:annotation></m:semantics></m:math></inline-formula>, which implies <inline-formula><m:math name="1748-7188-2-11-i24" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:msup><m:mi>&#8499;</m:mi><m:mi>N</m:mi></m:msup><m:mo stretchy="false">(</m:mo><m:mi>s</m:mi><m:mo>,</m:mo><m:mi>t</m:mi><m:mo stretchy="false">)</m:mo><m:mo>&#8804;</m:mo><m:msub><m:mi mathvariant="script">Q</m:mi><m:mn>1</m:mn></m:msub></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaat0uy0HwzTfgDPnwy1egaryqtHrhAL1wy0L2yHvdaiqaacqWFZestdaahaaWcbeqaaiabd6eaobaakiabcIcaOiabdohaZjabcYcaSiabdsha0jabcMcaPiabgsMiJkab=br8rnaaBaaaleaacqaIXaqmaeqaaaaa@4305@</m:annotation></m:semantics></m:math></inline-formula>. In the second case, let <it>K </it>be such that <it>m </it>= <it>b</it><sub><it>K </it></sub>or <it>b</it><sub><it>K </it></sub>&lt;<it>m </it>&lt;<it>a</it><sub><it>K</it>+1</sub>. There is a <it>K</it>-map &#915;<it>' </it>of <it>s</it><sub>[1, <it>m</it>] </sub>over <it>t </it>and a (<it>N </it>- <it>K</it>)-map &#915;<it>" </it>of <it>s</it><sub>[<it>m</it>+1,|<it>s</it>|] </sub>over <it>t </it>such that <inline-formula><m:math name="1748-7188-2-11-i23" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:mi mathvariant="script">S</m:mi><m:mo stretchy="false">(</m:mo><m:msup><m:mi>&#915;</m:mi><m:mo>&#8242;</m:mo></m:msup><m:mo stretchy="false">)</m:mo><m:mo>+</m:mo><m:mi mathvariant="script">S</m:mi><m:mo stretchy="false">(</m:mo><m:msup><m:mi>&#915;</m:mi><m:mo>&#8243;</m:mo></m:msup><m:mo stretchy="false">)</m:mo><m:mo>=</m:mo><m:msup><m:mi>&#8499;</m:mi><m:mi>N</m:mi></m:msup><m:mo stretchy="false">(</m:mo><m:mi>s</m:mi><m:mo>,</m:mo><m:mi>t</m:mi><m:mo stretchy="false">)</m:mo></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaat0uy0HwzTfgDPnwy1egaryqtHrhAL1wy0L2yHvdaiqaacqWFse=ucqGGOaakcuqHtoWrgaqbaiabcMcaPiabgUcaRiab=jr8tjabcIcaOiqbfo5ahzaagaGaeiykaKIaeyypa0Jae83mH00aaWbaaSqabeaacqWGobGtaaGccqGGOaakcqWGZbWCcqGGSaalcqWG0baDcqGGPaqkaaa@4A48@</m:annotation></m:semantics></m:math></inline-formula>, which implies <inline-formula><m:math name="1748-7188-2-11-i25" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:msup><m:mi>&#8499;</m:mi><m:mi>N</m:mi></m:msup><m:mo stretchy="false">(</m:mo><m:mi>s</m:mi><m:mo>,</m:mo><m:mi>t</m:mi><m:mo stretchy="false">)</m:mo><m:mo>&#8804;</m:mo><m:msub><m:mi mathvariant="script">Q</m:mi><m:mn>2</m:mn></m:msub></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaat0uy0HwzTfgDPnwy1egaryqtHrhAL1wy0L2yHvdaiqaacqWFZestdaahaaWcbeqaaiabd6eaobaakiabcIcaOiabdohaZjabcYcaSiabdsha0jabcMcaPiabgsMiJkab=br8rnaaBaaaleaacqaIYaGmaeqaaaaa@4307@</m:annotation></m:semantics></m:math></inline-formula>. In both cases, <inline-formula><m:math name="1748-7188-2-11-i10" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:msup><m:mi>&#8499;</m:mi><m:mi>N</m:mi></m:msup></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaat0uy0HwzTfgDPnwy1egaryqtHrhAL1wy0L2yHvdaiqaacqWFZestdaahaaWcbeqaaiabd6eaobaaaaa@38E1@</m:annotation></m:semantics></m:math></inline-formula> (<it>s</it>, <it>t</it>) is smaller than max{<inline-formula><m:math name="1748-7188-2-11-i26" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:msub><m:mi mathvariant="script">Q</m:mi><m:mn>1</m:mn></m:msub><m:mo>,</m:mo><m:msub><m:mi mathvariant="script">Q</m:mi><m:mn>2</m:mn></m:msub></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaat0uy0HwzTfgDPnwy1egaryqtHrhAL1wy0L2yHvdaiqaacqWFqeFudaWgaaWcbaGaeGymaedabeaakiabcYcaSiab=br8rnaaBaaaleaacqaIYaGmaeqaaaaa@3D3B@</m:annotation></m:semantics></m:math></inline-formula>}.</p>
            <p>On the other hand, for all integers 1 &#8804; <it>K </it>&#8804; <it>N</it>, for all positions 1 &#8804; <it>p </it>&lt; |<it>t</it>|, for all <it>K</it>-maps <inline-formula><m:math name="1748-7188-2-11-i27" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:msup><m:mi>&#915;</m:mi><m:mo>&#8242;</m:mo></m:msup><m:mo>=</m:mo><m:mo stretchy="false">[</m:mo><m:mo stretchy="false">(</m:mo><m:mo stretchy="false">[</m:mo><m:msub><m:msup><m:mi>a</m:mi><m:mo>&#8242;</m:mo></m:msup><m:mn>1</m:mn></m:msub><m:mo>,</m:mo><m:msub><m:msup><m:mi>b</m:mi><m:mo>&#8242;</m:mo></m:msup><m:mn>1</m:mn></m:msub><m:mo stretchy="false">]</m:mo><m:mo>,</m:mo><m:mo stretchy="false">[</m:mo><m:msub><m:msup><m:mi>c</m:mi><m:mo>&#8242;</m:mo></m:msup><m:mn>1</m:mn></m:msub><m:mo>,</m:mo><m:msub><m:msup><m:mi>d</m:mi><m:mo>&#8242;</m:mo></m:msup><m:mn>1</m:mn></m:msub><m:mo stretchy="false">]</m:mo><m:mo stretchy="false">)</m:mo><m:mo>,</m:mo><m:mn>...</m:mn><m:mo>,</m:mo><m:mo stretchy="false">(</m:mo><m:mo stretchy="false">[</m:mo><m:msub><m:msup><m:mi>a</m:mi><m:mo>&#8242;</m:mo></m:msup><m:mi>K</m:mi></m:msub><m:mo>,</m:mo><m:mi>m</m:mi><m:mo stretchy="false">]</m:mo><m:mo>,</m:mo><m:mo stretchy="false">[</m:mo><m:msub><m:msup><m:mi>c</m:mi><m:mo>&#8242;</m:mo></m:msup><m:mi>K</m:mi></m:msub><m:mo>,</m:mo><m:mi>p</m:mi><m:mo stretchy="false">]</m:mo><m:mo stretchy="false">)</m:mo><m:mo stretchy="false">]</m:mo></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaacuqHtoWrgaqbaiabg2da9iabcUfaBjabcIcaOiabcUfaBjqbdggaHzaafaWaaSbaaSqaaiabigdaXaqabaGccqGGSaalcuWGIbGygaqbamaaBaaaleaacqaIXaqmaeqaaOGaeiyxa0LaeiilaWIaei4waSLafm4yamMbauaadaWgaaWcbaGaeGymaedabeaakiabcYcaSiqbdsgaKzaafaWaaSbaaSqaaiabigdaXaqabaGccqGGDbqxcqGGPaqkcqGGSaalcqGGUaGlcqGGUaGlcqGGUaGlcqGGSaalcqGGOaakcqGGBbWwcuWGHbqygaqbamaaBaaaleaacqWGlbWsaeqaaOGaeiilaWIaemyBa0Maeiyxa0LaeiilaWIaei4waSLafm4yamMbauaadaWgaaWcbaGaem4saSeabeaakiabcYcaSiabdchaWjabc2faDjabcMcaPiabc2faDbaa@5ADE@</m:annotation></m:semantics></m:math></inline-formula> and for all (<it>N </it>- <it>K </it>+ 1)-maps <inline-formula><m:math name="1748-7188-2-11-i28" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:msup><m:mi>&#915;</m:mi><m:mo>&#8243;</m:mo></m:msup><m:mo>=</m:mo><m:mo stretchy="false">[</m:mo><m:mo stretchy="false">(</m:mo><m:mo stretchy="false">[</m:mo><m:mi>m</m:mi><m:mo>+</m:mo><m:mn>1</m:mn><m:mo>,</m:mo><m:msub><m:msup><m:mi>b</m:mi><m:mo>&#8243;</m:mo></m:msup><m:mn>1</m:mn></m:msub><m:mo stretchy="false">]</m:mo><m:mo>,</m:mo><m:mo stretchy="false">[</m:mo><m:mi>p</m:mi><m:mo>+</m:mo><m:mn>1</m:mn><m:mo>,</m:mo><m:msub><m:msup><m:mi>d</m:mi><m:mo>&#8243;</m:mo></m:msup><m:mn>1</m:mn></m:msub><m:mo stretchy="false">]</m:mo><m:mo stretchy="false">)</m:mo><m:mo>,</m:mo><m:mn>...</m:mn><m:mo>,</m:mo><m:mo stretchy="false">(</m:mo><m:mo stretchy="false">[</m:mo><m:msub><m:msup><m:mi>a</m:mi><m:mo>&#8243;</m:mo></m:msup><m:mrow><m:mi>N</m:mi><m:mo>&#8722;</m:mo><m:mi>K</m:mi><m:mo>+</m:mo><m:mn>1</m:mn></m:mrow></m:msub><m:mo>,</m:mo><m:msub><m:msup><m:mi>b</m:mi><m:mo>&#8243;</m:mo></m:msup><m:mrow><m:mi>N</m:mi><m:mo>&#8722;</m:mo><m:mi>K</m:mi><m:mo>+</m:mo><m:mn>1</m:mn></m:mrow></m:msub><m:mo stretchy="false">]</m:mo><m:mo>,</m:mo><m:mo stretchy="false">[</m:mo><m:msub><m:msup><m:mi>c</m:mi><m:mo>&#8243;</m:mo></m:msup><m:mrow><m:mi>N</m:mi><m:mo>&#8722;</m:mo><m:mi>K</m:mi><m:mo>+</m:mo><m:mn>1</m:mn></m:mrow></m:msub><m:mo>,</m:mo><m:msub><m:msup><m:mi>d</m:mi><m:mo>&#8243;</m:mo></m:msup><m:mrow><m:mi>N</m:mi><m:mo>&#8722;</m:mo><m:mi>K</m:mi><m:mo>+</m:mo><m:mn>1</m:mn></m:mrow></m:msub><m:mo stretchy="false">]</m:mo><m:mo stretchy="false">)</m:mo><m:mo stretchy="false">]</m:mo></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaacuqHtoWrgaGbaiabg2da9iabcUfaBjabcIcaOiabcUfaBjabd2gaTjabgUcaRiabigdaXiabcYcaSiqbdkgaIzaagaWaaSbaaSqaaiabigdaXaqabaGccqGGDbqxcqGGSaalcqGGBbWwcqWGWbaCcqGHRaWkcqaIXaqmcqGGSaalcuWGKbazgaGbamaaBaaaleaacqaIXaqmaeqaaOGaeiyxa0LaeiykaKIaeiilaWIaeiOla4IaeiOla4IaeiOla4IaeiilaWIaeiikaGIaei4waSLafmyyaeMbayaadaWgaaWcbaGaemOta4KaeyOeI0Iaem4saSKaey4kaSIaeGymaedabeaakiabcYcaSiqbdkgaIzaagaWaaSbaaSqaaiabd6eaojabgkHiTiabdUealjabgUcaRiabigdaXaqabaGccqGGDbqxcqGGSaalcqGGBbWwcuWGJbWygaGbamaaBaaaleaacqWGobGtcqGHsislcqWGlbWscqGHRaWkcqaIXaqmaeqaaOGaeiilaWIafmizaqMbayaadaWgaaWcbaGaemOta4KaeyOeI0Iaem4saSKaey4kaSIaeGymaedabeaakiabc2faDjabcMcaPiabc2faDbaa@6E7B@</m:annotation></m:semantics></m:math></inline-formula> the <it>N</it>-map <inline-formula><m:math name="1748-7188-2-11-i29" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:mi>&#915;</m:mi><m:mo>=</m:mo><m:mo stretchy="false">[</m:mo><m:mo stretchy="false">(</m:mo><m:mo stretchy="false">[</m:mo><m:msub><m:msup><m:mi>a</m:mi><m:mo>&#8242;</m:mo></m:msup><m:mn>1</m:mn></m:msub><m:mo>,</m:mo><m:msub><m:msup><m:mi>b</m:mi><m:mo>&#8242;</m:mo></m:msup><m:mn>1</m:mn></m:msub><m:mo stretchy="false">]</m:mo><m:mo>,</m:mo><m:mo stretchy="false">[</m:mo><m:msub><m:msup><m:mi>c</m:mi><m:mo>&#8242;</m:mo></m:msup><m:mn>1</m:mn></m:msub><m:mo>,</m:mo><m:msub><m:msup><m:mi>d</m:mi><m:mo>&#8242;</m:mo></m:msup><m:mn>1</m:mn></m:msub><m:mo stretchy="false">]</m:mo><m:mo stretchy="false">)</m:mo><m:mo>,</m:mo><m:mn>...</m:mn><m:mo>,</m:mo><m:mo stretchy="false">(</m:mo><m:mo stretchy="false">[</m:mo><m:msub><m:msup><m:mi>a</m:mi><m:mo>&#8242;</m:mo></m:msup><m:mi>K</m:mi></m:msub><m:mo>,</m:mo><m:msub><m:msup><m:mi>b</m:mi><m:mo>&#8243;</m:mo></m:msup><m:mn>1</m:mn></m:msub><m:mo stretchy="false">]</m:mo><m:mo>,</m:mo><m:mo stretchy="false">[</m:mo><m:msub><m:msup><m:mi>c</m:mi><m:mo>&#8242;</m:mo></m:msup><m:mi>K</m:mi></m:msub><m:mo>,</m:mo><m:msub><m:msup><m:mi>d</m:mi><m:mo>&#8243;</m:mo></m:msup><m:mn>1</m:mn></m:msub><m:mo stretchy="false">]</m:mo><m:mo stretchy="false">)</m:mo><m:mo>,</m:mo><m:mn>...</m:mn><m:mo>,</m:mo><m:mo stretchy="false">(</m:mo><m:mo stretchy="false">[</m:mo><m:msub><m:msup><m:mi>a</m:mi><m:mo>&#8243;</m:mo></m:msup><m:mrow><m:mi>N</m:mi><m:mo>&#8722;</m:mo><m:mi>K</m:mi><m:mo>+</m:mo><m:mn>1</m:mn></m:mrow></m:msub><m:mo>,</m:mo><m:msub><m:msup><m:mi>b</m:mi><m:mo>&#8243;</m:mo></m:msup><m:mrow><m:mi>N</m:mi><m:mo>&#8722;</m:mo><m:mi>K</m:mi><m:mo>+</m:mo><m:mn>1</m:mn></m:mrow></m:msub><m:mo stretchy="false">]</m:mo><m:mo>,</m:mo><m:mo stretchy="false">[</m:mo><m:msub><m:msup><m:mi>c</m:mi><m:mo>&#8243;</m:mo></m:msup><m:mrow><m:mi>N</m:mi><m:mo>&#8722;</m:mo><m:mi>K</m:mi><m:mo>+</m:mo><m:mn>1</m:mn></m:mrow></m:msub><m:mo>,</m:mo><m:msub><m:msup><m:mi>d</m:mi><m:mo>&#8243;</m:mo></m:msup><m:mrow><m:mi>N</m:mi><m:mo>&#8722;</m:mo><m:mi>K</m:mi><m:mo>+</m:mo><m:mn>1</m:mn></m:mrow></m:msub><m:mo stretchy="false">]</m:mo><m:mo stretchy="false">)</m:mo><m:mo stretchy="false">]</m:mo></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaacqqHtoWrcqGH9aqpcqGGBbWwcqGGOaakcqGGBbWwcuWGHbqygaqbamaaBaaaleaacqaIXaqmaeqaaOGaeiilaWIafmOyaiMbauaadaWgaaWcbaGaeGymaedabeaakiabc2faDjabcYcaSiabcUfaBjqbdogaJzaafaWaaSbaaSqaaiabigdaXaqabaGccqGGSaalcuWGKbazgaqbamaaBaaaleaacqaIXaqmaeqaaOGaeiyxa0LaeiykaKIaeiilaWIaeiOla4IaeiOla4IaeiOla4IaeiilaWIaeiikaGIaei4waSLafmyyaeMbauaadaWgaaWcbaGaem4saSeabeaakiabcYcaSiqbdkgaIzaagaWaaSbaaSqaaiabigdaXaqabaGccqGGDbqxcqGGSaalcqGGBbWwcuWGJbWygaqbamaaBaaaleaacqWGlbWsaeqaaOGaeiilaWIafmizaqMbayaadaWgaaWcbaGaeGymaedabeaakiabc2faDjabcMcaPiabcYcaSiabc6caUiabc6caUiabc6caUiabcYcaSiabcIcaOiabcUfaBjqbdggaHzaagaWaaSbaaSqaaiabd6eaojabgkHiTiabdUealjabgUcaRiabigdaXaqabaGccqGGSaalcuWGIbGygaGbamaaBaaaleaacqWGobGtcqGHsislcqWGlbWscqGHRaWkcqaIXaqmaeqaaOGaeiyxa0LaeiilaWIaei4waSLafm4yamMbayaadaWgaaWcbaGaemOta4KaeyOeI0Iaem4saSKaey4kaSIaeGymaedabeaakiabcYcaSiqbdsgaKzaagaWaaSbaaSqaaiabd6eaojabgkHiTiabdUealjabgUcaRiabigdaXaqabaGccqGGDbqxcqGGPaqkcqGGDbqxaaa@8518@</m:annotation></m:semantics></m:math></inline-formula> has score <inline-formula><m:math name="1748-7188-2-11-i30" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:mi mathvariant="script">S</m:mi><m:mo stretchy="false">(</m:mo><m:msup><m:mi>&#915;</m:mi><m:mo>&#8242;</m:mo></m:msup><m:mo stretchy="false">)</m:mo><m:mo>+</m:mo><m:mi mathvariant="script">S</m:mi><m:mo stretchy="false">(</m:mo><m:msup><m:mi>&#915;</m:mi><m:mo>&#8243;</m:mo></m:msup><m:mo stretchy="false">)</m:mo></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaat0uy0HwzTfgDPnwy1egaryqtHrhAL1wy0L2yHvdaiqaacqWFse=ucqGGOaakcuqHtoWrgaqbaiabcMcaPiabgUcaRiab=jr8tjabcIcaOiqbfo5ahzaagaGaeiykaKcaaa@414E@</m:annotation></m:semantics></m:math></inline-formula>, which is by definition smaller than <inline-formula><m:math name="1748-7188-2-11-i10" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:msup><m:mi>&#8499;</m:mi><m:mi>N</m:mi></m:msup></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaat0uy0HwzTfgDPnwy1egaryqtHrhAL1wy0L2yHvdaiqaacqWFZestdaahaaWcbeqaaiabd6eaobaaaaa@38E1@</m:annotation></m:semantics></m:math></inline-formula> (<it>s</it>, <it>t</it>). It implies that <inline-formula><m:math name="1748-7188-2-11-i31" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:msub><m:mi mathvariant="script">Q</m:mi><m:mn>1</m:mn></m:msub><m:mo>&#8804;</m:mo><m:msup><m:mi>&#8499;</m:mi><m:mi>N</m:mi></m:msup><m:mo stretchy="false">(</m:mo><m:mi>s</m:mi><m:mo>,</m:mo><m:mi>t</m:mi><m:mo stretchy="false">)</m:mo></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaat0uy0HwzTfgDPnwy1egaryqtHrhAL1wy0L2yHvdaiqaacqWFqeFudaWgaaWcbaGaeGymaedabeaakiabgsMiJkab=ntinnaaCaaaleqabaGaemOta4eaaOGaeiikaGIaem4CamNaeiilaWIaemiDaqNaeiykaKcaaa@430F@</m:annotation></m:semantics></m:math></inline-formula>. A similar argument establishes that <inline-formula><m:math name="1748-7188-2-11-i32" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:msub><m:mi mathvariant="script">Q</m:mi><m:mn>2</m:mn></m:msub><m:mo>&#8804;</m:mo><m:msup><m:mi>&#8499;</m:mi><m:mi>N</m:mi></m:msup><m:mo stretchy="false">(</m:mo><m:mi>s</m:mi><m:mo>,</m:mo><m:mi>t</m:mi><m:mo stretchy="false">)</m:mo></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaat0uy0HwzTfgDPnwy1egaryqtHrhAL1wy0L2yHvdaiqaacqWFqeFudaWgaaWcbaGaeGOmaidabeaakiabgsMiJkab=ntinnaaCaaaleqabaGaemOta4eaaOGaeiikaGIaem4CamNaeiilaWIaemiDaqNaeiykaKcaaa@4311@</m:annotation></m:semantics></m:math></inline-formula> and ends the proof.</p>
            <p><b>Remark 1 </b><it>Let s and t be two sequences, N a positive integer, and </it>[<it>D</it><sub>1</sub>, ..., <it>D</it><sub><it>N</it></sub>] <it>an optimal N-map of s over t with diagonals D</it><sub>1</sub>, ..., <it>D</it><sub><it>N </it></sub><it>indexed following the increasing order of their s-intervals</it>.</p>
            <p><it>1. For all </it>1 &#8804; <it>K </it>&lt;<it>N</it>, [<it>D</it><sub>1</sub>, ... , <it>D</it><sub><it>K</it></sub>] <it>is an optimal K-map of </it><inline-formula><m:math name="1748-7188-2-11-i33" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:msub><m:mi>s</m:mi><m:mrow><m:mo stretchy="false">[</m:mo><m:mn>1</m:mn><m:mo>,</m:mo><m:msub><m:mi>a</m:mi><m:mrow><m:mi>K</m:mi><m:mo>+</m:mo><m:mn>1</m:mn></m:mrow></m:msub><m:mo>&#8722;</m:mo><m:mn>1</m:mn><m:mo stretchy="false">]</m:mo></m:mrow></m:msub></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaacqWGZbWCdaWgaaWcbaGaei4waSLaeGymaeJaeiilaWIaemyyae2aaSbaaWqaaiabdUealjabgUcaRiabigdaXaqabaWccqGHsislcqaIXaqmcqGGDbqxaeqaaaaa@38E8@</m:annotation></m:semantics></m:math></inline-formula><it>over t. Reciprocally, if </it><inline-formula><m:math name="1748-7188-2-11-i34" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:mo stretchy="false">[</m:mo><m:msub><m:msup><m:mi>D</m:mi><m:mo>&#8242;</m:mo></m:msup><m:mn>1</m:mn></m:msub><m:mo>,</m:mo><m:mn>...</m:mn><m:mo>,</m:mo><m:msub><m:msup><m:mi>D</m:mi><m:mo>&#8242;</m:mo></m:msup><m:mi>K</m:mi></m:msub><m:mo stretchy="false">]</m:mo></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaacqGGBbWwcuWGebargaqbamaaBaaaleaacqaIXaqmaeqaaOGaeiilaWIaeiOla4IaeiOla4IaeiOla4IaeiilaWIafmiraqKbauaadaWgaaWcbaGaem4saSeabeaakiabc2faDbaa@384D@</m:annotation></m:semantics></m:math></inline-formula><it>is an optimal K-map of </it><inline-formula><m:math name="1748-7188-2-11-i33" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:msub><m:mi>s</m:mi><m:mrow><m:mo stretchy="false">[</m:mo><m:mn>1</m:mn><m:mo>,</m:mo><m:msub><m:mi>a</m:mi><m:mrow><m:mi>K</m:mi><m:mo>+</m:mo><m:mn>1</m:mn></m:mrow></m:msub><m:mo>&#8722;</m:mo><m:mn>1</m:mn><m:mo stretchy="false">]</m:mo></m:mrow></m:msub></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaacqWGZbWCdaWgaaWcbaGaei4waSLaeGymaeJaeiilaWIaemyyae2aaSbaaWqaaiabdUealjabgUcaRiabigdaXaqabaWccqGHsislcqaIXaqmcqGGDbqxaeqaaaaa@38E8@</m:annotation></m:semantics></m:math></inline-formula><it>over t then </it><inline-formula><m:math name="1748-7188-2-11-i35" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:mo stretchy="false">[</m:mo><m:msub><m:msup><m:mi>D</m:mi><m:mo>&#8242;</m:mo></m:msup><m:mn>1</m:mn></m:msub><m:mo>,</m:mo><m:mn>...</m:mn><m:mo>,</m:mo><m:msub><m:msup><m:mi>D</m:mi><m:mo>&#8242;</m:mo></m:msup><m:mi>K</m:mi></m:msub><m:mo>,</m:mo><m:msub><m:mi>D</m:mi><m:mrow><m:mi>K</m:mi><m:mo>+</m:mo><m:mn>1</m:mn></m:mrow></m:msub><m:mo>,</m:mo><m:mn>...</m:mn><m:mo>,</m:mo><m:msub><m:mi>D</m:mi><m:mi>N</m:mi></m:msub><m:mo stretchy="false">]</m:mo></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaacqGGBbWwcuWGebargaqbamaaBaaaleaacqaIXaqmaeqaaOGaeiilaWIaeiOla4IaeiOla4IaeiOla4IaeiilaWIafmiraqKbauaadaWgaaWcbaGaem4saSeabeaakiabcYcaSiabdseaenaaBaaaleaacqWGlbWscqGHRaWkcqaIXaqmaeqaaOGaeiilaWIaeiOla4IaeiOla4IaeiOla4IaeiilaWIaemiraq0aaSbaaSqaaiabd6eaobqabaGccqGGDbqxaaa@443D@</m:annotation></m:semantics></m:math></inline-formula><it>is an optimal N-map of s over t</it>.</p>
            <p><it>2. For all </it>1 &lt;<it>K </it>&#8804; <it>N</it>, [<it>D</it><sub><it>K</it></sub>, ..., <it>D</it><sub><it>N</it></sub>] <it>is an optimal </it>(<it>N </it>- <it>K </it>+ 1)-<it>map of </it><inline-formula><m:math name="1748-7188-2-11-i36" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:msub><m:mi>s</m:mi><m:mrow><m:mo stretchy="false">[</m:mo><m:msub><m:mi>b</m:mi><m:mrow><m:mi>K</m:mi><m:mo>&#8722;</m:mo><m:mn>1</m:mn></m:mrow></m:msub><m:mo>+</m:mo><m:mn>1</m:mn><m:mo>,</m:mo><m:mrow><m:mo>|</m:mo><m:mi>s</m:mi><m:mo>|</m:mo></m:mrow><m:mo stretchy="false">]</m:mo></m:mrow></m:msub></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaacqWGZbWCdaWgaaWcbaGaei4waSLaemOyai2aaSbaaWqaaiabdUealjabgkHiTiabigdaXaqabaWccqGHRaWkcqaIXaqmcqGGSaaldaabdaqaaiabdohaZbGaay5bSlaawIa7aiabc2faDbqabaaaaa@3C8B@</m:annotation></m:semantics></m:math></inline-formula><it>over t. Reciprocally, if </it><inline-formula><m:math name="1748-7188-2-11-i37" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:mo stretchy="false">[</m:mo><m:msub><m:msup><m:mi>D</m:mi><m:mo>&#8242;</m:mo></m:msup><m:mi>K</m:mi></m:msub><m:mo>,</m:mo><m:mn>...</m:mn><m:mo>,</m:mo><m:msub><m:msup><m:mi>D</m:mi><m:mo>&#8242;</m:mo></m:msup><m:mi>N</m:mi></m:msub><m:mo stretchy="false">]</m:mo></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaacqGGBbWwcuWGebargaqbamaaBaaaleaacqWGlbWsaeqaaOGaeiilaWIaeiOla4IaeiOla4IaeiOla4IaeiilaWIafmiraqKbauaadaWgaaWcbaGaemOta4eabeaakiabc2faDbaa@3882@</m:annotation></m:semantics></m:math></inline-formula><it>is an optimal </it>(<it>N </it>- <it>K </it>+ 1)-<it>map of </it><inline-formula><m:math name="1748-7188-2-11-i36" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:msub><m:mi>s</m:mi><m:mrow><m:mo stretchy="false">[</m:mo><m:msub><m:mi>b</m:mi><m:mrow><m:mi>K</m:mi><m:mo>&#8722;</m:mo><m:mn>1</m:mn></m:mrow></m:msub><m:mo>+</m:mo><m:mn>1</m:mn><m:mo>,</m:mo><m:mrow><m:mo>|</m:mo><m:mi>s</m:mi><m:mo>|</m:mo></m:mrow><m:mo stretchy="false">]</m:mo></m:mrow></m:msub></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaacqWGZbWCdaWgaaWcbaGaei4waSLaemOyai2aaSbaaWqaaiabdUealjabgkHiTiabigdaXaqabaWccqGHRaWkcqaIXaqmcqGGSaaldaabdaqaaiabdohaZbGaay5bSlaawIa7aiabc2faDbqabaaaaa@3C8B@</m:annotation></m:semantics></m:math></inline-formula><it>over t then </it><inline-formula><m:math name="1748-7188-2-11-i38" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:mo stretchy="false">[</m:mo><m:msub><m:mi>D</m:mi><m:mn>1</m:mn></m:msub><m:mo>,</m:mo><m:mn>...</m:mn><m:mo>,</m:mo><m:msub><m:mi>D</m:mi><m:mrow><m:mi>K</m:mi><m:mo>&#8722;</m:mo><m:mn>1</m:mn></m:mrow></m:msub><m:mo>,</m:mo><m:msub><m:msup><m:mi>D</m:mi><m:mo>&#8242;</m:mo></m:msup><m:mi>K</m:mi></m:msub><m:mo>,</m:mo><m:mn>...</m:mn><m:mo>,</m:mo><m:msub><m:msup><m:mi>D</m:mi><m:mo>&#8242;</m:mo></m:msup><m:mi>N</m:mi></m:msub><m:mo stretchy="false">]</m:mo></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaacqGGBbWwcqWGebardaWgaaWcbaGaeGymaedabeaakiabcYcaSiabc6caUiabc6caUiabc6caUiabcYcaSiabdseaenaaBaaaleaacqWGlbWscqGHsislcqaIXaqmaeqaaOGaeiilaWIafmiraqKbauaadaWgaaWcbaGaem4saSeabeaakiabcYcaSiabc6caUiabc6caUiabc6caUiabcYcaSiqbdseaezaafaWaaSbaaSqaaiabd6eaobqabaGccqGGDbqxaaa@4448@</m:annotation></m:semantics></m:math></inline-formula><it>is an optimal N-map of s over t</it>.</p>
            <p>We are now able to introduce the formal algorithm <b>Alg_2 </b>which solves the problem of outputting the diagonals of an optimal global <it>N</it>-map without inversion.</p>
            <p>Algorithm <b>Alg_2 </b>takes as inputs two sequences <it>s </it>and <it>t</it>, two positions <it>i </it>and <it>j </it>bounding a substring of <it>s</it>, and a number of parts <it>N</it>. It outputs the diagonals of an optimal <it>N</it>-map of <it>s</it><sub>[<it>i</it>, <it>j</it>] </sub>over <it>t </it>ordered according to their first intervals.</p>
            <p><b>Algorithm 2 Alg_2 </b>(<it>s</it>, <it>i</it>, <it>j</it>, <it>t</it>, <it>N</it>)</p>
            <p>1: <b>if </b><it>N </it>= 0 <b>then</b></p>
            <p>2:&#160;&#160;&#160;<b>return</b>;</p>
            <p>3: <b>end if</b></p>
            <p>4: S<sub>max </sub>&#8592; -&#8734; ; <inline-formula><m:math name="1748-7188-2-11-i39" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:mi>m</m:mi><m:mo>=</m:mo><m:mrow><m:mo>&#8970;</m:mo><m:mrow><m:mfrac><m:mrow><m:mi>i</m:mi><m:mo>+</m:mo><m:mi>j</m:mi></m:mrow><m:mn>2</m:mn></m:mfrac></m:mrow><m:mo>&#8971;</m:mo></m:mrow></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaacqWGTbqBcqGH9aqpdaGbdaqaamaalaaabaGaemyAaKMaey4kaSIaemOAaOgabaGaeGOmaidaaaGaayj84laawUp+aaaa@38C9@</m:annotation></m:semantics></m:math></inline-formula> ; <inline-formula><m:math name="1748-7188-2-11-i40" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:msub><m:msup><m:mtext>D</m:mtext><m:mo>&#8242;</m:mo></m:msup><m:mrow><m:mi>max</m:mi><m:mo>&#8289;</m:mo></m:mrow></m:msub></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaacuqGebargaqbamaaBaaaleaacyGGTbqBcqGGHbqycqGG4baEaeqaaaaa@3219@</m:annotation></m:semantics></m:math></inline-formula> &#8592; NULL ;</p>
            <p>5: <b>Alg_1 </b>(<it>s</it><sub>[<it>i</it>, <it>m</it>]</sub>, <it>t</it>, <it>N</it>, B<sub>s</sub>, B<sub>l</sub>, M<sub>s</sub>, M<sub>d</sub>) ;</p>
            <p>6: <b>Alg_1 </b><inline-formula><m:math name="1748-7188-2-11-i41" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:mo stretchy="false">(</m:mo><m:mover accent="true"><m:mrow><m:msub><m:mi>s</m:mi><m:mrow><m:mo stretchy="false">[</m:mo><m:mi>m</m:mi><m:mo>+</m:mo><m:mn>1</m:mn><m:mo>,</m:mo><m:mi>j</m:mi><m:mo stretchy="false">]</m:mo></m:mrow></m:msub></m:mrow><m:mo stretchy="true">^</m:mo></m:mover><m:mo>,</m:mo><m:mover accent="true"><m:mi>t</m:mi><m:mo>^</m:mo></m:mover><m:mo>,</m:mo><m:mi>N</m:mi><m:mo>,</m:mo><m:msubsup><m:mtext>B</m:mtext><m:mtext>s</m:mtext><m:mo>&#8727;</m:mo></m:msubsup><m:mo>,</m:mo><m:msubsup><m:mtext>B</m:mtext><m:mtext>l</m:mtext><m:mo>&#8727;</m:mo></m:msubsup><m:mo>,</m:mo><m:msubsup><m:mtext>M</m:mtext><m:mtext>s</m:mtext><m:mo>&#8727;</m:mo></m:msubsup><m:mo>,</m:mo><m:msubsup><m:mtext>M</m:mtext><m:mtext>d</m:mtext><m:mo>&#8727;</m:mo></m:msubsup><m:mo stretchy="false">)</m:mo></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaacqGGOaakdaqiaaqaaiabdohaZnaaBaaaleaacqGGBbWwcqWGTbqBcqGHRaWkcqaIXaqmcqGGSaalcqWGQbGAcqGGDbqxaeqaaaGccaGLcmaacqGGSaalcuWG0baDgaqcaiabcYcaSiabd6eaojabcYcaSiabbkeacnaaDaaaleaacqqGZbWCaeaacqGHxiIkaaGccqGGSaalcqqGcbGqdaqhaaWcbaGaeeiBaWgabaGaey4fIOcaaOGaeiilaWIaeeyta00aa0baaSqaaiabbohaZbqaaiabgEHiQaaakiabcYcaSiabb2eannaaDaaaleaacqqGKbazaeaacqGHxiIkaaGccqGGPaqkaaa@4F15@</m:annotation></m:semantics></m:math></inline-formula> ;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;\* <it>Loop </it><inline-formula><m:math name="1748-7188-2-11-i42" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:msub><m:mi mathvariant="script">Q</m:mi><m:mn>1</m:mn></m:msub></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaat0uy0HwzTfgDPnwy1egaryqtHrhAL1wy0L2yHvdaiqaacqWFqeFudaWgaaWcbaGaeGymaedabeaaaaa@395C@</m:annotation></m:semantics></m:math></inline-formula> *\</p>
            <p>7: <b>for </b><it>K </it>&#8592; 1 <b>to <it>N </it>do</b></p>
            <p>8:&#160;&#160;&#160;<it>L </it>&#8592; <it>N </it>- <it>K </it>+ 1 ;</p>
            <p>9:&#160;&#160;&#160;<b>for </b><it>p </it>&#8592; 1 <b>to </b>(|<it>t</it>| - 1) <b>do</b></p>
            <p>10:&#160;&#160;&#160;&#160;&#160;&#160;<it>q </it>&#8592; |<it>t</it>| - <it>p </it>;</p>
            <p>11:&#160;&#160;&#160;&#160;&#160;&#160;<b>if </b>(B<sub>s[<it>p</it>, <it>K</it>] </sub>+ <inline-formula><m:math name="1748-7188-2-11-i43" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:msubsup><m:mtext>B</m:mtext><m:mrow><m:mtext>s</m:mtext><m:mo stretchy="false">[</m:mo><m:mi>q</m:mi><m:mo>,</m:mo><m:mi>L</m:mi><m:mo stretchy="false">]</m:mo></m:mrow><m:mo>&#8727;</m:mo></m:msubsup></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaacqqGcbGqdaqhaaWcbaGaee4CamNaei4waSLaemyCaeNaeiilaWIaemitaWKaeiyxa0fabaGaey4fIOcaaaaa@362C@</m:annotation></m:semantics></m:math></inline-formula>) > S<sub>max </sub><b>then</b></p>
            <p>12:&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;S<sub>max </sub>&#8592; B<sub>s[<it>p, K</it>] </sub>+ <inline-formula><m:math name="1748-7188-2-11-i43" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:msubsup><m:mtext>B</m:mtext><m:mrow><m:mtext>s</m:mtext><m:mo stretchy="false">[</m:mo><m:mi>q</m:mi><m:mo>,</m:mo><m:mi>L</m:mi><m:mo stretchy="false">]</m:mo></m:mrow><m:mo>&#8727;</m:mo></m:msubsup></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaacqqGcbGqdaqhaaWcbaGaee4CamNaei4waSLaemyCaeNaeiilaWIaemitaWKaeiyxa0fabaGaey4fIOcaaaaa@362C@</m:annotation></m:semantics></m:math></inline-formula> ;</p>
            <p>13:&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;D<sub>max </sub>&#8592; ([<it>m </it>- B<sub>l[<it>p, K</it>] </sub>+ 1, <it>m </it>+ <inline-formula><m:math name="1748-7188-2-11-i44" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:msubsup><m:mtext>B</m:mtext><m:mrow><m:mtext>l</m:mtext><m:mo stretchy="false">[</m:mo><m:mi>q</m:mi><m:mo>,</m:mo><m:mi>L</m:mi><m:mo stretchy="false">]</m:mo></m:mrow><m:mo>&#8727;</m:mo></m:msubsup></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaacqqGcbGqdaqhaaWcbaGaeeiBaWMaei4waSLaemyCaeNaeiilaWIaemitaWKaeiyxa0fabaGaey4fIOcaaaaa@361E@</m:annotation></m:semantics></m:math></inline-formula>], [<it>p </it>- B<sub>l[<it>p, K</it>] </sub>+ l, <it>p </it>+ <inline-formula><m:math name="1748-7188-2-11-i44" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:msubsup><m:mtext>B</m:mtext><m:mrow><m:mtext>l</m:mtext><m:mo stretchy="false">[</m:mo><m:mi>q</m:mi><m:mo>,</m:mo><m:mi>L</m:mi><m:mo stretchy="false">]</m:mo></m:mrow><m:mo>&#8727;</m:mo></m:msubsup></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaacqqGcbGqdaqhaaWcbaGaeeiBaWMaei4waSLaemyCaeNaeiilaWIaemitaWKaeiyxa0fabaGaey4fIOcaaaaa@361E@</m:annotation></m:semantics></m:math></inline-formula>]) ;</p>
            <p>14:&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<it>N</it><sub>L </sub>&#8592; <it>K </it>- 1 ; <it>N</it><sub>R </sub>&#8592; <it>L </it>- 1 ; <it>j</it><sub>L </sub>&#8592; <it>m </it>- B<sub>l[<it>p</it>, <it>K</it>] </sub>; <it>i</it><sub>R </sub>&#8592; <it>m </it>+ <inline-formula><m:math name="1748-7188-2-11-i44" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:msubsup><m:mtext>B</m:mtext><m:mrow><m:mtext>l</m:mtext><m:mo stretchy="false">[</m:mo><m:mi>q</m:mi><m:mo>,</m:mo><m:mi>L</m:mi><m:mo stretchy="false">]</m:mo></m:mrow><m:mo>&#8727;</m:mo></m:msubsup></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaacqqGcbGqdaqhaaWcbaGaeeiBaWMaei4waSLaemyCaeNaeiilaWIaemitaWKaeiyxa0fabaGaey4fIOcaaaaa@361E@</m:annotation></m:semantics></m:math></inline-formula> + 1;</p>
            <p>15:&#160;&#160;&#160;&#160;&#160;&#160;<b>end if</b></p>
            <p>16:&#160;&#160;&#160;<b>end for</b></p>
            <p>17: <b>end for</b>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;\* <it>Loop </it><inline-formula><m:math name="1748-7188-2-11-i45" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:msub><m:mi mathvariant="script">Q</m:mi><m:mn>2</m:mn></m:msub></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaat0uy0HwzTfgDPnwy1egaryqtHrhAL1wy0L2yHvdaiqaacqWFqeFudaWgaaWcbaGaeGOmaidabeaaaaa@395E@</m:annotation></m:semantics></m:math></inline-formula> *\</p>
            <p>18: <b>for </b><it>K </it>&#8592; 0 <b>to </b><it>N </it><b>do</b></p>
            <p>19:&#160;&#160;&#160;<it>L </it>&#8592; <it>N </it>- <it>K </it>;</p>
            <p>20:&#160;&#160;&#160;<b>if </b>(M<sub>s[<it>K</it>] </sub>+ <inline-formula><m:math name="1748-7188-2-11-i46" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:msubsup><m:mtext>M</m:mtext><m:mrow><m:mtext>s</m:mtext><m:mo stretchy="false">[</m:mo><m:mi>L</m:mi><m:mo stretchy="false">]</m:mo></m:mrow><m:mo>&#8727;</m:mo></m:msubsup></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaacqqGnbqtdaqhaaWcbaGaee4CamNaei4waSLaemitaWKaeiyxa0fabaGaey4fIOcaaaaa@33F7@</m:annotation></m:semantics></m:math></inline-formula>) > S<sub>max </sub><b>then</b></p>
            <p>21:&#160;&#160;&#160;&#160;&#160;&#160;S<sub>max </sub>&#8592; M<sub>s[<it>K</it>] </sub>+ <inline-formula><m:math name="1748-7188-2-11-i46" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:msubsup><m:mtext>M</m:mtext><m:mrow><m:mtext>s</m:mtext><m:mo stretchy="false">[</m:mo><m:mi>L</m:mi><m:mo stretchy="false">]</m:mo></m:mrow><m:mo>&#8727;</m:mo></m:msubsup></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaacqqGnbqtdaqhaaWcbaGaee4CamNaei4waSLaemitaWKaeiyxa0fabaGaey4fIOcaaaaa@33F7@</m:annotation></m:semantics></m:math></inline-formula></p>
            <p>22:&#160;&#160;&#160;&#160;&#160;&#160;<b>if </b><it>K </it>> 0 <b>and </b>M<sub>d[<it>K</it>] </sub>&#8800; NULL <b>then</b></p>
            <p>23:&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;([<it>a</it>, <it>b</it>], [<it>c</it>, <it>d</it>]) &#8592; M<sub>d[<it>K</it>] </sub>; D<sub>max </sub>&#8592; ([<it>a </it>+ <it>i </it>- 1, <it>b </it>+ <it>i </it>- 1], [<it>c</it>, <it>d</it>]) ;</p>
            <p>24:&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<it>N</it><sub>L </sub>&#8592; <it>K </it>- 1 ; <it>j</it><sub>L </sub>&#8592; <it>a </it>+ <it>i </it>- 2 ;</p>
            <p>25:&#160;&#160;&#160;&#160;&#160;&#160;<b>else</b></p>
            <p>26:&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;D<sub>max </sub>&#8592; NULL ; <it>N</it><sub>L </sub>&#8592; 0 ;</p>
            <p>27:&#160;&#160;&#160;&#160;&#160;&#160;<b>end if</b></p>
            <p>28:&#160;&#160;&#160;&#160;&#160;&#160;<b>if </b><it>L </it>> 0 <b>and </b><inline-formula><m:math name="1748-7188-2-11-i47" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:msubsup><m:mtext>M</m:mtext><m:mrow><m:mtext>d</m:mtext><m:mo stretchy="false">[</m:mo><m:mi>L</m:mi><m:mo stretchy="false">]</m:mo></m:mrow><m:mo>&#8727;</m:mo></m:msubsup></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaacqqGnbqtdaqhaaWcbaGaeeizaqMaei4waSLaemitaWKaeiyxa0fabaGaey4fIOcaaaaa@33D9@</m:annotation></m:semantics></m:math></inline-formula> &#8800; NULL <b>then</b></p>
            <p>29:&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;([<it>a</it>, <it>b</it>], [<it>c</it>, <it>d</it>]) &#8592; <inline-formula><m:math name="1748-7188-2-11-i47" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:msubsup><m:mtext>M</m:mtext><m:mrow><m:mtext>d</m:mtext><m:mo stretchy="false">[</m:mo><m:mi>L</m:mi><m:mo stretchy="false">]</m:mo></m:mrow><m:mo>&#8727;</m:mo></m:msubsup></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaacqqGnbqtdaqhaaWcbaGaeeizaqMaei4waSLaemitaWKaeiyxa0fabaGaey4fIOcaaaaa@33D9@</m:annotation></m:semantics></m:math></inline-formula> ; <inline-formula><m:math name="1748-7188-2-11-i40" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:msub><m:msup><m:mtext>D</m:mtext><m:mo>&#8242;</m:mo></m:msup><m:mrow><m:mi>max</m:mi><m:mo>&#8289;</m:mo></m:mrow></m:msub></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaacuqGebargaqbamaaBaaaleaacyGGTbqBcqGGHbqycqGG4baEaeqaaaaa@3219@</m:annotation></m:semantics></m:math></inline-formula> &#8592; ([<it>a </it>+ <it>m</it>, <it>b </it>+ <it>m</it>], [<it>c</it>, <it>d</it>]) ;</p>
            <p>30:&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<it>N</it><sub>R </sub>&#8592; <it>L </it>- 1 ; <it>i</it><sub>R </sub>&#8592; <it>b </it>+ <it>m </it>+ 1 ;</p>
            <p>31:&#160;&#160;&#160;&#160;&#160;&#160;<b>else</b></p>
            <p>32:&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<inline-formula><m:math name="1748-7188-2-11-i40" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:msub><m:msup><m:mtext>D</m:mtext><m:mo>&#8242;</m:mo></m:msup><m:mrow><m:mi>max</m:mi><m:mo>&#8289;</m:mo></m:mrow></m:msub></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaacuqGebargaqbamaaBaaaleaacyGGTbqBcqGGHbqycqGG4baEaeqaaaaa@3219@</m:annotation></m:semantics></m:math></inline-formula> &#8592; NULL ; <it>N</it><sub>R </sub>&#8592; 0 ;</p>
            <p>33:&#160;&#160;&#160;&#160;&#160;&#160;<b>end if</b></p>
            <p>34:&#160;&#160;&#160;<b>end if</b></p>
            <p>35: <b>end for</b></p>
            <p>36: <b>Alg_2 </b>(<it>s</it>, <it>i</it>, <it>j</it><sub>L</sub>, <it>t</it>, <it>N</it><sub>L</sub>) ;</p>
            <p>37: <b>Output </b>(D<sub>max</sub>) ; <b>output </b>(<inline-formula><m:math name="1748-7188-2-11-i40" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:msub><m:msup><m:mtext>D</m:mtext><m:mo>&#8242;</m:mo></m:msup><m:mrow><m:mi>max</m:mi><m:mo>&#8289;</m:mo></m:mrow></m:msub></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaacuqGebargaqbamaaBaaaleaacyGGTbqBcqGGHbqycqGG4baEaeqaaaaa@3219@</m:annotation></m:semantics></m:math></inline-formula>) ;</p>
            <p>38: <b>Alg_2 </b>(<it>s</it>, <it>i</it><sub>R</sub>, <it>j</it>, <it>t</it>, <it>N</it><sub>R</sub>) ;</p>
            <sec>
               <st>
                  <p>Correctness of Algorithm Alg_2</p>
               </st>
               <p>Let us consider Best and <inline-formula><m:math name="1748-7188-2-11-i48" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:mover accent="true"><m:mrow><m:mtext>Best</m:mtext></m:mrow><m:mo stretchy="true">&#175;</m:mo></m:mover></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaadaqdaaqaaiabbkeacjabbwgaLjabbohaZjabbsha0baaaaa@31F5@</m:annotation></m:semantics></m:math></inline-formula> defined for <it>s</it><sub>[<it>i</it>, <it>j</it>] </sub>as follows. For all <it>r </it>such that <it>i </it>&#8804; <it>r </it>&#8804; <it>j </it>and <it>v </it>such that 1 &#8804; <it>v </it>&#8804; |<it>t</it>|, Best<sub>[<it>r</it>, <it>v</it>, <it>K</it>] </sub>is the maximal score obtained by a <it>K</it>-map of <it>s</it><sub>[<it>i</it>, <it>r</it>] </sub>over <it>t</it><sub>[1, <it>v</it>] </sub>ending at (<it>r, v</it>). Analogously, <inline-formula><m:math name="1748-7188-2-11-i49" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:msub><m:mrow><m:mover accent="true"><m:mrow><m:mtext>Best</m:mtext></m:mrow><m:mo stretchy="true">&#175;</m:mo></m:mover></m:mrow><m:mrow><m:mo stretchy="false">[</m:mo><m:mi>r</m:mi><m:mo>,</m:mo><m:mi>v</m:mi><m:mo>,</m:mo><m:mi>K</m:mi><m:mo stretchy="false">]</m:mo></m:mrow></m:msub></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaadaqdaaqaaiabbkeacjabbwgaLjabbohaZjabbsha0baadaWgaaWcbaGaei4waSLaemOCaiNaeiilaWIaemODayNaeiilaWIaem4saSKaeiyxa0fabeaaaaa@3A62@</m:annotation></m:semantics></m:math></inline-formula> is the maximal score obtained by a <it>K</it>-map of <it>s</it><sub>[<it>r</it>, <it>j</it>] </sub>over <it>t</it><sub>[<it>v</it>, |<it>t</it>|] </sub>starting at (<it>r</it>, <it>v</it>). For all positions <it>p </it>of <it>t </it>and all 1 &#8804; <it>K </it>&#8804; <it>N</it>, we have B<sub>s[<it>p, K</it>] </sub>= Best<sub>[<it>m</it>, <it>p</it>, <it>K</it>]</sub>, <inline-formula><m:math name="1748-7188-2-11-i50" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:msubsup><m:mtext>B</m:mtext><m:mrow><m:mtext>s</m:mtext><m:mo stretchy="false">[</m:mo><m:mo>|</m:mo><m:mi>t</m:mi><m:mo>|</m:mo><m:mo>&#8722;</m:mo><m:mi>p</m:mi><m:mo>,</m:mo><m:mi>K</m:mi><m:mo stretchy="false">]</m:mo></m:mrow><m:mo>&#8727;</m:mo></m:msubsup><m:mo>=</m:mo><m:msub><m:mrow><m:mover accent="true"><m:mrow><m:mtext>Best</m:mtext></m:mrow><m:mo stretchy="true">&#175;</m:mo></m:mover></m:mrow><m:mrow><m:mo stretchy="false">[</m:mo><m:mi>m</m:mi><m:mo>+</m:mo><m:mn>1</m:mn><m:mo>,</m:mo><m:mi>p</m:mi><m:mo>+</m:mo><m:mn>1</m:mn><m:mo>,</m:mo><m:mi>K</m:mi><m:mo stretchy="false">]</m:mo></m:mrow></m:msub></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaacqqGcbGqdaqhaaWcbaGaee4CamNaei4waSLaeiiFaWNaemiDaqNaeiiFaWNaeyOeI0IaemiCaaNaeiilaWIaem4saSKaeiyxa0fabaGaey4fIOcaaOGaeyypa0Zaa0aaaeaacqqGcbGqcqqGLbqzcqqGZbWCcqqG0baDaaWaaSbaaSqaaiabcUfaBjabd2gaTjabgUcaRiabigdaXiabcYcaSiabdchaWjabgUcaRiabigdaXiabcYcaSiabdUealjabc2faDbqabaaaaa@4DDA@</m:annotation></m:semantics></m:math></inline-formula> (since it is obtained from <inline-formula><m:math name="1748-7188-2-11-i51" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:mover accent="true"><m:mrow><m:msub><m:mi>s</m:mi><m:mrow><m:mo stretchy="false">[</m:mo><m:mi>m</m:mi><m:mo>+</m:mo><m:mn>1</m:mn><m:mo>,</m:mo><m:mi>j</m:mi><m:mo stretchy="false">]</m:mo></m:mrow></m:msub></m:mrow><m:mo stretchy="true">^</m:mo></m:mover></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaadaqiaaqaaiabdohaZnaaBaaaleaacqGGBbWwcqWGTbqBcqGHRaWkcqaIXaqmcqGGSaalcqWGQbGAcqGGDbqxaeqaaaGccaGLcmaaaaa@3705@</m:annotation></m:semantics></m:math></inline-formula>), <inline-formula><m:math name="1748-7188-2-11-i52" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:msub><m:mtext>M</m:mtext><m:mrow><m:mtext>s</m:mtext><m:mo stretchy="false">[</m:mo><m:mi>K</m:mi><m:mo stretchy="false">]</m:mo></m:mrow></m:msub><m:mo>=</m:mo><m:msup><m:mi>&#8499;</m:mi><m:mi>K</m:mi></m:msup><m:mo stretchy="false">(</m:mo><m:msub><m:mi>s</m:mi><m:mrow><m:mo stretchy="false">[</m:mo><m:mi>i</m:mi><m:mo>,</m:mo><m:mi>m</m:mi><m:mo stretchy="false">]</m:mo><m:mo>,</m:mo></m:mrow></m:msub><m:mi>t</m:mi><m:mo stretchy="false">)</m:mo></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaacqqGnbqtdaWgaaWcbaGaee4CamNaei4waSLaem4saSKaeiyxa0fabeaakiabg2da9mrtHrhAL1wy0L2yHvtyaeHbnfgDOvwBHrxAJfwnaGabaiab=ntinnaaCaaaleqabaGaem4saSeaaOGaeiikaGIaem4Cam3aaSbaaSqaaiabcUfaBjabdMgaPjabcYcaSiabd2gaTjabc2faDjabcYcaSaqabaGccqWG0baDcqGGPaqkaaa@4C14@</m:annotation></m:semantics></m:math></inline-formula> and <inline-formula><m:math name="1748-7188-2-11-i53" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:msubsup><m:mtext>M</m:mtext><m:mrow><m:mtext>s</m:mtext><m:mo stretchy="false">[</m:mo><m:mi>K</m:mi><m:mo stretchy="false">]</m:mo></m:mrow><m:mo>&#8727;</m:mo></m:msubsup><m:mo>=</m:mo><m:msup><m:mi>&#8499;</m:mi><m:mi>K</m:mi></m:msup><m:mo stretchy="false">(</m:mo><m:msub><m:mi>s</m:mi><m:mrow><m:mi>m</m:mi><m:mo>+</m:mo><m:mn>1</m:mn><m:mo>,</m:mo><m:mi>j</m:mi><m:mo stretchy="false">]</m:mo></m:mrow></m:msub><m:mo>,</m:mo><m:mi>t</m:mi><m:mo stretchy="false">)</m:mo></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaacqqGnbqtdaqhaaWcbaGaee4CamNaei4waSLaem4saSKaeiyxa0fabaGaey4fIOcaaOGaeyypa0ZenfgDOvwBHrxAJfwnHbqeg0uy0HwzTfgDPnwy1aaceaGae83mH00aaWbaaSqabeaacqWGlbWsaaGccqGGOaakcqWGZbWCdaWgaaWcbaGaemyBa0Maey4kaSIaeGymaeJaeiilaWIaemOAaOMaeiyxa0fabeaakiabcYcaSiabdsha0jabcMcaPaaa@4D9A@</m:annotation></m:semantics></m:math></inline-formula>. Following the notations of Lemma 1, "Loop <inline-formula><m:math name="1748-7188-2-11-i42" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:msub><m:mi mathvariant="script">Q</m:mi><m:mn>1</m:mn></m:msub></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaat0uy0HwzTfgDPnwy1egaryqtHrhAL1wy0L2yHvdaiqaacqWFqeFudaWgaaWcbaGaeGymaedabeaaaaa@395C@</m:annotation></m:semantics></m:math></inline-formula>" (<it>resp</it>. "Loop <inline-formula><m:math name="1748-7188-2-11-i45" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:msub><m:mi mathvariant="script">Q</m:mi><m:mn>2</m:mn></m:msub></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaat0uy0HwzTfgDPnwy1egaryqtHrhAL1wy0L2yHvdaiqaacqWFqeFudaWgaaWcbaGaeGOmaidabeaaaaa@395E@</m:annotation></m:semantics></m:math></inline-formula>") parses the quantities maximized by <inline-formula><m:math name="1748-7188-2-11-i42" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:msub><m:mi mathvariant="script">Q</m:mi><m:mn>1</m:mn></m:msub></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaat0uy0HwzTfgDPnwy1egaryqtHrhAL1wy0L2yHvdaiqaacqWFqeFudaWgaaWcbaGaeGymaedabeaaaaa@395C@</m:annotation></m:semantics></m:math></inline-formula> (<it>resp</it>. by <inline-formula><m:math name="1748-7188-2-11-i45" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:msub><m:mi mathvariant="script">Q</m:mi><m:mn>2</m:mn></m:msub></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaat0uy0HwzTfgDPnwy1egaryqtHrhAL1wy0L2yHvdaiqaacqWFqeFudaWgaaWcbaGaeGOmaidabeaaaaa@395E@</m:annotation></m:semantics></m:math></inline-formula>). Thus, Lemma 1 ensures that <inline-formula><m:math name="1748-7188-2-11-i54" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:msup><m:mi>&#8499;</m:mi><m:mi>N</m:mi></m:msup><m:mo stretchy="false">(</m:mo><m:msub><m:mi>s</m:mi><m:mrow><m:mo stretchy="false">[</m:mo><m:mi>i</m:mi><m:mo>,</m:mo><m:mi>j</m:mi><m:mo stretchy="false">]</m:mo></m:mrow></m:msub><m:mo>,</m:mo><m:mi>t</m:mi><m:mo stretchy="false">)</m:mo></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaat0uy0HwzTfgDPnwy1egaryqtHrhAL1wy0L2yHvdaiqaacqWFZestdaahaaWcbeqaaiabd6eaobaakiabcIcaOiabdohaZnaaBaaaleaacqGGBbWwcqWGPbqAcqGGSaalcqWGQbGAcqGGDbqxaeqaaOGaeiilaWIaemiDaqNaeiykaKcaaa@44AB@</m:annotation></m:semantics></m:math></inline-formula> is stored in the variable S<sub>max </sub>after the execution of these two loops. If the maximum is reached in "Loop <inline-formula><m:math name="1748-7188-2-11-i42" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:msub><m:mi mathvariant="script">Q</m:mi><m:mn>1</m:mn></m:msub></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaat0uy0HwzTfgDPnwy1egaryqtHrhAL1wy0L2yHvdaiqaacqWFqeFudaWgaaWcbaGaeGymaedabeaaaaa@395C@</m:annotation></m:semantics></m:math></inline-formula>", the variable <inline-formula><m:math name="1748-7188-2-11-i40" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:msub><m:msup><m:mtext>D</m:mtext><m:mo>&#8242;</m:mo></m:msup><m:mrow><m:mi>max</m:mi><m:mo>&#8289;</m:mo></m:mrow></m:msub></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaacuqGebargaqbamaaBaaaleaacyGGTbqBcqGGHbqycqGG4baEaeqaaaaa@3219@</m:annotation></m:semantics></m:math></inline-formula> is NULL and the variable D<sub>max </sub>contains the diagonal including <it>m</it>, let us say the <it>K</it><sup>th</sup>, of a <it>N</it>-map with score <inline-formula><m:m