Backtracking Explained - Solving N-Queens and Knight's Tour using Python
HTML-код
- Опубликовано: 30 июл 2024
- Github: github.com/challengingLuck/yo...
Click here or I will steal your cookies: bit.ly/2Z1uzKM
If you want to send me a tip. You absolutely don't have to!
Etherium: 0xae6b07d67301d4f5aed36254b19f05cc593732cb
Music: www.bensound.com
Thank you dude. Your video is short and to the point. 🎉❤
Such a compat video man, really liked it!!
Thanks for the comment.
good day, what are the other backtracking algorithm that i may use to solve the local maxima of the steepest ascent hill climb? instead of using the depth-first search, can you suggest another backtracking?
Thanks for this video - very informative. Why do you return True and not False if the counter is above 64? Should this not end the loop as the maximum number of moves has been reached?
In the 8x8 case 64 is the maximum number of moves. Should have changed it to N to generalize it.
Me: Mom can we get Code Bullet?
Mom: We have Code Bullet at home
Code Bullet at Home:
Even copying his upload schedule
I do understand the thinking of the algorithm and the code is amazing. But I am quite confused that why the board metric could change during the function 'solve'. As it is a parameter for the function which the return is a bool variable True or False. Why would the argument 'board' be changed during the running of function? I am curious.
greetings,
in the knight tour example, how did we choose the 3,2 as the starting point? i mean shouldn't we iterate through the starting points as well?
thanks in advance
Depends on the approach!
Do you have a background in math or comp sci. Love the vid.
I do!
thank you for this video
My pleasure! Thank you for the comment.
Great video, appreciate UWU
Thank you so much.
nice one, but the "n" in your solve function is not needed..it doesn't appear anywhere!
That’s true. In the knights tour it would take long to solve an 8x8. Didn’t even want to try the 16x16. That’s why I changed my mind mid way and didn’t even include n.
how would you implement this for sudoku
That's for you to find out, isn't it
Great videos
Thanks!
does this find a path for every starting point
yep
Why do you choose this music for this video?
Are you teaching how to use a sword?
lol
do you remember how long your knight's tour algorithm took
A few seconds I believe. The code is linked here. You can just try running it.
I will post my algorithm based in backtracking + restrictions to solve sudokus in python: github.com/dogia/sudoku_solver
Very clean! Good job