Additional planning (outdated version)

Used for working with Excel templates or for getting familiarized with how additional planning works. This method is supported but no longer developed. If you want to automate additional planning tasks (when working via the API), we recommend using regular additional planning.

Fixed order sequence

To keep the order sequence, use the vehicles.visited_locations field. If new orders can get mixed with the existing ones randomly, use the vehicles.planned_route field. In planned_route, you can specify both orders and depots for reloading that the courier needs to visit when following the route. Set is_middle_depot = true for them.

The planned_route doesn't support adding breaks. If you need to take into account the courier's work and rest schedule during additional planning, use the regular additional planning (initial_routes).

Courier's current location

If the courier is at the depot, you need to know the following to generate a request:

  • What orders were already assigned to each vehicle.
  • What new orders have been received since the last planning.

In the new request for additional planning per each vehicle, use the field planned_route (visited_locations) to specify the IDs (locations or id) for already assigned orders (from the previous planning iteration).

If the courier is en route, you need to know the following to generate a request:

  • What orders were already assigned to each vehicle.
  • Location of each vehicle at the time of additional planning (this may also be the last delivered or the next order in the sequence).
  • List of already completed orders.
  • What new orders have been received since the last planning.

In the new request for additional planning:

  1. For each vehicle, use the planned_route field (visited_locations) to specify the IDs (locations or id) of already assigned orders (from the previous planning iteration), but not completed at the time of additional planning.

  2. Add dummy orders to the list: these orders should correspond to the current location points for each vehicle. You can skip this step if the current location is the last order delivered or the next order in the sequence.

  3. For each vehicle, specify the ID of its current location and the time of departure from it in the first element in the visited_locations field.

    To set the time of departure from the location, use the planned_route.start_time parameter (or visited_locations.N.time).

    Possible time formats:

    • Relative: [D.]HH[:MM[:SS]], where D is the date shift relative to the start date of the route.
    • Absolute: ISO 8601 format (for example, 2018-09-06T10:15:00+03:00).

    Learn more about time formats

    Example

    Here, departure from route location 1001 will be scheduled for 10:20.

    "visited_locations": [
        {
            "id": "1001",
            "shift_id": "1",
            "time": "10:20"
        },
    ...
    ]
    

    Note

    For previously unused vehicles, set the correct departure parameters: either shift the start time of the shift or specify the current depot location in visited_locations.

  4. From the list of orders, delete the already completed ones (consider item 2: if the last delivered order is used as the current location, don't delete it).

Examples

Basic task

The task includes 70 orders and 9 available couriers, the balanced groups option is used balanced_groups.

Get 5 couriers in the solution.

Planning result:

Courier

Number of orders

Order sequence

Courier 3

15

27, 70, 53, 64, 65, 40, 60, 4, 43, 28, 29, 49, 33, 56, 48

Courier 4

13

45, 31, 58, 52, 24, 54, 39, 47, 19, 30, 44, 16, 63

Courier 5

10

14, 41, 8, 10, 1, 12, 13, 22, 9, 46

Courier 6

15

11, 3, 23, 51, 42, 55, 36, 68, 66, 61, 25, 7, 67, 57, 62

Courier 7

17

18, 37, 38, 17, 2, 59, 35, 34, 32, 26, 20, 69, 5, 50, 15, 21, 6

API request (JSON)API responseView on map

Now let's look at the methods of additional planning for the basic task.

Example 1

Additional planning at the depot, changing the order sequence in  the routes.

In the request, enter 110 orders (40 of them are new compared to the basic task) and 9 available couriers. For 5 couriers, specify the assignment from the basic task in planned_route. Also, use the balanced group option (balanced_groups).

Get 7 couriers in the solution.

Planning result:

Courier

Number of orders

Sequence of orders relative to the basic task

Courier 1

14

New route

Courier 3

19

4 orders added: 27, 70, 53, 64, 65, 40, 99, 60, 4, 43, 28, 95, 29, 49, 33, 56, 88, 48, 84

Courier 4

16

3 jrders added: 45, 31, 58, 52, 87, 24, 54, 39, 100, 47, 19, 30, 44, 16, 102, 63

Courier 5

13

3 orders added, big changes in order sequence: 46, 80, 71, 12, 1, 10, 8, 41, 83, 14, 13, 22, 9

Courier 6

17

2 orders added: 11, 3, 23, 79, 51, 42, 55, 36, 68, 66, 61, 25, 7, 108, 67, 57, 62

Courier 7

18

1 order added: 18, 37, 38, 17, 2, 59, 35, 34, 32, 26, 20, 69, 104, 5, 50, 15, 21, 6

Courier 9

13

New route

Note

Orders planned in the basic task are still assigned to the same couriers, but:

  • For the couriers from the basic solution, new orders are added among other points on the route.

  • For the couriers from the basic solution, the order sequence planned earlier is changed.

  • 2 new routes are added.

API request (JSON)API responseView on map

Example 2

Additional planning at the depot, without changing the order sequence in the routes.

In the request, enter 110 orders (40 of them are new compared to the basic task) and 9 available couriers. For 5 couriers, specify the assignment from the basic task in  visited_locations. Also, use the balanced group option (balanced_groups).

Get 7 couriers in the solution.

Planning result:

Courier

Number of orders

Sequence of orders relative to the basic task

Courier 3

19

4 orders added: 27, 70, 53, 64, 65, 40, 60, 4, 43, 28, 29, 49, 33, 56, 48, 84, 88, 96, 85

Courier 4

15

2 orders added: 45, 31, 58, 52, 24, 54, 39, 47, 19, 30, 44, 16, 63, 102, 89

Courier 5

14

4 orders added: 14, 41, 8, 10, 1, 12, 13, 22, 9, 46, 80, 71, 79, 108

Courier 6

15

Same route: 11, 3, 23, 51, 42, 55, 36, 68, 66, 61, 25, 7, 67, 57, 62

Courier 7

17

Same route: 18, 37, 38, 17, 2, 59, 35, 34, 32, 26, 20, 69, 5, 50, 15, 21, 6

Courier 8

14

New route

Courier 9

16

New route

Note

Orders planned in the basic task are still assigned to the same couriers, but:

  • For the couriers from the basic solution, new orders were added to the end of the route.

  • 2 new routes are added.

API request (JSON)API responseView on map

Example 3

Additional planning when couriers have already departed from the depot (without changing the sequence of orders in the routes).

At the time of planning, assume that 15 orders were delivered (3 orders for each of the 5 couriers from the basic task), and delete them from the additional planning task.

In total, enter 100 orders in the request (40 new orders, 55 non-delivered orders from the basic task, and 5 courier start points), and 9 available couriers. For 5 couriers, specify the assignment from the basic task in  visited_locations. Also, use the balanced group option (balanced_groups).

Get 8 couriers in the solution (3 of them are new couriers who start from the depot).

Planning result:

Courier

Number of orders*

Sequence of orders relative to the basic task

Courier 2

9

New route

Courier 3

13

Same route: 27, 70, 53 (delivered orders), 1003 (start point), 64, 65, 40, 60, 4, 43, 28, 29, 49, 33, 56, 48

Courier 4

11

1 order added: 45, 31, 58 (delivered orders), 1004 (start point), 52, 24, 54, 39, 47, 19, 30, 44, 16, 63, 101

Courier 5

10

3 orders added: 14, 41, 8 (delivered orders), 1005 (start point), 10, 1, 12, 13, 22, 9, 46, 80, 71, 79

Courier 6

13

1 order added: 11, 3, 23 (delivered orders), 1006 (start point), 51, 42, 55, 36, 68, 66, 61, 25, 7, 67, 57, 62, 108

Courier 7

14

Same route: 18, 37, 38 (delivered orders), 1007 (start point), 17, 2, 59, 35, 34, 32, 26, 20, 69, 5, 50, 15, 21, 6

Courier 8

12

New route

Courier 9

13

New route

*: without the delivered orders and start point.

Note

In this solution, all the couriers start at 11:00, and new orders are added to the end of the route.

API request (JSON)API responseView on map

Contact support