BACKTRACKING ballet choreography (The Four Queens)

  Рет қаралды 55,349

AlgoRythmics

AlgoRythmics

Күн бұрын

Пікірлер: 63
@wearenakamas3428
@wearenakamas3428 5 жыл бұрын
This is the reason I studied computer science
@ZeroRiskAppetite
@ZeroRiskAppetite 5 жыл бұрын
Where was this during my Data Structures classes
@RealChristopherRobin
@RealChristopherRobin 6 жыл бұрын
We want more!
@hugoball4019
@hugoball4019 6 жыл бұрын
this is so satisfyingly systematic
@idoabelman1171
@idoabelman1171 3 жыл бұрын
"The Four Queens Ballet" really sounds like it could have been some classic ballet from the renaissance lol
@tomi2592
@tomi2592 6 жыл бұрын
Beautiful! Amazing! For me it's the best of your newly uploaded videos, I just can't stop watching.
@durvsh
@durvsh 5 жыл бұрын
3 dancing queens were sacrificed during the making of this video.
@melancholyRed
@melancholyRed 5 жыл бұрын
4 dancing queens, actually.
@abc-uz6bg
@abc-uz6bg 5 жыл бұрын
Finest video I've seen. Thanks
@FirstLast-fg5vh
@FirstLast-fg5vh 5 жыл бұрын
Recursion. Gezz One of the simplest concepts, and code, but g-damn so hard to do. I cooked my puter at 64 Queens. I mean it smoked. After 6 hours of 90% processer load.
@dinohunter7176
@dinohunter7176 5 жыл бұрын
Superb, multumesc!
@franciscorojas8025
@franciscorojas8025 3 жыл бұрын
this is sooo bad ass.
@shivangibalodia6601
@shivangibalodia6601 5 жыл бұрын
Hey you are doing an amazing job. Good luck to you. Looking forward to more such videos. :)
@prathameshparulekar9247
@prathameshparulekar9247 5 жыл бұрын
You all are awesome
@caigner
@caigner 5 жыл бұрын
Hypnotic music!
@Amitsa299
@Amitsa299 5 жыл бұрын
good music and dance.
@vpshastry
@vpshastry 5 жыл бұрын
I feel wierdly amused!! :D
@sth128
@sth128 6 жыл бұрын
Maybe do a video on dancing links (Algorithm X - Donald Knuth) algorithm? It practically begs for it with that title... Though you might run out of dancers due to space complexity XD
@cibisuren2334
@cibisuren2334 5 жыл бұрын
wow!
@prathameshparulekar9247
@prathameshparulekar9247 5 жыл бұрын
Amazing!
@jennyjingxu1565
@jennyjingxu1565 5 жыл бұрын
awesome! want more!
@dimitrisdimitriou6969
@dimitrisdimitriou6969 5 жыл бұрын
This is amazing
@letao12
@letao12 4 жыл бұрын
Nerdy boy with thick glasses walks into dance class. Girls: "Hi!" Boy: "I... um... do you want... I mean... I'm looking for... dancers for... uh... a class project" Girls: "Oh yeah? Which class?" Boy: "computer... science?"
@letao12
@letao12 4 жыл бұрын
Girls: "Sounds fun, what do you need us to do?" Boy: "OK, so there's going to be this checkerboard, and you dance to the first square, and you dance to the next row, then you look at each other and you push her to the next square, then you look at each other again and you push her again, then look at each other again and wave, then you go to the third row and you look at her and she pushes you to the next square, then look at her again and wave, but then you look at her and she pushes you, so you go to the next square and look at her again and now she pushes you, then you go to the next square and she pushes you off the board, so then you stay off the board and she goes to the next square, and now you go to the third row, and you look at her..." Girls: "So, like solving the 4 queens problem using a backtracking algorithm?" Boy: "...... yes"
@robertlozyniak3661
@robertlozyniak3661 6 жыл бұрын
The dancers must have a good amount of memorizing to do to keep the timing, etc., right in their heads, as there do not appear to be visual cues as to when they are to "wake up".
@nydydn
@nydydn 5 жыл бұрын
They don't need to memorize the timing. That's what the music is for, to keep the rhythm.
@beeble2003
@beeble2003 3 жыл бұрын
@@nydydn They need to memorize the timing in the senses of remembering what part of the music they wake up at. Actually, though, I don't think they need that. When they're kneeling with their heads bowed, thyey can look behind them.
@tmjcbs
@tmjcbs 5 жыл бұрын
It's a good thing they didn't use Sudoku, another candidate for the backtracking algorithm...
@viniciuskf1741
@viniciuskf1741 3 жыл бұрын
Bah show de bola
@The_Foreman
@The_Foreman 5 жыл бұрын
Just a quick Question that'll never get answered. After the first fully queen checks her first 2 squares (half the board) I think any other possibilities would be mirrors of all previous answers. If it were to backtrack down to her, you can half the time by breaking if she goes over the halfway point.
@yaroslavpanych2067
@yaroslavpanych2067 5 жыл бұрын
Well yes, in this particular task there is 1 other solution, and it is mirrored to the first. But only in this. Depending on task, it is possible to run algo until 1st solution and quit, but usually it is coded to generate each and every possible solution (or reach state where no solution is possible). Especially when the best solution is required to be found. You must understand, there are 2 cases when algo can stop: 1) found solution(s), don't need anymore - as shown here 2) found all solutions, i.e. backtracked to state 'before-start', in our case, 1st queen explored all 4 cells, and backtracking can step back anymore. You cannot make conclusion during any other stage. If you know about certain properties of solutions, you can 'optimize' it, but it is task specific optimization, which cannot be applied to other tasks.
@The_Foreman
@The_Foreman 5 жыл бұрын
@@yaroslavpanych2067 I didn't mean that the only other solution would be the mirror, only that no matter the size of the board the first queen would only have to go halfway across before all possible answers would be found. At which point you can stop running the simulations. If we are changing the shape, or adding dimensions, no matter the situation rules would have to change. I was simply making note of an interesting aspect of the current board at play.
@frechjo
@frechjo 5 жыл бұрын
@@The_Foreman If you restrict the first queen to the fist half of the row, you eliminate all mirror solutions on one axis (from the two axis of symmetry and 4 rotations). But the point of the video is to show how a backtracking search algo works in general. It's a general technique applicable to many different kind of problems, not just this specific one, so any form of heuristic or optimization you could introduce to solve the n-queens problem would detract from the intention. If your intention is to just to solve an fixed sized n-queen problem, there'll be many variations that could be more efficient than a general backtracking method. For big n's, for instance, you could use constraint propagation.
@paulschuler1459
@paulschuler1459 5 жыл бұрын
I was surprised you did not have the three dancers on the right get up again and move around over the top to the left. Eventually, the same result would have been achieved.
@nydydn
@nydydn 5 жыл бұрын
when backtracking is explained, a teacher would say that a candidate is abandoned after no suitable solution is found for that candidate. Of course, in a computer the candidate is just a bunch of bits (and not even that), and all the bits are still in your RAM, but this ballet follows strictly the explanation that is apparently most understandable by humans.
@superniokas
@superniokas 5 жыл бұрын
party pooper
@KrzysiuNet
@KrzysiuNet 3 жыл бұрын
"Needs more flanger" - The Bruce Dickinson. (but honestly, if they would ease a bit on flanger, it could be a pretty nice version of C&M)
@Mojzesz66
@Mojzesz66 7 жыл бұрын
How can I find the soundtrack?
@osztianpalmarozalia4947
@osztianpalmarozalia4947 7 жыл бұрын
Prokofiev - Dance of the Knights
@wun_zee3599
@wun_zee3599 5 жыл бұрын
@@osztianpalmarozalia4947 I find that funny concidering the name of the puzzle.
@boy_with_thorn
@boy_with_thorn Жыл бұрын
I still dont understand how to find all possible combinations using this
@tonydekker7792
@tonydekker7792 Жыл бұрын
Record the solutions you find, but just keep backtracking.
@boy_with_thorn
@boy_with_thorn Жыл бұрын
@@tonydekker7792 ohh, got it, thanks!
@jakestuck0309
@jakestuck0309 4 жыл бұрын
I wonder how knapsack would look as a dance.
@simonebertolucci5152
@simonebertolucci5152 5 жыл бұрын
This dance is popular but inefficient, as it takes 2^n steps. A less naïve approach could complete the dance in polynomial time.
@mertaliyigit3288
@mertaliyigit3288 5 жыл бұрын
The problem is NP-complete
@simonebertolucci5152
@simonebertolucci5152 5 жыл бұрын
@@mertaliyigit3288 I was convinced of that, too! But apparently, that is a common misconception. dl.acm.org/citation.cfm?id=101343
@oooBASTIooo
@oooBASTIooo 5 жыл бұрын
@@simonebertolucci5152 That is a probabilistic algorithm.. As it clearly states in the abstract.
@xerxes8075
@xerxes8075 4 жыл бұрын
Dimmu Borgir?
@SmashhoofTheOriginal
@SmashhoofTheOriginal 3 жыл бұрын
Me at 2am
@LukasThiersch
@LukasThiersch 5 жыл бұрын
It's a bit slow... Is this Vista?
@comofuncionaelmundo3895
@comofuncionaelmundo3895 6 жыл бұрын
Ahora entiendo porque el problema de las mil reinas es NP Hard
@Eu_Sunt_Dracul
@Eu_Sunt_Dracul 5 жыл бұрын
Bliss
@4-7-5anhbao5
@4-7-5anhbao5 3 жыл бұрын
Đã xem
@ayamirisukahyejunghyuneuneun
@ayamirisukahyejunghyuneuneun 4 жыл бұрын
can upload sort algthm agn p,les
@farche2
@farche2 6 жыл бұрын
That's more like brute force enumeration than backtracking.
@nydydn
@nydydn 5 жыл бұрын
"Backtracking" is a very well known name for the algorithm they're describing. Feel free to name it however you feel appropriate, but by convention backtracking is what they dance.
@beeble2003
@beeble2003 3 жыл бұрын
No, it's backtracking. Brute-force enumeration would put queens at positions 1,1,1,1 and check for validity, then at 1,1,1,2. Backtracking never even considers those states, as it rejects anything beginning 1,1 without looking further.
@garychap8384
@garychap8384 3 жыл бұрын
More fun at 2x speed ... ... but anyone that codes an n-queens solver like this, should probably switch career : / And if they also use call recursion, then they should be banned from using compilers for life XD
@beeble2003
@beeble2003 3 жыл бұрын
No reason not to use recursion. It's natural, and the recursion depth is very limited.
@bruvvereccles5847
@bruvvereccles5847 6 жыл бұрын
Pity you ruined the music with that clicky accompaniment.
@ratlinggull2223
@ratlinggull2223 5 жыл бұрын
I love how you called the high hats
Insert-sort with Romanian folk dance.flv
4:04
megaovermoc
Рет қаралды 109 М.
Shell-sort with Hungarian (Székely) folk dance
4:31
AlgoRythmics
Рет қаралды 616 М.
VIP ACCESS
00:47
Natan por Aí
Рет қаралды 30 МЛН
Enceinte et en Bazard: Les Chroniques du Nettoyage ! 🚽✨
00:21
Two More French
Рет қаралды 42 МЛН
The Concert (or The Perils of Everybody)
5:30
Balletoman.com
Рет қаралды 201 М.
Doctor Reacts To America's Funniest Home Medical Videos
11:18
Doctor Mike
Рет қаралды 498 М.
Rare Documentary on the Bolshoi Ballet Academy [1967]
1:09:35
Vaganova Blog
Рет қаралды 154 М.
[HD] Tonya Harding - 1994 Lillehammer Olympic - Free Skating
8:23
Mintaka Alnilam
Рет қаралды 16 МЛН
Mistake Waltz
10:04
markie polo
Рет қаралды 4,8 МЛН
21 Levels of Ballet: Easy to Complex | WIRED
13:38
WIRED
Рет қаралды 1,1 МЛН