import random


def generate_names_set(words, set_length, random_words_per_name):
    """
    Generates set of branch names.
    :param words: Set of words to sample from.
    :param set_length: Length of returned set.
    :param random_words_per_name: Amount of random words per branch name.
    :return: Set of branch names.
    """
    names_set = []
    i = 0
    while set_length > i:
        random_name = '-'.join(random.sample(words, random_words_per_name))
        if random_name in names_set:
            continue
        names_set.append(random_name)
        i += 1
    return set(names_set)