Performs linear normalization of all values in Map between normMin and normMax

    :param: map     Map to normalize values for
    :param: normMin Smallest normalized value
    :param: normMax Largest normalized value
    :return: A new map with double values within [normMin, normMax]

def normalize_map_between(dictionary, norm_min, norm_max):
    """
    Performs linear normalization of all values in Map between normMin and normMax

    :param: map     Map to normalize values for
    :param: normMin Smallest normalized value
    :param: normMax Largest normalized value
    :return: A new map with double values within [normMin, normMax]
    """
    if len(dictionary) < 2:
        return {}

    values = list(dictionary.values())

    norm_range = norm_max - norm_min
    map_min = min(values)
    map_range = max(values) - map_min
    range_factor = norm_range / float(map_range)

    normalized_map = {}
    for key, value in dictionary.items():
        normalized_map[key] = norm_min + (value - map_min) * range_factor

    return normalized_map