CPLEX & Python. Capacitated vehicle routing problem

Sdílet
Vložit
  • čas přidán 14. 07. 2018
  • Learn how to solve the Capacitated Vehicle Routing Problem CVRP with CPLEX and Python using a Jupyter Notebook.
    I use indicator constraints for sub tour elimination. I set a time limit to deal with long solving times.
    Code available in GitHub:
    github.com/industrial-ucn/jup...

Komentáře • 89

  • @_bobberty
    @_bobberty Před 5 lety

    This is awesome - thank you for your generosity!

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

    Thank you, sir . It helps me a lot to know the basics.

  • @davidetonelli1766
    @davidetonelli1766 Před 3 lety

    Great, very useful to get an introduction in docplex!

  • @aaronwu1564
    @aaronwu1564 Před 3 lety

    A really straightforward explanation! love it

    • @ksssb3621
      @ksssb3621 Před 3 lety

      hey, could you run that cvrp line and not get error?

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

    thank you so much. this is really helpful!

  • @henbrick
    @henbrick Před 4 lety

    Great content! Thanks a lot man

  • @hikpod
    @hikpod Před 3 lety

    Amazing video, thanks alot!!

  • @brenolagartixa
    @brenolagartixa Před 3 lety

    Thank you for this video! :)

  • @sandipankarmakar
    @sandipankarmakar Před 3 lety

    Thanks a lot for this video... God bless you...

  • @d3yadav
    @d3yadav Před 4 lety

    really nice video with visualization

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

    Thank you for the awesome video. It is indeed helpful for the beginners in CPLEX Python API. Can you throw some light on how to use the constrained programming (including soft constraints) in the optimization using CPLEX Python Api

  • @HeavyMiss
    @HeavyMiss Před 5 lety

    thank you so much for this.

  • @coldcoffee89
    @coldcoffee89 Před 4 lety

    Is there an efficient way to call on data to establish the A matrix if node vertices have already been assigned in the problem rather than generating random values?

  • @harishankar6496
    @harishankar6496 Před 5 lety

    Can you please tell how to implement subtour elimination constraints for the same problem using lazycuts in docplex

  • @luciferhasfallen6019
    @luciferhasfallen6019 Před 5 lety

    This is useful for me thankyou

  • @mohammadkarimi8649
    @mohammadkarimi8649 Před 2 lety

    Thank you, it was useful

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

    Thanks for the video
    Do you have any similar examples for the VRPTW problem? I'm using you as an example but I haven't succeeded in implementing it considering time windows.

  • @damarissyokaukilango3367
    @damarissyokaukilango3367 Před 5 lety +1

    Hello.Thank you so much for this vedio. It's very educative
    However,I've tried to run the model after adding the constraints and it's not working out. Please,what can be the problem?

  • @AayushOstwal
    @AayushOstwal Před 3 lety

    Thanks, Great Video! I just wanted to know the technique used here. is it column generation or Branch & Bound or other??

  • @mlstradingschool6717
    @mlstradingschool6717 Před 4 lety

    Thinks sir you help me !!!👍👍👍👍

  • @isaacpemberthy507
    @isaacpemberthy507 Před 5 lety

    Cordial saludo Hernán, gran vídeo, te pregunto, que versión Python usas? Yo tengo la última versión y tengo problemas para correr el cplex. ¿Sabes algo de este problema?

  • @queenwateurecords599
    @queenwateurecords599 Před 2 lety

    thank you so much

  • @paulfierro9144
    @paulfierro9144 Před 2 lety

    My model has too many variables for the free edition of CPLEX. What do you recommend will they give a trial period? Or is there another optimizer that you recommend that is free?

  • @user-bz5mo6fi3d
    @user-bz5mo6fi3d Před 6 lety +8

    Hello, I would like to request you that please teach the improving the algorithm such as Ant colony or genetic algorithm in Cplex. Thank you so much for your sharing of the knowledge.

    • @shashankathawale7002
      @shashankathawale7002 Před 3 lety

      Hi, did you find an approach through the genetic algorithm?

    • @johnkarippery9919
      @johnkarippery9919 Před 3 lety

      I also have same request. Could you please make genetic algorithm(NSGA II) in cplex?

    • @Raviarun
      @Raviarun Před 2 lety

      @@johnkarippery9919 It is not possible. GA is a metaheuristic. CPLEX is an exact solver.

  • @furkancnar6771
    @furkancnar6771 Před 4 lety

    can you explain some codes for larger problems? For example 9000 people and 256 vehicles

  • @nazaninmadani2045
    @nazaninmadani2045 Před 5 lety

    Hi, thanks for your excellent video. This problem considers only one vehicle? right? which is a TSP problem.

  • @ilknurgulen7488
    @ilknurgulen7488 Před 4 lety

    Hello
    Could you inform me where model as found ? Could you share resource?

  • @aliguzel8463
    @aliguzel8463 Před 6 lety

    Hello Dr. Hernan,
    I really like this video.. Would you write also the reference article you used in this video? Thanks.

  • @onho4981
    @onho4981 Před 4 lety

    Hello sir. How can I input this code into cplex following its formula

  • @narucse
    @narucse Před 4 lety

    Thanks for the nice explanation. Could you please help me. I want to print to a file every time CPLEX finds a feasible solution.

  • @ivanxdxd
    @ivanxdxd Před 4 lety

    wena wn! oye cachai si esta wea me sirve pa resolver un problema 'periodico' de ruteo de vehiculos con ventanas de tiemmpo (PVRPTW) con 860 nodos? O será pedir mucho? Como cuanto se va a demorar la cagá? O hay alguna opcion mejorcita?

  • @david31565
    @david31565 Před 3 lety

    can si=ome body explained how to put the location ?

  • @yasserelgandazi5564
    @yasserelgandazi5564 Před 5 lety

    thank you for this fruitful video but i have a question about this line of code 'from docplex.mp.model import Model' whenever i execute it ,i have this error 'ModuleNotFoundError: No module named 'docplex' 'i tried in pycharm and also in the jupyter notebook and it's so confusing ,please if you have an idea of how i can solve it tell me ,thank you in advance.

    • @26joaozinho
      @26joaozinho Před 4 lety

      in terminal run 'pip install docplex' or 'conda install -c ibmdecisionoptimization docplex'

  • @youthguidanceprogram
    @youthguidanceprogram Před 5 lety +2

    1. can you please upload the code on github?
    2. doe cplex allow using heuristic approaches when problem size is large?
    3. how would you modify if you had multiple depots and vehicles were allowed to move to any depot

    •  Před 4 lety

      Hello, 1) I just added the code to GitHub github.com/industrial-ucn/jupyter-examples/blob/master/optimization/cvrp-cplex.ipynb 2) yes, you can add an initial solution before calling solve() and 3) you would have to formulate a different math formulation and then code that with python.

  • @mayankmadhav2370
    @mayankmadhav2370 Před 4 lety

    27:05 Hey can you tell me what do these u_1 = 14.000, u_2=20.000 and so on...in the output represent?

    • @jooern8900
      @jooern8900 Před 3 lety

      its the units available for delivery at the point the vehicle encounters the client u_x

  • @johnkarippery9919
    @johnkarippery9919 Před 4 lety

    is that possible simple VRP without using CPLEX?

  • @alanjomy6602
    @alanjomy6602 Před 3 lety

    Thank you so much. Can you please suggest how to solve the same problem with multiple depot.

    • @styloamnald
      @styloamnald Před 3 lety

      Did you find any soluton for your problem?

  • @salouaabaakil9436
    @salouaabaakil9436 Před 6 lety

    hello ! what is the name of the plateform please ?
    thanks

  • @rgemso6260
    @rgemso6260 Před 5 lety +10

    Thank you for the excellent video. Can you please upload the code to github or somewhere to share?

    •  Před 4 lety

      Hello, I just added the code to GitHub github.com/industrial-ucn/jupyter-examples/blob/master/optimization/cvrp-cplex.ipynb

  • @aniketchodankar2340
    @aniketchodankar2340 Před 2 lety

    Than you So much for sharing this. Can this solution be solved using PULP as CPLEX is not free

  • @jipengdai8473
    @jipengdai8473 Před 4 lety

    Could I know what IDE do you use?

    • @samkomo4289
      @samkomo4289 Před 4 lety

      Jipeng Dai he is using jupyter notebook...normally comes with anaconda distribution of python. But I believe you can just install it independently (on your terminal-pip install Jupyter)

  • @MrSachin85
    @MrSachin85 Před 5 lety +1

    Dear sir this video is really helping me but can you upload the video for solving the mathematical model for heterogeneous vehicle routing problem with time windows.

  • @luciferhasfallen6019
    @luciferhasfallen6019 Před 4 lety

    If I want to fix the number of vehicle (for example 4 trucks). What should I do.

    • @SandyGarza95
      @SandyGarza95 Před 4 lety

      did you find a solution for this? I'm stuck with the same problem.

    • @david31565
      @david31565 Před 3 lety

      @@SandyGarza95 me too

  • @marcchevallier6734
    @marcchevallier6734 Před 5 lety +2

    Hi Hernan, congratulations for your excellent video.
    I tried to replicate the same code and I've got an error while adding de indicators_constraint. It says Indicators has no len(). Could you please help me? Thank you

    • @dieglopc
      @dieglopc Před 5 lety

      Hi Marc, did you fix this error? I have the same problem. Could you please help me? Thank you.

    • @mariadelmarcarrillogalera743
      @mariadelmarcarrillogalera743 Před 5 lety

      @@dieglopc Hi! I'm also getting the same error... Did you figure out how to fix it? Thank you.

    • @Pepek4896
      @Pepek4896 Před 5 lety

      @@mariadelmarcarrillogalera743ou need to install IBM ILOG CPLEX optimization studio (link: www.ibm.com/products/ilog-cplex-optimization-studio) into your machine and then install it's python API in order to solve this issue. It is written in the docplex website (link: pypi.org/project/docplex/). To get the studio, you either have to pay or are a student to get free access.

    • @wisdomchimukoko7549
      @wisdomchimukoko7549 Před 5 lety

      @@@Pepek4896 thanks..have done this but i am still getting the error...please help

    • @AvatarJJJ
      @AvatarJJJ Před 5 lety

      I've got the same error and I've install IBM ILOG CPLEX optimization studio but not works.

  • @brenolagartixa
    @brenolagartixa Před 5 lety +2

    Nice explanation!!! Thanks! But sadly CPLEX is not free. I'm studying PYOMO library for Python and I'm having some trouble to write something like 'indicator variables' there. Could you please make a tutorial like this one using PYOMO library? Thanks in advance!!! Best regards from Brazil!!! :)

    •  Před 4 lety +2

      It is free for students

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

      You also can try ortools from google developers. Speaking of that... @Hernan could you please make a video of this tool?

  • @rideneahmed4691
    @rideneahmed4691 Před 4 lety

    Hello I want to know how can I get all the solution for a vehicle rooting problem using pulp?
    Thanks in advance

  • @hninpannphyu8567
    @hninpannphyu8567 Před 3 lety

    Hi, Thanks for the great tutorial. How can we implement the maximum flow problem with docplex. For instances, mdl.sum(x[i,j] for (i,j) in E)-mdl.sum(x[j,i] for (j,i) in E)==1 if i=source
    mdl.sum(x[i,j] for (i,j) in E)-mdl.sum(x[j,i] for (j,i) in E)==-1 if i==destination
    mdl.sum(x[i,j] for (i,j) in E)-mdl.sum(x[j,i] for (j,i) in E)==0 otherwise.
    Can you guide me the example code in python docplex Model for the above example.

  • @pranoykumar3294
    @pranoykumar3294 Před 4 lety

    I added docplex lib but it still shows error,
    DOcplexException: CPLEX runtime not found: please install CPLEX or solve this model on DOcplexcloud

    • @syedmuhammaddanish8511
      @syedmuhammaddanish8511 Před 4 lety

      I have the same error. Did you resolve it ?

    • @pranoykumar3294
      @pranoykumar3294 Před 4 lety

      @@syedmuhammaddanish8511 Yes you should use anaconda and install docplex in it

    • @herlenheegii4689
      @herlenheegii4689 Před 3 lety

      @@pranoykumar3294 not found? How i find docplex?

    • @pranoykumar3294
      @pranoykumar3294 Před 3 lety

      @@herlenheegii4689 hey, install docplex package in anaconda
      If you have anaconda type 'conda install -c ibmdecisionoptimization cplex' in anaconda command prompt.

    • @herlenheegii4689
      @herlenheegii4689 Před 3 lety

      @@pranoykumar3294 I tried not worked

  • @snackbob100
    @snackbob100 Před 4 lety

    CAN WE GET CODE PLEASE :)

    •  Před 4 lety

      Hello, I just added the code to GitHub github.com/industrial-ucn/jupyter-examples/blob/master/optimization/cvrp-cplex.ipynb

  • @narendransuresh6416
    @narendransuresh6416 Před 2 lety

    How can I restrict the total number of vehicles to 10. Can you please explain sir?

  • @houssemsalem3774
    @houssemsalem3774 Před 2 lety

    you used some numpy functions without explaining the signification of each fucntion .