def _needleman_wunsch_fn(v1, v2):
    """Needleman-Wunsch

    Match: +1 -> -1
    Mismatch or Indel: −1 -> +1

    The values are reversed because our general dynamic programming algorithm
    selects the minimal value instead of the maximal value.
    """
    d_indel = 1
    if v1 == v2:
        d = -1
    else:
        d = 1
    return d, d_indel
