def validate_maximum_distance(vrp, **kwargs):
    """
    Validates the maximum travel distance of given individual's solution.
    :param vrp: An individual subject to validation.
    :param kwargs: Keyword arguments. The following are expected
    from it:

    - (int) 'maximum_distance': Maximum travel distance for every vehicle.
    - (numpy.ndarray) path_table: Square matrix that represents
      distances between nodes.

    :return: True, if solution is distance-wise valid. False if not.
    Second return value is a string that provides details about it.
    """

    maximum_distance = kwargs["maximum_distance"]
    path_table = kwargs["path_table"]

    route_list = vrp.get_route_list()

    for active_route in route_list:
        route_distance = 0
        if len(active_route) <= 1:
            continue
        recent_node = active_route[0]
        recent_depot = active_route[0]

        for i in range(1, len(active_route)):
            point_a = active_route[i - 1]
            point_b = active_route[i]
            route_distance += path_table[point_a][point_b]

            if route_distance > maximum_distance:
                return False, "Maximum distance constraint violation (Route Node {} / {}, situated at {}): {} / {}" \
                    .format(i, len(active_route) + 1, point_b, route_distance, maximum_distance)

            # Mark down most recent node for the return trip.
            recent_node = point_b

        # Traveling back to the depot node.
        route_distance += path_table[recent_node][recent_depot]
        if route_distance > maximum_distance:
            return False, "Maximum distance constraint violation (Return to Depot Node {}): {} / {}" \
                .format(recent_depot, route_distance, maximum_distance)

        # Save route time for later inspections.
        vrp.route_distances.append(route_distance)

    return True, "Maximum distance constraint not violated"