As a software engineer I enjoy watching these videos. I find them relaxing. You are really good at teaching. Keep up the good work!
@TheCodingTrain
7 жыл бұрын
That's so nice to hear thank you!
@insidioso4304
7 жыл бұрын
Derick Hess Me too! Actually it is relaxing but at the same time it makes you feel the need to code! I would call this new way of relaxing: "prograxing"
@ericowens9050
6 жыл бұрын
Derick Hess Same here. Makes me feel better to not be alone in that feeling. :-)
@Pradeep.Poonia
5 жыл бұрын
@@TheCodingTrain Does Derick look like the guy who wrote this paper : kzitem.info/news/bejne/yKWL0q2mbaSonIo @DerickHess
@amandixit3555
3 жыл бұрын
@@TheCodingTrain choo choo , abey bada ho ja bhai. choo choo
@golfball_diver
5 жыл бұрын
i know this is late, but i think the travelling salesman problem requires you to go back to your starting location after visiting every city.
@alirizvi710
2 жыл бұрын
yeah otherwise its just a minimum spanning tree problem
@themanwiththeplan8404
2 жыл бұрын
isn't that a hamilton cycle?
@VizGhar
2 жыл бұрын
TSP is shortest hamiltonian cycle yes
@tiffsea8876
4 жыл бұрын
I love that you chose to use 'salesperson' as opposed to traditional 'salesman' term - obviously not all sales persons are 'men'. Thank you for thinking at that level! Makes a huge difference for mental processing!
@clementbuchanan587
3 жыл бұрын
Seriously Dan, I luv, luv, luuuv the way you teach. I am a software developer in training and you make it so much more palatable to digest. I truly hope you continue this great work you're doing man. You're my go to resource when I need ANYTHING for coding.
@kevnar
3 жыл бұрын
I took the formula for line intersection from your Ray Casting video and I just made the TSP algorithm swap the tails of two random intersecting lines in the path. Then I gave it 999 points, and it unscrambled the path in a matter of ten minutes or so. It's not the shortest path, but the amount of progress for that many points is amazing.
@jhokeypokey
5 жыл бұрын
I come from the future to let you know that this is still interesting.
@pretzels3273
5 жыл бұрын
Jared Fairchild and Pokémon go is relevant again
@Seedx
4 жыл бұрын
Welp it’s 2020
@t__v_____290
4 жыл бұрын
Not anymore buddy
@bechirjamousi6696
4 жыл бұрын
TSP needs to get back to its initial position and in this case, it is not , am i right?
@jetison333
3 жыл бұрын
Further in the future here, can confirm its still interesting
@DodaGarcia
2 жыл бұрын
1:10: "Oh a Pokémon Go analogy, this will be easy to follow!" 1:15: "N-dimensional? I'm lost"
@kevnar
6 жыл бұрын
Sally has 12 boyfriends. In order to keep them from finding out about each other, she insists on having her visits at the guy's houses. What route does she visit them in that saves her the most travel time so she can maximize the time she spends with each guy?
@MrCmon113
6 жыл бұрын
Damn, Sally is even worse than Chuck, who's always trying to spy on Alice and Bob.
@Violet-tb8xo
5 жыл бұрын
@@MrCmon113 eve?
@kyokarson8233
5 жыл бұрын
@@MrCmon113 we used to have Darth spying on alice and bob when the love birds wanted to talked :p
@arumifitria5433
5 жыл бұрын
Thanks u inspired me a lot
@kavinbharathi
4 жыл бұрын
_why? Just why?_
@TheDogn
7 жыл бұрын
7:13 The bell was a hilariously unexpected touch.
@nraynaud
4 жыл бұрын
I used a traveling salesman in a CNC application, when milling a bunch of pockets, to choose the order of the pockets.
@bikachu_
3 жыл бұрын
you're a great teacher and thanks for being so enthusiastic about programming, it really keeps me going!
@seanhudson8453
5 жыл бұрын
Came here for my uni course. Stayed for the flamboyancy
@ronraisch510
7 жыл бұрын
I yelled "SUM!!!" at the screen for like 4 min lol
@omshrisn2909
7 жыл бұрын
I like your approach of programming!!! , understood more clearly than what teachers teach in my college thanks 😃
@mihaitmf
5 жыл бұрын
Man, that's awesome! So simple, yet so neat.
@LorenzoLeonardini
8 жыл бұрын
"What are the things in your world that you need to find the path way through?" everything in my room I guess
@sina-qh8wm
3 жыл бұрын
I created a presentation in university based on this video, thanks a lot :)
@nataliekidd2135
7 жыл бұрын
I really love these videos, they are super informative. I'm a Sophomore in college earning my degree in Computer Science. Even though I haven't learned Java or JavaScript, I really appreciate these videos.
@heavencanceller1863
3 жыл бұрын
These videos are both priceless information and entertainment
@anonymousvevo8697
4 жыл бұрын
i come from 2020 and your video is still awsome
@Lehiannel
7 жыл бұрын
Perfect! I am studying it for a project in my R coding class. Your logic explanation was clear, didatic and easy to understand. I enjoyed it :) Keep making videos like that!
@Ensii
7 жыл бұрын
Your enthusiasm is priceless :) nice video
@TheCodingTrain
7 жыл бұрын
Thank you!
@sherhy3689
7 жыл бұрын
patient, adequately funny, and informative, please continue this as long as you can --tokyo
@sairamankilambi5007
4 жыл бұрын
2020 it is! Travelling back in time to understand Travelling Sales Person problem...
@Hyuts
5 жыл бұрын
I finally downloaded processing! Very cool and easy to install plus allows me to follow along and use all github projects. Thanks!
@per1sher
8 жыл бұрын
Fascinating video - always enjoy your channel - your enthusiasm is infectious :)
@nowar9220
7 жыл бұрын
first channel ive ever subscribed to!! Really worth it :) Thanks! Apreciate it!!
@glenneric1
2 жыл бұрын
I think one way of avoiding the trap that you see at 21:18 is to sometimes swap more than 2 points. Though that actually isn't a two point trap now that I look at it.
@Teth47
7 жыл бұрын
So it turns out Windows 10's calculator can handle some pretty big numbers, 3000! is ~4.19^9130. Not bad.
@lumschente
5 жыл бұрын
My Android calculators max is 13547! = 1.085^50089
@Tuberex
4 жыл бұрын
4,1493596034378540855568670930866 with 9130 zeros
@Tuberex
4 жыл бұрын
@@lumschente the biggest on windows 10 is 3248
@manurok1901
8 жыл бұрын
Love these videos! Been binge watching while I'm off work the past couple of days :p Keep it up man, you're inspiring
@memporium240
3 жыл бұрын
You can actually reach an upper bound of n^2*2^n which is a better bound than n factorial.
@nickgooch6928
7 жыл бұрын
You should use something like this to solve the Maze Generator you made ; )
@rafageist
Жыл бұрын
If you don't have the restriction of returning to the starting city, then you have leftover combinations. A B C would be the same as C B A, and so on.
@sujals7108
5 жыл бұрын
instead of writing 'bestEver = cities.slice();', you can just write 'bestEver = cities;'. It copies the array exactly
@rankail
5 жыл бұрын
He did it that way first and then "corrected" it. XD
@aryamankejriwal5959
7 жыл бұрын
For the latest thing, the points would be shops where the Nintendo switch is possibly present...
@Thijs-Kuiken
5 жыл бұрын
What this video needs is.... more talking with the arms and hands. ;-) interesting stuff! though a lot flies over my head. You're an enthusiastic teacher.. fun watch.
@amateuraaron6972
2 жыл бұрын
Hey Dan! Just wanted to say its 2022 about 6 years later Pokemon Go is still relevant enough for this video hahaha
@Nerdthagoras
7 жыл бұрын
I plan to use this to find the optimal route while shopping for various items at Walmart!
@TheCodingTrain
7 жыл бұрын
Haha, look forward to hearing how that goes!
@aryamankejriwal5959
7 жыл бұрын
22:21 The bell makes a sound, or you might understand it better as follows: class Bell{ static void makeSound(){ System.out.println("Ding"); } }
@luiginotcool
3 жыл бұрын
Hey I’m from the future and this is actually really useful for solving shwolobatata-hmm problems
@ErikHarloff
8 жыл бұрын
You spoke about providing the Processing code to this example as well. Unfortunately, I didn't find is on github (github.com/CodingRainbow/Rainbow-Code/tree/master/challenges/CC_35_TSP/CC_35.1_TSP). Would you be so nice to provide the Processing code for TSP? Awesome!
@omaryahia
3 жыл бұрын
your videos are amazing, thank you Daniel
@josbex1684
7 жыл бұрын
Interesante gracias... aplicare ahora la heuristica anneling para calcular mas rápido la ruta mas corta
@amit_awadhi
3 жыл бұрын
It should be renamed to "Catching-Pokemon-Problem"😂👌
@RetroGamingClashOfClans
6 жыл бұрын
traveling salesman problem is one of the hardest problem in math having no exact method/equation for finding the EXACT shortest route and its is one of the NP problems.... if you can find a quick way to solve this problem for any number of points, it will proof that P = NP and that will get you million dollars as it is one of the 1million$ millennium problem
@joonsungkim1218
7 жыл бұрын
don't you need to return to the starting point?
@kevnar
4 жыл бұрын
No. The salesman left his wife and family and never plans to go back.
@Caleb-zj9xi
4 жыл бұрын
That’s called something else.
@Matt-yp7io
4 жыл бұрын
@@Caleb-zj9xi no its not
@maxkolbl1527
7 жыл бұрын
Pokemon Go was actually the real reason I got interested in this problem... ^^'
@davidstephen2219
8 жыл бұрын
Simple and easy as always. Keep go on. I wish I was one of your students in your class. );
@emmahii
7 жыл бұрын
There's no way, recalculating the distance between ALL points every time the order changes is in any way efficient... Calculating the distance between every pair of points just once and then just adding them up is much faster.
@xiandongzhang5927
6 жыл бұрын
You only need to store direct distance between one city and another, so , it's n*(n-1)*0.5
@cesarrios3449
7 жыл бұрын
Where are u programming this? Are you using an text editor or something else? I would appreciate so much if u can answer me. Excelent video, greetings from Mexico :)
@TheCodingTrain
7 жыл бұрын
Try some of these workflow videos! (let me know if they are helpful) sublime text: kzitem.info/news/bejne/tnl-4KCLonZ1ZGU atom editor: kzitem.info/news/bejne/xWmFyXqbsZdqfKA brackets: kzitem.info/news/bejne/z6OQyJyDmqCHlo4 codepen: kzitem.info/news/bejne/lp2cu5uEqYVnno4
@izoumashka
7 жыл бұрын
well you can narrow down possible paths by just working out which are "edge" vertices and starting from them.
@Gegellibu
8 жыл бұрын
For the different path calculations the formula is actually n!/2 as ABC is the same path as CBA
@vernonalbayeros4719
7 жыл бұрын
Still, since when talking about time and space complexities we are referring to very large N counts, the problem's upper bound is still called n! or factorial, since any constant (in your comment's case = (1/2) * n! ) multiplying the n is "irrelevant"
@michaellazar9078
6 жыл бұрын
does the salesman have to end up at home after hitting each point once or does he travel from job to job forever? #2 if you had a short repeatable solution. how would a person responsibly disseminate their findings?
@tythedev9582
3 жыл бұрын
I am a simple man. I see your videos in my recommendations. I watch. LMBO @16:11 "shmoley-patat-in"?
@unchaynd7266
Жыл бұрын
5:29 I am here because I'm trying to make a program that can come up with the optimal arrangement for a bunch of chunks of music to form a song, such that the arrangement follows some given rules (e.g., what chunks are allowed to follow what other chunks, minimal repetition of chunks)
@yerkoantonioalvarez
5 жыл бұрын
Great video! But tsp requires to return to initial citie
@ruyuehong2392
6 жыл бұрын
The dynamic network graph is amazing. I wonder how to create those dynamic animation. Is it a special drawing software or particular packages of some languages?
@DodaGarcia
2 жыл бұрын
I know this is 4 years ago, but just in case you didn't find it, this is p5js! It's a free JavaScript library that makes it easy to create these drawings, and it also has an in-browser editor you can use to get started. It's a fantastic tool and this channel has lots of tutorials for it.
@kaal_bhairav_24
4 жыл бұрын
The time complexity can be reduces from n! to (n-1)! since we can fix a point and permute the remaining (n-1) points.
@BradHouser
3 жыл бұрын
And assuming the distance from A to B equals the distance from B to A, you can divide (n-1)! by 2.
@Mosch822
7 жыл бұрын
Great Video. Wanna see more
@louis1001
7 жыл бұрын
Starting 2017 and people already finds old Pokémon GO :/ Great Video!!
@toshb1384
7 жыл бұрын
"in the future, *some many years from now*, people will be complaining about how pokemon go is irrelevant." LOL, pokemon go has become irrelevant literally after a few weeks
@mintyplays4682
7 жыл бұрын
Not anymore! It used a Max Revive and brought generation 2 out! :D
@ryuuji159
7 жыл бұрын
and... stil irrelevant
@arddison3894
6 жыл бұрын
and... now i actually had forgotten it ever existed.
@KnakuanaRka
5 жыл бұрын
I think it took a few months, but yeah, it blew over pretty fast.
@nufik8097
3 жыл бұрын
It's gone
@garmurinn
3 жыл бұрын
I think you forgot to put console.log(recordDistance); between line 69 and line 70 in #35.3 in the web editor on the website.
@epicmonckey25001
7 жыл бұрын
Noob here, what does the index.html file look like. I have it, but when i try to open it in my browser all i get is a black box. PLZ HELP!
@jschoete3430
7 жыл бұрын
Hi ! Can I ask what studies you did, and what kind of work you do? I'm myself studying IT, and I love these videos and I would like to code like this all day long. also if it's not too much to ask, how much do you make with your job? I know it's a bit of a taboo question, so feel free to ignore ^^
@irfankarmali4849
2 жыл бұрын
Wouldn't using a algorithm be better than using a randomizer or trying every possibilty. Like maybe the Greedy Algorithm or the Bellman-Ford Algorithm.
@stephfong4577
7 жыл бұрын
Wow, I hope I knew about your channel earlier!
@kevnar
2 жыл бұрын
Scwalla Vatatan! The next new thing! I'm going to create it, just to prove Shiffman right!
@exorcistgg9833
5 жыл бұрын
lol I was trying to design a program that calculate the shortest distance to go to all pokestop😂 And then I found your vid
@MikaelWallgren
6 жыл бұрын
About 3:00, shouldn't it be n!/2? ABC and CBA is the same path but reversed? I like your videos, keep up the good work!
@BradHouser
3 жыл бұрын
And so are ACB, BAC, BCA, and CAB. WIth three cities all paths are the same! You must return to the starting city.)
@chopper3lw
5 жыл бұрын
TSP is the minimum CIRCUITAL path through the points IT IS NOT the minimum path through the set. It's only the CIRCUITAL part that makes it NP-HARD. There's non NP solutions to minimum path.
@satishkpradhan
2 жыл бұрын
I work with TSP problems with capacity, multiple time windows, service times and profit. The problem escalates so much faster but with some smart meta heuristics, you can get a nice solution really quick. If someone wants the state-of-the-art method message me... My current best is 100 nodes optimality for simpler problems with 1 vehicle .... Generally improving and check of a route of 20-30 points with time, capacity and profit take less than a millisecond.... so you can try 1000's improvements each second.
@gadeichhorn
5 жыл бұрын
great stuff! would like to see ant colony simulation for the same problem or event multiple sales doing each multiple visits.
@Jimanator
8 жыл бұрын
since then start and end of the path are ambiguous, the number of paths should actually be half of n factorial.
@Jimanator
8 жыл бұрын
a path and its mirror are the same. if you can mark both as checked when either one is, you can double your programs speed
@kamoroso94
8 жыл бұрын
+James Butler (Jim) Same asymptotic runtime though.
@vernonalbayeros4719
7 жыл бұрын
n!/2 is still said to run in n! complexity time, though. Keep in mind that when we talk about complexity we are talking about very, very large n counts, large enough that any constants multiplying n will not matter (in this case, n!/2 = n! *1/2).
@deathvall3y
5 жыл бұрын
Energetic.... and lots of love for you
@VictorNascimentoo
5 жыл бұрын
The annoying day Pokémon Go mentions are supposed to kick in is today.
I'm in the middle of the video, so I'm not sure if you clarified the actual definition of "shallow copy". A shallow copy is a copy of a variable or array of variables that point to the same address in memory, thus, if you change a value of the original, you change the value of the copy. conversely, a deep copy will actually copy the original to a new address in memory, and allows you to change one of the variables without changing the other.
@TheCodingTrain
6 жыл бұрын
Thanks for this info!
@MajorMandyKitten
6 жыл бұрын
The Coding Train this channel is pretty cool! Keep up the good work!
@gunot5656
7 жыл бұрын
this guy is incredibly entertaining, lol
@makarandlahane3904
7 жыл бұрын
as you said we want the total sum of all distances,then why haven't you returned the sum from calcDistance function?
@-rXr-
8 жыл бұрын
Hi denial, love your vids, can you make a video on A* path finding algorithm plz
@DBear8008
3 жыл бұрын
Watching in 2021, PokemonGo is not quite irrelevant but in the back of many peoples minds
@Habbxor
7 жыл бұрын
Would Prim's algorithm work better? I searched up and this is an O(V^2), and Prim's is O(|E| log |V|). (V = vertex, E = edge/path b/w points)
@stoobertb
7 жыл бұрын
Prim's is slightly different. Prim's will give you the Minimum Spanning Tree, which will be the shortest path that connects all cities to at least one other city, however, it may not be the shortest when traversing all cities as you may have to double back on yourself. Think of Prim's as a way of connecting all cities so all cities can be traversed using the least amount of road, however traversing that road may not be the shortest route as going directly.
@Habbxor
7 жыл бұрын
You're right. Prim's could lead to having to travel the same path again because it doesn't guarantee a linear path.
@Tin98Tin
7 жыл бұрын
Please do more in Processing!
@amit_awadhi
3 жыл бұрын
This video gives me confidence😂 You're exactly like me, always trying to do things bruteforce way till they work fine🤟
@coenraadloubser5768
4 жыл бұрын
Array sorting method is going to miss instances where a return trip to a city is shorter than a connecting trip...
@_rlb
2 жыл бұрын
True, but the salesperson problem specifically states that every city has to be visited exactly once.
@assimez-zaky8363
3 жыл бұрын
This is relaxing
@codycodes7527
3 жыл бұрын
this will be remade with you being an imposter and finding how to kill crewmates
@Invenitive
6 жыл бұрын
Why did you do linear paths instead of round trips? All of the examples I've seen of the TSP use round trips
@bhavyabhatia2337
7 жыл бұрын
Is there a video for this solution using DP, not brute force ?
@johnkarippery9919
4 жыл бұрын
can you please make a video about VRP algorithm?
@WahranRai
5 жыл бұрын
Why not computing greedy algorithm (visiting the closest city...) giving you the upper bound ?
@netbotcl586
5 жыл бұрын
because we want the optimal answer.
@wardiofficial6945
7 жыл бұрын
could you please make a video to code a system that use GA for navigating the customer of supermarket when they are doing their grocery shopping task. The system should use the shelf's coordinate and the result will display a list of shelf label of the selected shelf from the distance calculated from the supermarket front door. tq
@pqazx1
3 жыл бұрын
how to take input from user for the dist bw points ??and then do this??
@sudhamahajan2272
3 жыл бұрын
How to stop this prog after iterations are completed..?
@hassaanfarooq9803
5 жыл бұрын
It's more like finding a MST from a graph. Isn't it?
@goodone.digital
7 жыл бұрын
Damn when you coding world seems simpler
@sensei0101
7 жыл бұрын
Isn't it a good idea to cache parts of the system? So when it hits again, it is just to look it up instead of calculating everything all the time?
@zyzo99
6 жыл бұрын
One thing i dont get is why the upper boundary in the loops use to be < and not
@jacobvarghese7450
5 жыл бұрын
You took only 22 minutes, i will take 22 days to grasp this
Пікірлер: 337