negmas.helpers.shortest_unique_names(strs: List[str], sep='.', max_compression=False, guarantee_unique=False)[source]

Finds the shortest unique strings starting from the end of each input string based on the separator.

The final strings will only be unique if the inputs are unique.

  • strs – A list of strings

  • sep – The separator used to separate fields in each string

  • max_compression – If True, each string will be further compressed by taking the shortest prefix that keeps the strings unique (if they were originally unique)

  • guarantee_unique – If given, random characters will be postfixed on strings to guarantee uniquness


given [“”, “d.e.f”, “”] it will generate [“b.c”, “f”, “”] if max_compression was false and will generate [“b”, “f”, “d”] if it was True