ors-map-client icon indicating copy to clipboard operation
ors-map-client copied to clipboard

support for Optimization API(for VRP problems)

Open stefanocudini opened this issue 5 years ago • 6 comments

I was wondering if there is a roadmap for this project somewhere.

I wanted to understand if in the future we intend to support the Optimization API features of ORS as well. I hope that in the CRUD component it is not difficult to add support, probably the complex part is in the frontend to manage many vehicles and many destinations.

great project!

stefanocudini avatar Sep 16 '20 12:09 stefanocudini

Hey @stefanocudini! Thanks for the input. How do you imagine this implemented on the map client, regarding the interface? I noticed that the response to a optimization request brings no geographic data. So how do you think it should be displayed on a map-oriented app, like this?

amoncaldas avatar Sep 17 '20 12:09 amoncaldas

Vroom the software that is behind Optimization API has an option to respond with the geometry of the paths.. the complex part may be is the interaction of user in input data

stefanocudini avatar Sep 18 '20 09:09 stefanocudini

May I consider that this feature is only feasible when the back-end is returning geometries? If that is the case, I will close this issue and then we could reopen it when the back-end is ready.

amoncaldas avatar Sep 28 '20 15:09 amoncaldas

ORS Optimization API just return the geometry os solutions in Encoded Polyline format: https://openrouteservice.org/dev/#/api-docs/optimization refer to this page for output format: https://github.com/VROOM-Project/vroom/blob/master/docs/API.md#routes

stefanocudini avatar Oct 01 '20 14:10 stefanocudini

a valid body including routes might be e.g.:

{
   "jobs":[
      {
         "id":1,
         "service":300,
         "amount":[
            1
         ],
         "location":[
            8.684955,
            49.420844
         ],
         "skills":[
            1
         ],
         "time_windows":[
            [
               32400,
               36000
            ]
         ]
      },
      {
         "id":2,
         "service":300,
         "amount":[
            1
         ],
         "location":[
            8.673971,
            49.443798
         ],
         "skills":[
            1
         ]
      },
      {
         "id":3,
         "service":300,
         "amount":[
            1
         ],
         "location":[
            8.683754,
            49.433356
         ],
         "skills":[
            2
         ]
      },
      {
         "id":4,
         "service":300,
         "amount":[
            1
         ],
         "location":[
            8.687186,
            49.422688
         ],
         "skills":[
            2
         ]
      },
      {
         "id":5,
         "service":300,
         "amount":[
            1
         ],
         "location":[
            8.68916,
            49.407883
         ],
         "skills":[
            14
         ]
      },
      {
         "id":6,
         "service":300,
         "amount":[
            1
         ],
         "location":[
            8.679034,
            49.427045
         ],
         "skills":[
            14
         ]
      }
   ],
   "vehicles":[
      {
         "id":1,
         "profile":"driving-car",
         "start":[
            8.673278,
            49.450996
         ],
         "end":[
            8.675879,
            49.418958
         ],
         "capacity":[
            4
         ],
         "skills":[
            1,
            14
         ],
         "time_window":[
            28800,
            43200
         ]
      },
      {
         "id":2,
         "profile":"driving-car",
         "start":[
            8.663218,
            49.419038
         ],
         "end":[
            8.707868,
            49.411291
         ],
         "capacity":[
            4
         ],
         "skills":[
            2,
            14
         ],
         "time_window":[
            28800,
            43200
         ]
      }
   ],
   "options":{
      "g":"true"
   }
}

resulting in :

