Breaks, Soft Breaks, and Floating Breaks

MARE offers a wide variety of methods to express breaks in a route – these are periods during a shift which the vehicle/driver is not servicing any orders. The breaks are properties of the shift, so that in problems where a vehicle has multiple shifts, different breaks can exist for the same vehicle across the different shifts. There are three types of breaks supported

  • Break : A period of time during which the vehicle is not moving and no orders are serviced. This type of break is useful to express events such as a lunch break at a known time. For the standard break, the start and end time are explicitly expressed, and the break is always honored. A shift can have multiple breaks but the breaks cannot overlap (since two overlapping breaks really just represent a single longer break).
  • Soft Break : A period of time during which no orders are serviced, but the vehicle may or may not be moving. This type of break is useful to express events such as a pre-scheduled phone call that might take place while the vehicle is moving. For the soft break, the start and end time are explicitly expressed, and the soft break is always honored. A shift can have multiple soft breaks but the soft breaks cannot overlap (since two overlapping soft breaks really just represent a single longer soft break). A shift can have a mixture of breaks and soft breaks, but they cannot overlap.
  • Floating Break: The floating break has a fixed duration but can start at any time during a provided window. The vehicle is not allowed to be moving during a floating break. The floating break can be used to handle compliance requirements where a driver must receive a certain amount of rest during any continuous work period of a certain length. As with the other breaks, any route for the shift will always honor the floating break. Floating breaks can be used in conjunction with the other break types.

Example

Hard Break: In the following three examples, we have a single vehicle with 6 total orders in the Washington, DC/Baltimore area. In each case we have a different kind of 45 minute break that impacts the efficiency of the shift. In the first example, we have a hard break from 12:30 to 1:15. As the vehicle cannot be traveling during this period, it turns out that it is not possible to visit all 6 orders in this case and the Baltimore order is not visited. The route ends at 3:22, and there is more than 2 hours of time remaining in the shift. However, that does not provide sufficient time to complete a round trip to Baltimore to service the final order.

{
  "constraints": [
    {
      "constraint_type": "Travel_Time",
      "constraint_name": "Minimize travel time",
      "violation_increment": 1,
      "penalty_per_violation": 1,
      "max_travel_time_seconds": 0
    },
    {
      "constraint_type": "Visit_Range",
      "constraint_name": "Visit all orders",
      "violation_increment": 1,
      "penalty_per_violation": 10000
    }
  ],
  "vehicles": [
    {
      "vehicle_id": "My Car",
      "type": "car",
      "shifts": [
        {
          "shift_end": "2018-10-01T17:30:00-04:00",
          "shift_id": "single shift",
          "shift_start": "2018-10-01T08:00:00-04:00",
          "start_location_id": "White House",
          "end_location_id": "White House",
		  "break_start": [
            "2018-10-01T12:30:00-04:00"
          ],
          "break_end": [
            "2018-10-01T13:15:00-04:00"
          ]
        }
      ]
    }
  ],
  "locations": [
    {
      "longitude": -76.6227,
      "location_id": "Ravens Stadium",
      "latitude": 39.278
    },
    {
      "longitude": -77.0502,
      "latitude": 38.8893,
      "location_id": "Lincoln Memorial"
    },
    {
      "longitude": -77.035278,
      "latitude": 38.889484,
      "location_id": "Washington Monument"
    },
    {
      "longitude": -77.0257,
      "latitude": 38.8967,
      "location_id": "Fords Theater"
    },
    {
      "longitude": -77.0477,
      "latitude": 38.8913,
      "location_id": "Vietnam Memorial"
    },
    {
      "longitude": -77.0365,
      "latitude": 38.8814,
      "location_id": "Thomas Jefferson Memorial"
    },
    {
      "longitude": -77.0365,
      "latitude": 38.8977,
      "location_id": "White House"
    }
  ],
  "orders": [
    {
      "order_id": "Service Ravens Stadium",
      "min_visits": 1,
      "location_id": "Ravens Stadium",
      "duration": 3600
    },
    {
      "order_id": "Service Washington Monument",
      "duration": 5000,
      "location_id": "Washington Monument"
    },
    {
      "order_id": "Service Fords Theatre",
      "duration": 3600,
      "location_id": "Fords Theater"
    },
    {
      "order_id": "Service the Abe Lincoln Memorial",
      "duration": 3600,
      "location_id": "Lincoln Memorial"
    },
    {
      "order_id": "Service the Vietnam Memorial",
      "duration": 3600,
      "location_id": "Vietnam Memorial"
    },
    {
      "order_id": "Service the Thomas Jefferson Memorial",
      "duration": 3600,
      "location_id": "Thomas Jefferson Memorial"
    }
  ]
}
With a hard break of 45 minutes starting at 12:30, it is not possible to visit all 6 orders.

Soft Break: In a soft break, recall that the vehicle is allowed to be moving during the break. This additional level of flexibility allows us to now visit all 6 orders as the soft break is taken after servicing the Baltimore order and returning to DC. The route concludes with about 40 minutes to spare before the end of the shift.

