CPLEX & Python. Capacitated vehicle routing problem

แชร์
ฝัง
  • เผยแพร่เมื่อ 12 ก.ย. 2024
  • 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/ind...

ความคิดเห็น • 79

  • @vivmon2528
    @vivmon2528 4 ปีที่แล้ว +2

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

  • @davidetonelli1766
    @davidetonelli1766 3 ปีที่แล้ว

    Great, very useful to get an introduction in docplex!

  • @aaronwu1564
    @aaronwu1564 3 ปีที่แล้ว

    A really straightforward explanation! love it

    • @ksssb3621
      @ksssb3621 3 ปีที่แล้ว

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

  • @user-bz5mo6fi3d
    @user-bz5mo6fi3d 6 ปีที่แล้ว +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 4 ปีที่แล้ว

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

    • @johnkarippery9919
      @johnkarippery9919 4 ปีที่แล้ว

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

    • @Raviarun
      @Raviarun 2 ปีที่แล้ว

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

  • @harshbakhai8404
    @harshbakhai8404 5 ปีที่แล้ว +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

  • @_bobberty
    @_bobberty 5 ปีที่แล้ว

    This is awesome - thank you for your generosity!

  • @agustinguerra6692
    @agustinguerra6692 3 ปีที่แล้ว +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.

  • @sananazari4797
    @sananazari4797 4 ปีที่แล้ว +1

    thank you so much. this is really helpful!

  • @sandipankarmakar
    @sandipankarmakar 3 ปีที่แล้ว

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

  • @rgemso6260
    @rgemso6260 5 ปีที่แล้ว +10

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

    •  4 ปีที่แล้ว

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

  • @paulfierro9144
    @paulfierro9144 2 ปีที่แล้ว

    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?

  • @d3yadav
    @d3yadav 4 ปีที่แล้ว

    really nice video with visualization

  • @youthguidanceprogram
    @youthguidanceprogram 5 ปีที่แล้ว +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

    •  4 ปีที่แล้ว

      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.

  • @coldcoffee89
    @coldcoffee89 4 ปีที่แล้ว

    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?

  • @isaacpemberthy507
    @isaacpemberthy507 5 ปีที่แล้ว

    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?

  • @hikpod
    @hikpod 3 ปีที่แล้ว

    Amazing video, thanks alot!!

  • @brenolagartixa
    @brenolagartixa 3 ปีที่แล้ว

    Thank you for this video! :)

  • @AayushOstwal
    @AayushOstwal 3 ปีที่แล้ว

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

  • @henbrick
    @henbrick 4 ปีที่แล้ว

    Great content! Thanks a lot man

  • @damarissyokaukilango3367
    @damarissyokaukilango3367 5 ปีที่แล้ว +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?

  • @harishankar6496
    @harishankar6496 5 ปีที่แล้ว

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

  • @ilknurgulen7488
    @ilknurgulen7488 4 ปีที่แล้ว

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

  • @mohammadkarimi8649
    @mohammadkarimi8649 2 ปีที่แล้ว

    Thank you, it was useful

  • @brenolagartixa
    @brenolagartixa 5 ปีที่แล้ว +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!!! :)

    •  5 ปีที่แล้ว +2

      It is free for students

    • @kevinesh
      @kevinesh 4 ปีที่แล้ว +1

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

  • @iiiiii-w8h
    @iiiiii-w8h 4 ปีที่แล้ว

    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?

  • @nazaninmadani2045
    @nazaninmadani2045 5 ปีที่แล้ว

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

  • @furkancnar6771
    @furkancnar6771 4 ปีที่แล้ว

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

  • @aliguzel8463
    @aliguzel8463 6 ปีที่แล้ว

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

  • @onho4981
    @onho4981 4 ปีที่แล้ว

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

  • @narucse
    @narucse 4 ปีที่แล้ว

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

  • @luciferhasfallen6019
    @luciferhasfallen6019 5 ปีที่แล้ว

    This is useful for me thankyou

  • @aniketchodankar2340
    @aniketchodankar2340 2 ปีที่แล้ว

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

  • @HeavyMiss
    @HeavyMiss 5 ปีที่แล้ว

    thank you so much for this.

  • @mlstradingschool6717
    @mlstradingschool6717 4 ปีที่แล้ว

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

  • @david31565
    @david31565 3 ปีที่แล้ว

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

  • @marcchevallier6734
    @marcchevallier6734 6 ปีที่แล้ว +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 5 ปีที่แล้ว

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

    • @mariadelmarcarrillogalera743
      @mariadelmarcarrillogalera743 5 ปีที่แล้ว

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

    • @Pepek4896
      @Pepek4896 5 ปีที่แล้ว

      @@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 5 ปีที่แล้ว

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

    • @AvatarJJJ
      @AvatarJJJ 5 ปีที่แล้ว

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

  • @johnkarippery9919
    @johnkarippery9919 4 ปีที่แล้ว

    is that possible simple VRP without using CPLEX?

  • @MrSachin85
    @MrSachin85 5 ปีที่แล้ว +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.

    • @sravandavuluri5545
      @sravandavuluri5545 4 ปีที่แล้ว

      Sachin
      Were you able to crack VRP with time window ??

    • @kevinoktaprima9672
      @kevinoktaprima9672 3 ปีที่แล้ว

      Hi, i also working on HFVRP. Have you solve your problem?

  • @queenwateurecords599
    @queenwateurecords599 2 ปีที่แล้ว

    thank you so much

  • @alanjomy6602
    @alanjomy6602 3 ปีที่แล้ว

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

    • @styloamnald
      @styloamnald 3 ปีที่แล้ว

      Did you find any soluton for your problem?

  • @yasserelgandazi5564
    @yasserelgandazi5564 5 ปีที่แล้ว

    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 4 ปีที่แล้ว

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

  • @mayankmadhav2370
    @mayankmadhav2370 4 ปีที่แล้ว

    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 3 ปีที่แล้ว

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

  • @hninpannphyu8567
    @hninpannphyu8567 3 ปีที่แล้ว

    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.

  • @luciferhasfallen6019
    @luciferhasfallen6019 4 ปีที่แล้ว

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

    • @SandyGarza95
      @SandyGarza95 4 ปีที่แล้ว

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

    • @david31565
      @david31565 3 ปีที่แล้ว

      @@SandyGarza95 me too

  • @salouaabaakil9436
    @salouaabaakil9436 6 ปีที่แล้ว

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

  • @rideneahmed4691
    @rideneahmed4691 4 ปีที่แล้ว

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

    • @shashankathawale7002
      @shashankathawale7002 4 ปีที่แล้ว

      Hi did you find any approach using pulp?

    • @rideneahmed4691
      @rideneahmed4691 4 ปีที่แล้ว +1

      Yes I did

    • @shashankathawale7002
      @shashankathawale7002 4 ปีที่แล้ว

      @@rideneahmed4691 if you don't find could you please share the algorithm on shashankathawale4778@gmail.com

  • @jipengdai8473
    @jipengdai8473 5 ปีที่แล้ว

    Could I know what IDE do you use?

    • @samkomo4289
      @samkomo4289 5 ปีที่แล้ว

      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)

  • @houssemsalem3774
    @houssemsalem3774 2 ปีที่แล้ว

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

  • @snackbob100
    @snackbob100 4 ปีที่แล้ว

    CAN WE GET CODE PLEASE :)

    •  4 ปีที่แล้ว

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

  • @narendransuresh6416
    @narendransuresh6416 3 ปีที่แล้ว

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