Note that there are some explanatory texts on larger screens.

plurals
  1. POGiven a dictionary, find all possible letter orderings
    primarykey
    data
    text
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. COYou could construct a (not-necessarily-connected) DAG of the partial orders implied by the words you have, then exhaustively find all the routes from each node (letter) through all other nodes using the rule that you can go to any node except one that's "upstream" of you or any node you've already visited. Hence you can immediately prune any paths where you'd step to a node that has "upstream" of it a node you haven't used yet, beating brute force. There's probably something cleverer, though.
      singulars
    2. COI don't think you can do better then n!, but identifying if a pattern is valid or not is going to add some complexity, so I don't believe what you're suggesting is `n!`, either. It sounds like `m*n^2 * n!`, where `m` is the number of rules, although you don't really specify how you would validate each one.
      singulars
    3. CO@jswolf19: you can't do better than `n!` for the simple reason that if the input is a single word `ABCDE` then all `5!` orderings are possible, so you have to output them all. But you can hope to do "better" than `n!` by some term that depends what constraints are imposed, accepting that the term is `O(bupkis)` for some inputs. In the best case, where the input is 5 one-letter words, `A B C D E` then we should be able to answer pretty quickly.
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload