Skip to main content
6 min read

Optimizing Logistics with Job Grouping in the HERE Tour Planning API

HERE Tour Planning job groups

Delivery times and service quality are essential in ensuring customers receive their orders accurately, in the right quantities, and in perfect condition as quickly as possible. HERE Tour Planning creates efficient routes plan for pick-up and delivery jobs by considering various constraints such as number of vehicles in the fleet, vehicle capacity, delivery time windows, driver working hours and traffic. 

In this blog post, we will explore the concept of job grouping within Vehicle Routing Problem (VRP), available with the HERE Tour Planning. By strategically grouping deliveries, you can achieve significant efficiency, resulting in happier customers and most cost-effective operations. Let's explore how it works!

What is VRP with Job Grouping? 

To put it simply, job grouping means pick-up and delivery jobs are organized into distinct clusters based on specific criteria, such as how close various locations are to one another, what the delivery windows are for each location, priority of different jobs and how the location is accessible. The creation of groups almost always increase the efficiency. 

Some scenarios where the job grouping feature plays a major role: 
1. Postal deliveries where the postmen carry sets of house keys to open the mail boxes
2. Restricted access areas where the drivers need to register at a gate to access an area
3. Urban deliveries with specific city quarters

How does Job Grouping work? 

In the HERE Tour Planning API, job grouping allows you to assign a common 'groupId' to specific deliveries. All jobs that have the same 'groupId' are handled together. Once all jobs from the same group are completed, then another group or standalone jobs are processed. The algorithm ensures that a group cannot be split across multiple vehicles; the entire group is served by a single vehicle. However, a single vehicle can serve multiple groups. Reloads and specific-location jobs are also kept separate from the group jobs.

Use Case: Grouping delivery jobs by gated communities.

Consider few pickups and deliveries in two gated communities in an area – let’s say, Community A and Community B – and few deliveries in single family homes outside these communities, also referred to as standalone jobs. The delivery driver needs to register at the gate to access each community. Logically, most efficient sequence is to enter the first community, complete the pickup and delivery jobs within, and then complete the jobs in the second community. Depending on the location, the standalone jobs can be sequenced either before, after or in-between the two communities. Let’s look into how this information is entered in the Tour Planning problem. As mentioned earlier, the ‘groupId’ parameter will be used. 

tour planning locations

Locations for pickup and delivery jobs, starting at the Post Office

Some of these locations are in a gated community

Problem JSON: 

In the plan part of the problem.json, with the location for places to deliver, a new optional parameter - groupId is added. In the first two locations, you can see "groupId": "communityA" and "groupId": "communityB" added.

Copied
        {
  "fleet": {
    ... VEHICLE PROFILE, NUMBER OF VEHICLES, CAPACITY, COSTS, SHIFT LOCATION, TIME
  },
  "plan": {
    "jobs": [
      {
        "id": "29992cd8-13b0-458a-9afe-1e40f8d3f377",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "duration": 300,
                  "location": { "lat": 33.72407, "lng": -118.07467 },
                  "groupId": "communityA"
                }
              ],
              "demand": [1]
            }
          ]
        }
      },
      {
        "id": "230d0c16-478e-4286-b663-46a46f7f589b",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "duration": 300,
                  "location": { "lat": 33.71755, "lng": -118.06397 },
                  "groupId": "communityB"
                }
              ],
              "demand": [1]
            }
          ]
        }
      },
      {
        "id": "30518ca2-fb7c-43ed-9b0f-e1fcb5285799",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "duration": 300,
                  "location": { "lat": 33.72154, "lng": -118.07291 }
                }
              ],
              "demand": [1]
            }
          ]
        }
      },
      ... MORE PICKUP, DELIVERY JOBS, SOME WITH 'groupId'
    ]
  }
}
  

On solving for this problem, the Tour Planning algorithm groups the jobs in the same community together. In the screenshot below, you can see stop #1 and #2 are grouped, and so are #4, #5 and #6. Standalone jobs are sequenced in between (#3) and after the second group (#7), depending on their proximity to the job groups.

tour planning job groups solution

Community A: Stops #1 & #2 are grouped

Community B: Stops #4, #5, #6 are grouped

Bonus: Job Groups with Pick-Up and Drop-off (PUDO) points 

The HERE Tour Planning API also supports the use of PUDOs (Pick-Up and Drop-Off points) within the context of group jobs. Think of this as a designated location where customers can come to pick-up parcels or drop-off items as part of the returns process. If some items are undelivered, the driver may want to leave them at some pick-up points or lockers after the group is served, so the recipient can pick the packages by themselves. By adding PUDO into the problem specification, the tour planning algorithm ensures that the vehicle starts and/or ends with a PUDO for that group.

A PUDO sequence might look like this: PUDO-A (first) -> group A -> PUDO-A (last) -> PUDO-B (first) -> group B -> PUDO-B (last) and so on. 

Note that the PUDOs are optional. You can refer to the documentation to see examples of how PUDOs can be included in the Tour Planning problem definition. 

Next Steps

1. Review the HERE Tour Planning product page.
2. Explore the HERE Tour Planning Developer Guide.
3. Get started with the HERE Tour Planning.
4. Read more about the Job Groups use case.

The HERE Tour Planning API job grouping function can solve numerous problems involving the organization of work, especially when it is essential to plan routes and effectively allocate resources for a group of orders. Strategic job grouping can optimize operations and enhance service delivery. Give it a try!
 

Mohini Todkari

Mohini Todkari

Sr. Developer Evangelist

Have your say

Sign up for our newsletter

Why sign up:

  • Latest offers and discounts
  • Tailored content delivered weekly
  • Exclusive events
  • One click to unsubscribe