Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If you think of this as a path finding problem you could try an A* algorithm. </p> <p>(A heuristic based search of the answer space.)</p> <p>Also, do you just want to find a solution or the best solution? </p> <p><strong>EDIT</strong></p> <p><em>I don't feel like changing this, but I see that my example is bad since a single step solves it. Ignore that issue when looking at the example.</em></p> <p>Quick overview of how A* works (and slightly applied to this problem)</p> <p>To use A* you need a function that evaluates a given state (of completion). You want a higher value for states which are closer to the goal.</p> <p>For this problem two example functions</p> <ul> <li>(every letter that is correct * 1) - (number of letters different from goal * 10)</li> <li>(every letter that is correct * 100) - (number of letters different from goal)</li> </ul> <p>As you can see the first favors word size being close over correct letters The 2nd favors letters correct.</p> <p>Not sure which is better -- tho you could do a balanced formula too.</p> <p>Lets say we are trying to get from bot -> boat</p> <p>You would then evaluate all possible changes of boy, lets use the first function so two examples you would evaluate would be boot and bat (and others.) boot has a value of 3 and bat has a value of -7. Boot is better (according to this function) so then we would evaluate all possible changes of Boot (before any of the others) and find the solution. </p> <p>Clear as mud? Maybe Wikipedia explains it better.</p> <p><a href="http://en.wikipedia.org/wiki/A" rel="nofollow noreferrer">http://en.wikipedia.org/wiki/A</a>*_search_algorithm</p> <p>Side Notes: </p> <ul> <li><p>A* will find the best solution if the function is designed right, if such a function exists for a give problem. This is the neat feature of A*.</p></li> <li><p>An A* enhancement is to short circuit looking at states (for example in the case above -- positive 3 is a very good score (4 is the max score) so your algorithm could stop looking at other states and move on to the one that is very close.</p></li> <li><p>The two hard parts of A* are 1) finding the right function and 2) being able to enumerate all the possible states. I think 2 is not so hard to do with a good dictionary file and some fast hashing/searching functions. </p></li> </ul>
    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. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

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