"Algebras/MFE/alg_outside_mfe.gap" is the outside analogon to Algebras/MFE/alg_mfe.gap.
It uses the same RNA library energy functions, but transforms indices of the parsed terminals. This is to map the continuous sub-word of the duplicated input back to the original single input.
Unfortunately, ADP requires a single contiguous sub-word, for which intermediate results
are computed. To make two sub-words (0, i) and (j, n) contiguous (0 < i < j < n), we have to apply the following "trick": we
duplicate the input sequence but separate both copies with a special character, e. g.
original input ccaaagg
becomes ccaaagg+ccaaagg
. Since
everything is duplicated, sub-word (0, i) for the leading half is identical to (n+1, n+1+i).
Concatenated with the trailing half (j, n) and the separator character (n, n + 1), we get
the contiguous sub-word (j, n)+(n + 1, n + 1 + i), for which we can apply any ADP
computation.
Since some algebra functions are commonly used by other algebras (Algebras/MFE/alg_mfe.gap and Algebras/MFE/alg_pknot_mfe.gap), they are outsourced in the files Algebras/MFE/algpart_mfe_basic.gap.