Solving Travelling Salesman Problem(TSP) using Excel Solver

Sdílet
Vložit
  • čas přidán 2. 05. 2015
  • Given a distance matrix, the optimal path for TSP is found using evolutionary solver module available with Microsoft Excel.
    Notebook of an Industrial Engineer- nboaie.blogspot.in/
    Video made using Screencast-o-Matic free version.

Komentáře • 128

  • @robertmainville4881
    @robertmainville4881 Před 3 lety +16

    No useless explanations, straight to the point! Great work!

  • @purushottamdutt5039
    @purushottamdutt5039 Před 7 lety +1

    Thank you so much Jeffy Joseph. I am sure you have made the lives of many of us a lot easier by this simple TSP algorithm. Cheers!

  • @samkorat6496
    @samkorat6496 Před 8 lety +1

    It's a long time that I try to use excel to solve TSP. You give me for the easy step to use. thank you very much.

  • @luana-almeida
    @luana-almeida Před 2 lety +3

    Hey Jeffy, nice video. I found it interesting that you showed how to solve the TSP using the evolutionary algorithm on Solver. I`ve always solved it as an exact method, and I found it very simple to apply with GA. Thanks for this!

  • @holenweg1081
    @holenweg1081 Před 2 lety +1

    Thank you for sharing this. It's clear and straight to the point!

  • @stewarthackley8620
    @stewarthackley8620 Před 7 lety

    Thanks very useful. Just a minor tweak for my start point and it works well. One thing I noted if re-running it the constraints have to be edited to include 'dif' again as that was lost.

  • @giovannahurtado3041
    @giovannahurtado3041 Před 4 lety

    You save my life with this video... many thanks!!

  • @Bastel_Boys
    @Bastel_Boys Před 8 lety

    Dear Jeffy, Thank you so much for your help! this video is a life saver for me

  • @crisbra
    @crisbra Před 5 lety +4

    !!!!If you have a issue read this!!!! Set your starting point = to the final point. In this example the cell I11 should read; =B11. What you will see initially is a 1 after deselecting the I11

  • @mustafamece4373
    @mustafamece4373 Před 2 lety

    Literally life-changer information!!!!!!! Thanks a lot

  • @ajyuk
    @ajyuk Před 8 lety

    Interesting and Informative! Thank you Jeffy!

  • @shakirmohamed9648
    @shakirmohamed9648 Před 3 lety +2

    YOOO Mr Joseph, shout out to youuuuuuu. Thanks to you, I can get my Assignment done.
    HELLO MR SILVAM

  • @ricardcrivillers7173
    @ricardcrivillers7173 Před 4 lety

    Does it work the INDEX function if I have instead 1 to 7, a reference for each city or even a letter? it returns me a REF result.

  • @kavitamalhotra9297
    @kavitamalhotra9297 Před 5 lety

    What if I have a triangular inequality in my matrix with fixed starting and ending point

  • @stefanocorsi4517
    @stefanocorsi4517 Před 3 lety +1

    Very good, very simple, thank you.

  • @stsuboi
    @stsuboi Před 2 lety

    Thank you for making a smart video! I did my task of TSP using this video!

  • @joonatankylmaniemi6887
    @joonatankylmaniemi6887 Před 6 lety +8

    Thanks! I am going to use this for actually planning my trip, like the salesman. I'm on a holiday in Australia, and wanted to find out the shortest, (possibly cheapest), route between destinations.

    • @kagayakuangel5828
      @kagayakuangel5828 Před 4 lety +11

      That's HILARIOUS lol you're doing this cause you need it, and I'm doing it cause I'm being forced to do it by my lecturer.

  • @memorableclips1199
    @memorableclips1199 Před 6 lety

    I'm looking to find an exact solution of the travelling salesman problem for 9 cities but I am not the tech savvy type and my interest in the subject was recreational. Is there a user friendly tsp solver online that you can recommend?

  • @chanjiamin12398
    @chanjiamin12398 Před 3 lety +1

    SO SIMPLE. I LOVE YOU . YOU SAVED MY ASSIGNMENT.

    • @cruzjayson7714
      @cruzjayson7714 Před 3 lety

      pro tip : you can watch movies at Kaldrostream. Been using them for watching all kinds of movies recently.

    • @codyjeffrey7270
      @codyjeffrey7270 Před 3 lety

      @Cruz Jayson Definitely, I've been watching on kaldroStream for since december myself :)

  • @aparnajoshi4220
    @aparnajoshi4220 Před 4 lety +1

    Which method is used in this video to solve TSP? I tried the same problem using zero- one programming in excel solver (simplex algorithm) and it gives the same result but involves many constraints..

  • @soukainasadqi7685
    @soukainasadqi7685 Před 7 lety +2

    hello, it's really helpful but how can i do, if i want to know the best combination between 1,3,and 4 for example not all of them ??? i really need to know how to do that please !!! and thank you very much

  • @pe66o
    @pe66o Před 6 lety

    Does someone know how is the algorithm behind working and how to put it in mathematical terms?

  • @patelmohakdharmendra1518

    It was really helful ...Thanks a lot.

  • @miguelrioscabra7372
    @miguelrioscabra7372 Před 8 lety

    what a nice video, thanks Jeffy

  • @elfalazhia5270
    @elfalazhia5270 Před 8 lety

    Gracias, me sirvió mucho!!!

  • @aboubakrmoubarak571
    @aboubakrmoubarak571 Před 7 lety

    thank you brother, the method is well explained, can you please show us how to solve maximum flow (ford fulkerson diagram on solver ) and thanks alot for your help

  • @abhishekjain3706
    @abhishekjain3706 Před 5 lety

    Thanks a ton for sharing this!

  • @timelapselego3014
    @timelapselego3014 Před 7 lety +1

    Can I solve this problem with the method you presented? "I have a source of products and 5 destinations, each trailer can hold up to 8 units and I need to satisfy demand". Would this be the model I'm looking for?

  • @ijjazmohamed6198
    @ijjazmohamed6198 Před 5 měsíci

    Should we add the distance from the last node to initial node to the objective?

  • @navela2010
    @navela2010 Před 7 lety

    buenos dias, una pregunta si me puede colaborar, numero de variables que se pueden resolver con solver, gracias

  • @roositanoor6289
    @roositanoor6289 Před 4 lety

    Thank you, your video help me. Bless u

  • @saichaitanya4434
    @saichaitanya4434 Před měsícem

    Thanks for uploading this ✨

  • @chinhonglee8570
    @chinhonglee8570 Před 4 lety +2

    hi Joseph i need to go back to city 1 ? how ah ?

  • @piyushashah1
    @piyushashah1 Před 2 lety

    Good video Jeffy, thank you.

  • @thodsapon5
    @thodsapon5 Před rokem

    What if I need to fix the starting to to be number 1? What are more conditions I need to add there

  • @gust3833
    @gust3833 Před 5 lety

    Thanks by share the solution, I suggest in the solver add the constraint I11=B11

  • @chinhonglee8570
    @chinhonglee8570 Před 4 lety +4

    hi Joseph how to go back to City 1?

  • @haidarsandouk1476
    @haidarsandouk1476 Před 2 lety

    So useful and simple, But how can i set a starting point, supposing that 1 is the centre of distrubution where the trucks or vehicles are supposed to come back again?

  • @Toohosayan
    @Toohosayan Před rokem

    Hi Joseph, Can i also use simplex for tsp using solver.

  • @TheSemgold
    @TheSemgold Před 2 lety

    Do you know how to save solver model in LibreOffice exporting to Excel?

  • @WilliamBlaky
    @WilliamBlaky Před 8 lety

    Exactly what I'm looking for! But, since I'm hearing impaired, I find it impossible to follow because of the bad sound quality (background noise, etc). Any chance of re-recording the sound track, or can I find the 'recipe' in writing somewhere??
    Thanks, Bill.

    • @princet52
      @princet52  Před 8 lety

      +WilliamBlaky Sorry about the sound quality. No, I dont have any 'recipe'.. :) But i will try to re-record as soon as possible

  • @dquicenor
    @dquicenor Před 3 lety

    Very nice, thank you!

  • @joannasobiegala1578
    @joannasobiegala1578 Před 8 lety +1

    Please help - using excel 2007 and did not have a choice "Diff " in "add contraint" - how else can I solve this?
    Thank you for help.

    • @princet52
      @princet52  Před 8 lety +1

      Most of these options are available from 2010 only. If you dont have access to 2010 then you can try installing OpenSolver. Its less that 5 MB.

  • @trteet7484
    @trteet7484 Před 4 lety

    You are the best

  • @HanaJuhana-s7t
    @HanaJuhana-s7t Před 12 dny

    how to make a distance table with excel?? Please help me

  • @mohammanhal
    @mohammanhal Před rokem

    How can I solve the same Problem but not for all cities ? how would be the solution if I need to show the distance just for 3 or 4 cities from this 7 cities ?

  • @jopeum
    @jopeum Před 3 lety

    why is the evolutionary solver preferredm in this problem

  • @salwaassahout1611
    @salwaassahout1611 Před 4 lety +1

    Thank you for this video. Is the evolutionary solver based on genetic algorithm (GA)?

    • @lani0
      @lani0 Před 3 měsíci

      yes, excel solver window says so

  • @Sutrave01
    @Sutrave01 Před 8 lety

    Thank you for the TSP solution! I have a question. Let's say that I wanted optimal routes for 2 different vehicles from a large set of locations (20+), could I do that using this method? This method works really well, but only if you have a single vehicle. I need the program to find optimal solutions if the set of data were to split into two routes (the program decides how to split the data).

    • @princet52
      @princet52  Před 8 lety

      +Akshay Sutrave Thats vehicle routing problem. Ofcourse it could be done with coding. But if you want to do with just excel functions and solver, then it could be a little tricky. Because the number of locations to be covered by a particular vehicle is not fixed. Hence the dif option cannot be used directly. Slightly tricky, but doable. As for the accuracy, you may not obtain an optimal solution but one that is very close. I would definitely give it a try.

    • @Sutrave01
      @Sutrave01 Před 8 lety

      How would I be able to program excel to plan two optimal routes for me? What constraints should I add? I'm guessing that is the tricky part.

    • @princet52
      @princet52  Před 8 lety

      +Akshay Sutrave It wasn't as tricky as I thought. It took only a couple of minutes to formulate it. You just want to minimize the distance with multiple vehicles, right? Thats not VRP but mTSP. Sorry for misinterpreting the problem. I will try to record a video and post it.

    • @Sutrave01
      @Sutrave01 Před 8 lety

      +jeffy joseph Thank you so much! It will really help me in the analysis I want to do. I attempted to formulate it but it would not run correctly the way I was doing it. Let me know when you upload the video, I really appreciate the help!

    • @Sutrave01
      @Sutrave01 Před 8 lety

      +Akshay Sutrave This video has really helped me on my project, and I want to give you credit for helping me. If you can email me that would be great!

  • @saad1541
    @saad1541 Před 8 lety

    very nice indeed..i am looking for shortest path problem applying genetic Algorithm in Matlab..if you or anyone knows any good source or tutorial video about it..kindly share

  • @nafisachowdhury648
    @nafisachowdhury648 Před 3 lety

    I'm using excel 2007.There's no diff option.so i downloaded open solver but there this problem can't be solved.What can i do?

  • @aravindkamalesh
    @aravindkamalesh Před 9 lety +2

    hi that was a worthy information u have shown...could you also please solve the same in MATLAB?

    • @princet52
      @princet52  Před 9 lety +1

      Aravind kamalesh I will try..

  • @shakyaherbaltv6743
    @shakyaherbaltv6743 Před 3 lety

    What if the starting point and ending point are two different locations and fixed?
    Looking for a quick reply.

    • @hirokiwilliams1029
      @hirokiwilliams1029 Před 8 měsíci

      That means it not a travelling salesman problem. It has to be a Hamiltonian circuit for it to be a travelling salesman problem. What you’re looking for is not called a travelling salesman problem.

  • @arporntransport4763
    @arporntransport4763 Před 7 lety

    hey i think something went wrong, the first city should be city 1 right, but after you solve it then it became city 6 ?? please explain??

    • @princet52
      @princet52  Před 7 lety +1

      Its giving a circular route starting at 6 and ending at six. If you start at one and follow the sequence generated, you will come back to 1.

  • @edwardd4999
    @edwardd4999 Před 8 lety

    thanks so much :)

  • @TheNannaChristine
    @TheNannaChristine Před 6 lety

    How du you solve this if the start and end location has to be the same? Solver will not let you do this..

    • @princet52
      @princet52  Před 6 lety

      The one I solve in this video starts and ends at the same location. See @4:03

  • @Wylospinos
    @Wylospinos Před 8 lety +1

    Hello Mr. Jeffy Joseph. First of all I want to thank you for give this solving method of the TSP to the internet. Secondly, i want to ask you a question: does this method still work in matrixes where the upper triangle is not exactly like the oppostite of the triangle at the bottom.

    • @princet52
      @princet52  Před 8 lety

      +Wil Ospino yes it will work for both symmetric and asymmetric matrices

    • @Wylospinos
      @Wylospinos Před 8 lety +1

      jeffy joseph Thanks a lot, this is really useful for me. This is one of the topics of my Grade Project so I can get my degree as Engineer.

  • @aravindkamalesh
    @aravindkamalesh Před 9 lety

    how to find which route has the salesperson followed?

    • @princet52
      @princet52  Před 9 lety +1

      Aravind kamalesh The 11th row in the video gives the route followed.

  • @soukainasadqi7685
    @soukainasadqi7685 Před 7 lety

    Can you tell me how did you add "All different " in the constraints , cause i don't have it ? thank you

    • @princet52
      @princet52  Před 7 lety

      Are you using excel 2010 or above? The older versions have a different solver with lesser number of features. If you are using 2007 try installing Opensolver (~5MB). It's an excel plugin/addon. If i remember correctly, it has alldifferent.

    • @soukainasadqi7685
      @soukainasadqi7685 Před 7 lety

      no no it's fine now i have the ''all different '' but my problem is that my project is to defin the minimize the time of cleaning between different production, i have a matrix with all the time needed to go from a formulation to another , and i need to give as an input for example just 4 formulation and the solver has to give me the which formulation should start first, second ... to have the min time of cleaning , and it's working like in your video but i don't want to choose the 7 cities for example just 4 or 3 ... Thank you so much for answering

    • @jeffaldrich12
      @jeffaldrich12 Před 7 lety +1

      Soukaina Sadqi Im willing to help you. you can email me. jeff_go12@yahoo.com

    • @soukainasadqi7685
      @soukainasadqi7685 Před 7 lety

      Right Now :p , i really need help thank you so much :)

  • @icadizu4388
    @icadizu4388 Před rokem

    weon eres la mejor wea que me ha pasado en la vida

  • @michaelsilva8829
    @michaelsilva8829 Před 8 lety +2

    Hi, what if I want:
    1. to have a defined starting point that does not change?
    2. to have a defined ending point that does not change?
    How could I apply this solution for these 2 problems?

    • @princet52
      @princet52  Před 8 lety

      yes you could.

    • @mayankkhera259
      @mayankkhera259 Před 8 lety

      But how exactly?

    • @princet52
      @princet52  Před 8 lety

      In this example B11 to I11 represent the solution. For a fixed staring point add a constraint as B11={desired starting city}. If there is a desired ending city, we dont need I11. Delete I11 and add another constraint H11 = {desired ending city}. That should work.

    • @vudhiwasuwanich799
      @vudhiwasuwanich799 Před 7 lety +2

      could you please explain more sir ?

    • @jeffaldrich12
      @jeffaldrich12 Před 7 lety +1

      Can you send me details about this formula? I really need it please

  • @ozgureren8925
    @ozgureren8925 Před 2 lety

    thanks a lot

  • @Kekka6lamiavita23
    @Kekka6lamiavita23 Před 8 lety +2

    Thank you very much, however when applying it on my excel the excel solver does not change the last number after the decision variable.. in the video this is (I11) meaning that the total distance does not take into account the length from the last to the first. How is this solved?
    Once again thank you for the video

    • @princet52
      @princet52  Před 8 lety +2

      +Tatyana Pellan i11 is equated to b11 so that when b11 changes i11 also changes. It does consider that distance from last to first. After solving, the last location is 7 and the distance from last to first appear as 19 in h12

  • @venukrishna207
    @venukrishna207 Před 3 měsíci

    Thanks!

  • @maximeb190
    @maximeb190 Před 7 lety

    I Wonder how to make this work if you only want to determine the most optimal route between 2 - 3 - 5- 7, in other terms not using the whole list of destinations in the matrix, just some of them. The solver seems to alway bring back values from 1 and up. In my example, the solution will give me a sequence from 1 to 4, instead of using the inputs 2 - 3 - 5 or 7 and rearranging them.

    • @yuanli7983
      @yuanli7983 Před 7 lety

      you need to redo the distance matrix to include only those cities/locations.

    • @princet52
      @princet52  Před 7 lety +1

      Yuan Li is right. Since you want only the route through some cities, whats the point in having the whole distance matrix.

    • @soukainasadqi7685
      @soukainasadqi7685 Před 7 lety

      I have the same problem , i want to have the whole matrix but every time choose different cities ! i have an undustriel problem which looks like this , how can i do it please ?

    • @princet52
      @princet52  Před 7 lety +1

      I think your problem is vehicle routing problem (where you want to find the shortest route between two points) and not TSP. I have uploaded an other video on mTSP. You could use the same methodology. Just add one more constraint like 'cities 2,4 and 5' should be covered by the same salesman'. It should work. Here is the link : czcams.com/video/owHq3Mbniqo/video.html

    • @soukainasadqi7685
      @soukainasadqi7685 Před 7 lety

      Thank you i will try that, i'm really bad in excel :( and i have to finish this project alone to have my degree and finish my internship, thank you so much

  • @HanaJuhana-s7t
    @HanaJuhana-s7t Před 20 dny

    Bagaimana cara membuat tabel jarak menggunakan excel bro??

  • @maximiliandipaetzoldi2852

    Thanks for the video, its really helpful. Do you think its also possible to solve a TSP with 79 cities with excel?
    Thanks in advance!!

    • @princet52
      @princet52  Před 7 lety

      Sorry for the late reply. I haven't tried. But solver has a limit of around 100 variables. 79 should be ok. But again I dont know.

  • @freshfast6197
    @freshfast6197 Před 6 lety

    Thanks

  • @simplesunil
    @simplesunil Před 2 lety

    Hi Joseph....i got furthur less using the same data and same technique as advised by you...126

  • @thomasziller6372
    @thomasziller6372 Před 8 lety

    whta if i have to start in 1 and to finish in 1 again?

    • @alexanderschmidt75
      @alexanderschmidt75 Před 8 lety +1

      change data to be used in solver = make them a constant

    • @chinhonglee8570
      @chinhonglee8570 Před 4 lety

      @@alexanderschmidt75 hi alex i dont understanf how to make them constant ?

  • @vishalsachania1453
    @vishalsachania1453 Před 5 lety

    Pls help I have a question which I have been using at work which is very time consuming.
    Kindly help by providing mail or number
    Thanks in Advance

  • @saiecorp5646
    @saiecorp5646 Před 2 lety

    Where is route? You got distance but how about path?

  • @julinovack1632
    @julinovack1632 Před 5 lety

    Hey, this is Pixy and I am looking for Corp on Wartune. If this is you, please check in with us. You are missed!! Got this name from Papa. Hope you are well!!

  • @RaedAbdulKarimHabash
    @RaedAbdulKarimHabash Před 3 lety

    in your calculation you did not return to pint 1 which you started from.

  • @mohammanhal
    @mohammanhal Před rokem

    Hallo, can I have your Email? I need your help to fix a Travelling Problem but for a Warehouse

  • @francomenchaca853
    @francomenchaca853 Před 2 lety

    Este we sabe cosas

  • @thaeermsahib3133
    @thaeermsahib3133 Před 3 lety

    thanks a lot but another time when you try to record a lesson plz record in quite a place, not in the street

  • @priyankshah2944
    @priyankshah2944 Před 4 lety

    I am getting 123

  • @mdbaseetalam903
    @mdbaseetalam903 Před 4 lety +1

    My answer is 126

  • @mdbaseetalam903
    @mdbaseetalam903 Před 7 měsíci

    The only mistake which i can see that for 1-1 should be defined high value

  • @tomekdorobisz1058
    @tomekdorobisz1058 Před rokem

    Hi Jeffy,
    could you explain how to solve it, but with starting/ending point as 1?
    I need to calculate route starting on point 1 and then going back to this city.

  • @tanishkanarayan1210
    @tanishkanarayan1210 Před 4 lety

    It didnt work

  • @BradHouser
    @BradHouser Před 3 lety

    If you limit the solver to 20 seconds, it will only find the best one it was able to get to in 20 seconds. While it is _a_ solution, it is not guaranteed to be the best solution.

  • @nassimbouhaouita1697
    @nassimbouhaouita1697 Před 2 lety

    i dont think thats right