{
   "code":0,
   "summary":{
      "cost":2489,
      "unassigned":0,
      "delivery":[
         6
      ],
      "amount":[
         6
      ],
      "pickup":[
         0
      ],
      "service":1800,
      "duration":2489,
      "waiting_time":0,
      "distance":15582,
      "computing_times":{
         "loading":180,
         "solving":4,
         "routing":69
      }
   },
   "unassigned":[
      
   ],
   "routes":[
      {
         "vehicle":1,
         "cost":975,
         "delivery":[
            2
         ],
         "amount":[
            2
         ],
         "pickup":[
            0
         ],
         "service":600,
         "duration":975,
         "waiting_time":0,
         "distance":5998,
         "steps":[
            {
               "type":"start",
               "location":[
                  8.673278,
                  49.450996
               ],
               "load":[
                  2
               ],
               "arrival":31381,
               "duration":0,
               "distance":0
            },
            {
               "type":"job",
               "location":[
                  8.673971,
                  49.443798
               ],
               "id":2,
               "service":300,
               "waiting_time":0,
               "job":2,
               "load":[
                  1
               ],
               "arrival":31616,
               "duration":235,
               "distance":1030
            },
            {
               "type":"job",
               "location":[
                  8.684955,
                  49.420844
               ],
               "id":1,
               "service":300,
               "waiting_time":0,
               "job":1,
               "load":[
                  0
               ],
               "arrival":32400,
               "duration":719,
               "distance":4607
            },
            {
               "type":"end",
               "location":[
                  8.675879,
                  49.418958
               ],
               "load":[
                  0
               ],
               "arrival":32956,
               "duration":975,
               "distance":5997
            }
         ],
         "geometry":"ilylH{~|s@@`@Hl@HPJPNTz@jAf@f@NLPNRGtByAXQdEkD`GiE`@[t@i@DP@FBLL`@Jd@Rr@DJBNJTHONWh@w@v@eAb@BRFBNFNBVTzBlAUlAe@r@Wz@W{@Vs@VmAd@mATU{BCWCmACc@PUTWrBuBTSlAgA\\Yb@Ur@[vAm@XMVMHENIVOTMbEoC~HsFhFmD`Ai@VOrHkDz@]zB_AVMXEh@[HCJGZQDCLG^Sb@QlAYLMBETCjCQj@ENAzDUfA@|ADfCFdAAVA`@?~@MNEJEh@WPIb@Sx@e@z@_@B@`@HJBNDpBdAn@NN?NANC`Am@FGRMHILMDELMHY@KbAcD`A}C`BgFX_Af@}AX{@Rm@P]PWJKLItAg@~CgAzCaAb@OrBq@XK@BBJ\\bHNlDL|Bh@tFBVBVBXz@rIBXD\\n@xHB\\SDoAZ_BHwBDmEDc@BmA^e@VEBk@j@KNEJEN?L?TNVdAlBDHdB|Cf@dATf@Td@p@nA`@f@`Az@bAf@pB^`AFx@@n@?^?F?L?L?T?`@@dA@"
      },
      {
         "vehicle":2,
         "cost":1514,
         "delivery":[
            4
         ],
         "amount":[
            4
         ],
         "pickup":[
            0
         ],
         "service":1200,
         "duration":1514,
         "waiting_time":0,
         "distance":9584,
         "steps":[
            {
               "type":"start",
               "location":[
                  8.663218,
                  49.419038
               ],
               "load":[
                  4
               ],
               "arrival":28800,
               "duration":0,
               "distance":0
            },
            {
               "type":"job",
               "location":[
                  8.679034,
                  49.427045
               ],
               "id":6,
               "service":300,
               "waiting_time":0,
               "job":6,
               "load":[
                  3
               ],
               "arrival":29094,
               "duration":294,
               "distance":2296
            },
            {
               "type":"job",
               "location":[
                  8.683754,
                  49.433356
               ],
               "id":3,
               "service":300,
               "waiting_time":0,
               "job":3,
               "load":[
                  2
               ],
               "arrival":29576,
               "duration":476,
               "distance":3396
            },
            {
               "type":"job",
               "location":[
                  8.687186,
                  49.422688
               ],
               "id":4,
               "service":300,
               "waiting_time":0,
               "job":4,
               "load":[
                  1
               ],
               "arrival":30114,
               "duration":714,
               "distance":5183
            },
            {
               "type":"job",
               "location":[
                  8.68916,
                  49.407883
               ],
               "id":5,
               "service":300,
               "waiting_time":0,
               "job":5,
               "load":[
                  0
               ],
               "arrival":30766,
               "duration":1066,
               "distance":7255
            },
            {
               "type":"end",
               "location":[
                  8.707868,
                  49.411291
               ],
               "load":[
                  0
               ],
               "arrival":31514,
               "duration":1514,
               "distance":9584
            }
         ],
         "geometry":"mcslH__{s@PGHEEWM_AUsBGkAEy@EeC?w@Fe@@eA@S?S?WAqBA_@AgAE]CmAIcAUwBYgBYwBKyAE_C?eB?_A@aO?c@BADQDM?{@?a@G]@_A?I?Q?G?CAOEIEGEEG?gC?kACc@?a@Ca@KgAe@[Uu@y@u@sAUc@[u@_@{@oBsDc@u@e@u@Wa@Yi@Wc@aCoDa@g@KM}A{B]a@u@}@EDEBEDIHQNgA|@`@fAR~@b@pBw@h@~@lEaAp@cAt@iAh@Ig@a@yCIs@CMEGyAb@I}@QcBo@qFCYE[Cc@HaB@Y@O@U?IB[OBULORAD{@^y@d@c@RQHi@VKDOD_ALa@?W@eA@gCG}AEgAA{DTO@k@D?CCu@Ei@?SC[?[AQ@K?M@MDUFQICC?B?HBGPETAL?LAJ@P?ZBZ?RDh@Bt@?Bj@ENAzDUfA@|ADfCFdAAVA`@?~@MNEJEh@WPIb@Sx@e@z@_@B@`@HJBNDpBdAn@NN?NANC`Am@FGRMHILMDELMHY@KbAcD`A}C`BgFX_Af@}AX{@Rm@P]PWJKLItAg@~CgAzCaA?D@Nt@dHu@\\}Ar@K{@WqB[wC?EzCaAb@OrBq@XKdBu@x@Yx@g@lAu@p@]fAc@B@LFNCFCtBq@^WJO@IDETS~@gAfAmA\\WRG`@CFAn@CN@n@CjACNAP?tBIL?HA|@CJ?H?hCKXAN?TBL@R?\\CdDk@jDm@FCN@D?VTFJHZJ^JTHFFBN?DAD?NIPKvAq@NIvAs@HCPEJCJ?JBRFTRLLPLHDNDJDDAfAGRAFDDBDFJVBFBZVdCFh@Hr@B^Dd@@@Fr@J~@KDUHKBP~AQ_BJCTIJEDXJbAFTHTTGLE^OUwBg@oFCIIEA?C?UHi@PGi@WeCC[@I?ODO@Mb@CF?HAjAGD?`@KDAHCPGZIHcAFe@Bg@@KBy@?M@a@@q@?iE?C?OGgAiEwUS{@c@gBQeAYeCIeAWmDAIImACUOyBIeAC}@Ey@?QAOCm@I}BCi@DEDMD[J_AHo@Da@?E?CC_@Q{AGg@IWAC_@e@S]Og@GSk@iB}AeFs@}AACUc@IQUe@S_@CCAAQ?gAa@GEDNNh@VbAX~ATbAXtAHZZpA@FNlA@FBDADAF"
      }
   ]
}

TheGreatRefrigerator avatar Oct 01 '20 15:10 TheGreatRefrigerator

@TheGreatRefrigerator I think that input data from user is more complex than show output of the result

for showing results of problem how you can look here: https://github.com/VROOM-Project/vroom-frontend

perhaps you could add a client side module that handles this particular data model for vrp, before sending data to the server

I don't know the code of this app well maybe @amoncaldas have some suggestions?

stefanocudini avatar Oct 05 '20 10:10 stefanocudini