in reply to Re^4: Challenge: Generate a glob patterns from a word list (UPDATE)
in thread Challenge: Generate a glob patterns from a word list

Maybe a suffix tree could help?
map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

Replies are listed 'Best First'.
Re^6: Challenge: Generate a glob patterns from a word list
by LanX (Saint) on May 05, 2021 at 11:36 UTC
    Please see my update here, that's more complicated than I thought.

    This reminds me of what my prof called a "Minimales Wort Problem" in my studies, but I couldn't find a link for it.

    Basically finding the shortest algebraic term expressing a solution, the {,a,b} clauses are operations here.

    Problem now is that I doubt that there is always a unique minimal solution, which can be reached by a path of successive optimization steps.

    This means you have to try different steps in different order, which will indeed explode the complexity.

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery