Python Forum
Anagram Solver with Python - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: General (https://python-forum.io/forum-1.html)
+--- Forum: Code sharing (https://python-forum.io/forum-5.html)
+--- Thread: Anagram Solver with Python (/thread-33805.html)



Anagram Solver with Python - BlazingWarlord - May-28-2021

https://thepygrammer.blogspot.com/2021/04/simple-anagram-solver.html

This Anagram Solver uses the itertools module to find all possible unscrambled words of any inputted scrambled word.

Share with others if you like it...


RE: Anagram Solver with Python - perfringo - May-28-2021

No, I personally don't like it. Not at all. Algorithm is just brute force. Creating list of all permutations????

>>> len(list(permutations(list('abrakadabra'))))
39916800
Yes, almost forty million. On any machine it will take considerable time and memory. Try to do it with longest word in common use incomprehensibilities and you'll see....

I strongly suggest not to share it with anybody. Instead rewrite the code using better algorithm.


RE: Anagram Solver with Python - BlazingWarlord - May-29-2021

(May-28-2021, 07:14 PM)perfringo Wrote: No, I personally don't like it. Not at all. Algorithm is just brute force. Creating list of all permutations????

>>> len(list(permutations(list('abrakadabra'))))
39916800
Yes, almost forty million. On any machine it will take considerable time and memory. Try to do it with longest word in common use incomprehensibilities and you'll see....

I strongly suggest not to share it with anybody. Instead rewrite the code using better algorithm.

So, where do I get suggestions on how to make it better. I don't call myself an expert and I am always willing to learn better ways to improve my code and algorithms. I am open to any suggestions if you have any...