{
  "constraints": [
    {
      "constraint_type": "Travel_Time",
      "constraint_name": "Minimize travel time",
      "violation_increment": 1,
      "penalty_per_violation": 1,
      "max_travel_time_seconds": 0
    },
    {
      "constraint_type": "Visit_Range",
      "constraint_name": "Visit all orders",
      "violation_increment": 1,
      "penalty_per_violation": 10000
    }
  ],
  "vehicles": [
    {
      "vehicle_id": "My Car",
      "type": "car",
      "shifts": [
        {
          "shift_end": "2018-10-01T17:30:00-04:00",
          "shift_id": "single shift",
          "shift_start": "2018-10-01T08:00:00-04:00",
          "start_location_id": "White House",
          "end_location_id": "White House",
		  "soft_break_start": [
            "2018-10-01T12:30:00-04:00"
          ],
          "soft_break_end": [
            "2018-10-01T13:15:00-04:00"
          ]
        }
      ]
    }
  ],
  "locations": [
    {
      "longitude": -76.6227,
      "location_id": "Ravens Stadium",
      "latitude": 39.278
    },
    {
      "longitude": -77.0502,
      "latitude": 38.8893,
      "location_id": "Lincoln Memorial"
    },
    {
      "longitude": -77.035278,
      "latitude": 38.889484,
      "location_id": "Washington Monument"
    },
    {
      "longitude": -77.0257,
      "latitude": 38.8967,
      "location_id": "Fords Theater"
    },
    {
      "longitude": -77.0477,
      "latitude": 38.8913,
      "location_id": "Vietnam Memorial"
    },
    {
      "longitude": -77.0365,
      "latitude": 38.8814,
      "location_id": "Thomas Jefferson Memorial"
    },
    {
      "longitude": -77.0365,
      "latitude": 38.8977,
      "location_id": "White House"
    }
  ],
  "orders": [
    {
      "order_id": "Service Ravens Stadium",
      "min_visits": 1,
      "location_id": "Ravens Stadium",
      "duration": 3600
    },
    {
      "order_id": "Service Washington Monument",
      "duration": 5000,
      "location_id": "Washington Monument"
    },
    {
      "order_id": "Service Fords Theatre",
      "duration": 3600,
      "location_id": "Fords Theater"
    },
    {
      "order_id": "Service the Abe Lincoln Memorial",
      "duration": 3600,
      "location_id": "Lincoln Memorial"
    },
    {
      "order_id": "Service the Vietnam Memorial",
      "duration": 3600,
      "location_id": "Vietnam Memorial"
    },
    {
      "order_id": "Service the Thomas Jefferson Memorial",
      "duration": 3600,
      "location_id": "Thomas Jefferson Memorial"
    }
  ]
}
The soft break is taken on the way back down to DC after the Baltimore order (stop 3 in the route).

Floating Break: The floating break allows us an additional degree of flexibility as we are now allowed to take the 45 minute break at any time during the day. Even though the break is similar to a hard break in that the vehicle cannot be moving, the freedom to scheduled this break any time during the shift allows sufficient freedom that we are now able to visit all 6 orders. The floating break occurs immediately after the final order at the Vietnam Memorial, and we complete the route with less than 2 minutes to spare in the shift.

{
  "constraints": [
    {
      "constraint_type": "Travel_Time",
      "constraint_name": "Minimize travel time",
      "violation_increment": 1,
      "penalty_per_violation": 1,
      "max_travel_time_seconds": 0
    },
    {
      "constraint_type": "Visit_Range",
      "constraint_name": "Visit all orders",
      "violation_increment": 1,
      "penalty_per_violation": 10000
    }
  ],
  "vehicles": [
    {
      "vehicle_id": "My Car",
      "type": "car",
      "shifts": [
        {
          "shift_end": "2018-10-01T17:30:00-04:00",
          "shift_id": "single shift",
          "shift_start": "2018-10-01T08:00:00-04:00",
          "start_location_id": "White House",
          "end_location_id": "White House",
		  "floating_break_window_start": "2018-10-01T08:00:00-04:00",
	      "floating_break_window_end": "2018-10-01T17:30:00-04:00",
          "floating_break_duration": 2700
        }
      ]
    }
  ],
  "locations": [
    {
      "longitude": -76.6227,
      "location_id": "Ravens Stadium",
      "latitude": 39.278
    },
    {
      "longitude": -77.0502,
      "latitude": 38.8893,
      "location_id": "Lincoln Memorial"
    },
    {
      "longitude": -77.035278,
      "latitude": 38.889484,
      "location_id": "Washington Monument"
    },
    {
      "longitude": -77.0257,
      "latitude": 38.8967,
      "location_id": "Fords Theater"
    },
    {
      "longitude": -77.0477,
      "latitude": 38.8913,
      "location_id": "Vietnam Memorial"
    },
    {
      "longitude": -77.0365,
      "latitude": 38.8814,
      "location_id": "Thomas Jefferson Memorial"
    },
    {
      "longitude": -77.0365,
      "latitude": 38.8977,
      "location_id": "White House"
    }
  ],
  "orders": [
    {
      "order_id": "Service Ravens Stadium",
      "min_visits": 1,
      "location_id": "Ravens Stadium",
      "duration": 3600
    },
    {
      "order_id": "Service Washington Monument",
      "duration": 5000,
      "location_id": "Washington Monument"
    },
    {
      "order_id": "Service Fords Theatre",
      "duration": 3600,
      "location_id": "Fords Theater"
    },
    {
      "order_id": "Service the Abe Lincoln Memorial",
      "duration": 3600,
      "location_id": "Lincoln Memorial"
    },
    {
      "order_id": "Service the Vietnam Memorial",
      "duration": 3600,
      "location_id": "Vietnam Memorial"
    },
    {
      "order_id": "Service the Thomas Jefferson Memorial",
      "duration": 3600,
      "location_id": "Thomas Jefferson Memorial"
    }
  ]
}
The floating break allows us to visit all 6 orders even though the vehicle does not move during the break. Note that we traverse the orders in a slightly different sequence than with the soft break. With MARE’s ability to incorporate predicted traffic into the route optimization, the floating break can be a powerful way to add some additional flexibility into the route.