Research Article An Iterative Algorithm for the Management of an Electric Car-Rental Service J. Alberto Conejero,1Cristina Jordán,2and Esther Sanabria-Codesal3 1Instituto Universitario de Matem´ atica Pura y Aplicada, Universitat Polit` ecnica de Val` encia, 46022 Val` encia, Spain 2Instituto Universitario de Matem´ atica Multidisciplinar, Universitat Polit` ecnica de Val` encia, 46022 Val` encia, Spain 3Departamento de Matem´ atica Aplicada, Universitat Polit` ecnica de Val` encia, 46022 Val` encia, Spain Correspondence should be addressed to J. Alberto Conejero;
[email protected] Received 21 February 2014; Accepted 24 April 2014; Published 25 May 2014 AcademicEditor:JuanR.Torregrosa Copyright © 2014 J. Alberto Conejero et al. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited. The management of a car-rental service becomes more complex as long as one-way bookings between different depots are accepted. These bookings can increase the operational costs due to the necessity of moving vehicles from one depot to another by the company staff in order to attend previously accepted bookings. We present an iterative model based on flows on networks for the acceptance of bookings by a car-rental service that permits one-way reservations. Our model lets us also recover the movement of the fleet of vehicles between the depots over the time. In addition, it also permits including restrictions on the amount of cars managed at every single depot. These results can be of interest for an electric car-rental service that operates at different depots within a city or region. 1. Introduction Car rentals can admit bookings where the pick-up and dropoff location can coincide or not. If bookings are only admitted when both locations coincide, their management is not as complicated as if bookings are only accepted when the locations are different (one-way bookings). When this happens, these companies face much more difficulties in order to cope with the management of their fleet of vehicles, since these bookings could entail a huge increment of operational costs due to deadhead times. Nevertheless, in order to offer a high level of service thier policy is to accept bookings without a deep examination of its consequences on the operational costs [1]. Theuseoffullyelectricvehicles(FEV)isfosteredby government authorities in order to contribute to the lowering of the current pollution levels [2]. This comes jointly with a gradual phasing out of conventionally-fuelled vehicles from the urban environment [3]. Some references concerning the adoption of these new transportation devices can also be found in [4,5]. The easiest way to implement a rental service of electric vehicles is to make the users return them at the place where thecarshavebeenpickedoff.Thisisdoneinordertobesure that every car has its own parking place with a charging point. Therefore, an improvement in the process of acceptance of bookings that consider one-way trips between different stations and try to avoid, as far as possible, the amount of staff dedicated to the rearrangement of vehicles between the depots is of particular interest in order to facilitate and extend their use among the potential users. Therefore, a social benefit is obtained as long as the number of reservations of these shared vehicles is increased and the number of private cars running is reduced. Flows and networks were firstly used in the air industry for solving fleet routing problems, see for instance [6–9]. The problems that can be solved using them range from schedule design, flight assignment [10], and crew scheduling [11] to scheduling of air cargo alliances [12]. Their techniques have been also considered in the management of car-rental services in order to answer questions of strategic and tactical Hindawi Publishing Corporation Journal of Applied Mathematics Volume 2014, Article ID 483734, 11 pages http://dx.doi.org/10.1155/2014/483734
2Journal of Applied Mathematics decisions, revenue and capacity management, and pricing, see for instance [1,13–15]. We suppose that a simulation of bookings for a car-rental service is given. We model the process of acceptance/rejection of those petitions. This depends on having a car available at the departure point (without leaving unattended any other previously scheduled booking from that place) and on having an empty parking space at the arrival destination. We assume that an answer should be given as fast as possible to the client. Therefore, we will answer each petition before considering the next one. We do not consider the case that a rejected booking can turn to be admissible after some other booking has been accepted. As we said before, the general practice in the car-rental industry is to accept bookings and later to optimize the management of the fleet of vehicles. The car-rental services considered in the frame of this paper are managed with a little different policy. We assume that one of these services does not need to compete with other services and it is just an optional element inside the mobility network of an urban area, where other means of transport are offered to the citizens. Therefore, if a booking should be rejected because of the lack of available cars or empty parking slots, then we reject it since we consider that this will have a low impact on the service perception of prospective users, as long as other means of transport can be used. In this way we determine which bookings should be admitted without falling on deadhead times due to the rearrangement of cars by the car-rental service staff. The paper is organized as follows. In Section 2we introduce some basics of graph theory about flows and networks. We also present time-expanded networks. Our model for managing the bookings using a network is presented in Section 3.Section4is devoted to explain the theoretical background that backs our computational method. A first algorithmic approach based on Ford-Fulkerson algorithm is presented in Section 5. We will see that the problem that arisescanbestatedintermsoffindinganadmissibleflowon a network with minimum capacities at certain edges. Later, an iterative method based on a simplification of the auxiliary network defined for considering the admissibility of the flow will be given in Section 6.Thismethodlaysonasolution of certain shortest path problem. An analysis of the results is reported in Section 7. Finally in Section 8we discuss the contribution of the model to the management of a service in order to offer a cheaper rental service, which will contribute to extend its use for the movements within an urban area. Our algorithm helps to determine if it is advisable to increase the fleet of vehicles or the size of the parking at a certain depot, attending to the increments of cost and to the number of additional bookings accepted. 2. Preliminaries Adirected graph 𝐺 = (𝑉,𝐸) is given by a set of nodes 𝑉and a set of ordered pairs of nodes (arcs). If an arc connects the node 𝑢with the node V, we will simply denote it by (𝑢,V).We recall that a 5-tuple 𝑁=(𝑉,𝐸,𝑠,𝑡,𝑐)is named network if it is a directed weakly connected graph where 𝑉is the set of nodes, 𝐸is the set of arcs, 𝑠isanodewithoutgoingdegreepositive(at least one edge departs from it) usually called source,𝑡is a node with ingoing degree positive (at least one edge arrives to it) usually called sink,and𝑐is a function from 𝐸to Nthat assigns to every edge (𝑢,V)∈𝐸avalue𝑐(𝑢,V)that will represent the maximum capacity permitted on this edge. Given a network 𝑁, we can consider flows on them. A flow 𝑓is a function 𝑓: 𝐸→Nsuch that 𝑓(𝑢,V)≤𝑐(𝑢,V)for every (𝑢,V)∈𝐸,and for every V∈ 𝑉 \ {𝑠,𝑡} the sum of the values of the flow on the edges with Vas initial node coincides with the sum of the flows on the edges with Vas final node; that is, ∑ 𝑢∈𝑉,(𝑢,V)∈𝐸𝑓(𝑢,V)=∑ 𝑢∈𝑉,(V,𝑢)∈𝐸𝑓(V,𝑢).(1) Condition (1)isusuallyknownastheconservation law of the flow.Thevalueoftheflow𝑓on 𝑁,𝑓(𝑁), is defined as the sum of the flows on the adjacent arcs to 𝑠(or to 𝑡): 𝑓(𝑁)=∑ 𝑢∈𝑉,(𝑠,𝑢)∈𝐸𝑓(𝑠,𝑢)=∑ 𝑢∈𝑉,(𝑢,𝑡)∈𝐸𝑓(𝑢,𝑡).(2) Aflow𝑓on 𝑁is said to be maximum if it has the maximum value among all possible flows that can be defined on 𝑁. We refer the reader to [16–24] for general information on flows and networks and graph theory. In particular, we are going to consider time-expanded networks, also called time-space networks [18,25]. In these networks, the inner nodes of the network (not the sink nor the source) represent locations at certain times. The source is connected with all locations at the initial time and all locations at the final time are connected with the sink. This is also the structure used for dealing with problems in which the flow emerges from several sources and leaves at several sinks. Now, we transform this network into a one timeexpanded network in which we reply cities as many times as time periods we are going to consider, see Figure 1. Nodes in each column represent the same city and each level represents the same time period for different cities. In this model we also consider another value associated with each arc named its minimum capacity. The minimum capacity is a function 𝑚:𝐸→N.Theflowthroughevery edge (𝑢,V)∈𝐸must verify 𝑚(𝑢,V)≤𝑓(𝑢,V)≤𝑐(𝑢,V). We denote a network 𝑁with minimum capacities as 𝑁= (𝑉,𝐸,𝑠,𝑡,𝑚,𝑐),where𝑉is the set of nodes, 𝐸the set of edges, 𝑠the source, 𝑡the sink, and 𝑚,𝑐 the minimum and maximum capacities, respectively. Networks with maximum and minimum capacities cannot always admit a flow that respects the upper and lower bounds. It is compulsory that, for every node V∈𝑉, the sum of the maximum capacities of all the edges that arrive to Vwas greater than or equal to the sum of the minimum capacities of all the edges that depart from it. Consider ∑ 𝑢∈𝑉,(V,𝑢)∈𝐸𝑚(V,𝑢)≤∑ 𝑢∈𝑉,(𝑢,V)∈𝐸𝑐(𝑢,V).(3) If not, the conservation law never holds. In the next section, we proceed to explain in detail the steps that let us construct a model for deciding whether to
Journal of Applied Mathematics 3 S 1 23nt1 t2 t3 tm T Figure 1: A time-expanded network with 𝑛depots at 𝑚times. Arcs in green represent bookings of cars and arcs in black represent staying at the parking of each depot. accept or reject a booking attending to the distribution of cars at the departure depot and the existence of empty parking places at the arrival one. 3. A Car-Rental Booking Model Suppose that our car-rental service operates with only one type of car. Let 𝑛be the number of locations (depots) and assume that depot 𝑖starts with a given number of cars 𝑘𝑖. Let 𝑘0be the total number of cars of the company; that is, 𝑘0=∑𝑛 𝑖=1 𝑘𝑖. In addition, we suppose that depot 𝑖has 𝑝𝑖 parking slots at its location to park the cars that are not used by any client and are recharging and waiting to be reserved. We assume that this number cannot be increased along the time. We also consider the bookings along 𝑚consecutive days, ℎpossible times a day. Then the sequence {𝑡𝑗:1≤𝑗≤ℎ𝑚} represents all the possible time periods. For instance, if we consider the times 9:00, 10:00,...,20:00thenℎ=12.Sothat V𝑖,12(𝑎−1)+𝑏,forsome1≤𝑎≤𝑚and 1≤𝑏≤12,represents (8+b):00 a.m. of the day 𝑎at the location 𝑖. The set of nodes 𝑉will consist of 𝑠,𝑡 (the source and the sink) and all the possible combinations of locations and times {V𝑖,𝑗 : 1≤𝑖≤𝑛;1≤𝑗≤ℎ𝑚}where V𝑖,𝑗 represents the location 𝑖at time 𝑡𝑗. The set 𝐸is formed by four types of arcs. The first three are the following ones. (i) (𝑠,V𝑖,1),1≤𝑖≤𝑛,thatconnectthesourcewiththe depots at the first instant of time. (ii) (V𝑖,𝑗,V𝑖,𝑗+1),1≤𝑖≤𝑛,1≤𝑗≤ℎ𝑚−1,thatrepresent staying at a parking between two consecutive times. (iii) (V𝑖,ℎ𝑚,𝑡),1≤𝑖≤𝑛, that connect the depots at the last time to the sink. Our objective is to know if we can accept a booking of 𝑤cars between two determined depots at two different time moments under the restrictions of having enough vehicles atthedeparturedepotandfreespaceatthearrivalone.We define a booking by a 5-tuple 𝑟=(𝑖 𝑝,𝑡𝑝,𝑖𝑑,𝑡𝑑,𝑤),where 1≤𝑖 𝑝,𝑖𝑑≤𝑛,1≤𝑡 𝑝<𝑡 𝑑≤ℎ𝑚,and𝑛∈N,with𝑖𝑝being the pick-up depot, 𝑡𝑑being the pick-up time, 𝑖𝑑being the dropoff city, 𝑡𝑑being the drop-off time, and 𝑤being the number of cars to be reserved. Each booking 𝑟=(𝑖 𝑝,𝑡𝑝,𝑖𝑑,𝑡𝑑,𝑤)is converted into a new edge from node V𝑖𝑝,𝑡𝑝to node V𝑖𝑑,𝑡𝑑.This willbethefourthtypeofarcsofournetwork. Now, we analyze which capacities are necessary to model the movement of the cars along the time and to accept only admissible bookings. We have supposed that depot 𝑖has 𝑝𝑖parking spaces. To set this restriction we assign 𝑝𝑖as maximum capacity to the edge (V𝑖,𝑗,V𝑖,𝑗+1)1≤𝑖≤𝑛,1≤𝑗≤ℎ𝑚,andeverynodeofthe form V𝑖,ℎ𝑚,1≤𝑖≤𝑛,mustbeconnectedwiththesink𝑡by an edge with 𝑝𝑖as maximum capacity. Finally we must assign a minimum capacity to arcs (𝑠,V𝑖,1). If not, the cars at a depot 𝑖could not be considered in the parking in the future. In Figures 2and 3every edge (𝑢,V)∈ 𝐸has a 3-tuple (𝑚(𝑢,V),𝑓(𝑢,V),𝑐(𝑢,V)) associated with it where 𝑚and 𝑐are the minimum and maximum capacities, respectively, and 𝑓denotes the flow. If we suppose that arcs (𝑠,V𝑖,1)have assigned minimum capacity equal to the number of cars of every depot, 𝑘𝑖,wewillavoidtheaforementioned problem. The following example shows the necessity of a minimum capacity for the edges that represent the starting time at every parking. Example 1. Suppose that we start with 6cars at depot 1at time 𝑡=1and with 7cars at depot 2at time 𝑡=1too. We also consider that we have 7and 8parking slots, respectively, at each one of these depots. Let us suppose that we have to decide whether the booking (2,1,1,2,3)could be accepted or not. In Figure 2wehaveapieceofanetworkwithout minimum capacities in the edges (𝑠,V1,1)and (𝑠,V2,1).Inthis case,thereisaflowof3carsacrosstheedge(V2,1,V1,2),and therefore the booking would be accepted. Nevertheless, there are 6 cars parked at slot 1 during all periods of time and this is not taken into account. If they were, then the proposed booking cannot be accepted as it is indicated in Figure 3,since we will have a total number of 9 cars that arrive to node V1,2. Thisisnotpossiblesincetheconservationlawfailsduetothe fact that the maximum capacity of the only edge that departs from (V1,2)is 7. For edges representing bookings, we also have to consider that the minimum and maximum capacity must coincide in order to be sure that the cars follow the booking itinerary and do not stay at the parking of the picking up depot. Next example shows the necessity of minimum capacity for edges associated with bookings. Example 2. Suppose that we want to represent a booking of the form (1,2,2,3,1). This is done by considering a flow of 1 car along the edge (V1,2,V2,3).
4Journal of Applied Mathematics S (0,4,6)(0,7,7) (0,7,7) (3,3,3) (0,4,7)(0,4,8) (0,4,8) 1,1 2,1 1,2 1,3 2,2 2,3 Figure 2: Without minimum capacities on the arcs that depart from 𝑆. S (0,4,8) (0,4,8) 1,1 2,1 1,2 1,3 (6,6,6)(7,7,7) 2,2 2,3 (3,3,3) (0,6,7) (0,9,7) Figure 3: With minimum capacities on the arcs that depart from 𝑆. In Figure 4wehaveapieceofanetworkwithout minimum capacities at the edge (V1,2,V2,3).Inthiscase,we cannot be sure that the flow of 1unit that corresponds to this booking will traverse the edge, and therefore the car will go from depot 1to depot 2atthosetimes.Wecanonlyensure this if we assign a minimum capacity of 1unit to this edge, as it is shown in Figure 5. 4. Existence of an Admissible Flow on the Network The flow over the network that we have already presented simulates the movement of the cars over time. As we said before, a flow through a network with minimum capacities 1,1 1,2 1,3 1,4 2,1 2,2 2,3 2,4 (0,5,7) (0,5,7) (0,5,7) (0,7,8) (0,7,8) (0,7,8) (0,0,1) Figure 4: Without minimum capacities on the arcs that represent a booking. (0,5,7)(0,7,8) (0,7,8) (0,4,7) (0,4,7)(0,8,8) (1,1,1) 1,1 1,2 1,3 1,4 2,1 2,2 2,3 2,4 Figure 5: With minimum capacities on the arcs that represent a booking. could not be admissible. Firstly, the initial number of cars at every depot must be smaller or equal to the number of parking slots at each depot; that is, 𝑘𝑖≤𝑝 𝑖for 𝑖 = 1,...,𝑛. Secondly, a list of bookings, which is in fact a list of new edges to be added to the former network, could result into a network without any admissible flow.
Journal of Applied Mathematics 5 Now, we start with the initial network 𝑁that contains only the first three types of edges that were previously mentioned. This network has the following values as maximum capacities at their edges: 𝑐(𝑢,V)= { { { { { { { { { { { { { { { { { 𝑘𝑖for 𝑢=𝑠,V=V𝑖,1,𝑖=1,...,𝑛 𝑝𝑖for 𝑢=V𝑖,𝑗,V=V𝑖,𝑗+1, 𝑖=1,...,𝑛, 𝑗=1,...,ℎ𝑚−1, 𝑝𝑖for 𝑢=V𝑖,ℎ𝑚,V=𝑡,𝑖=1,...,𝑛. (4) In addition, we also set the following minimum capacities: 𝑚(𝑢,V)= { { { { { { { { { { { { { { { { { 𝑘𝑖for 𝑢=𝑠,V=V𝑖,1,𝑖=1,...,𝑛 0for 𝑢=V𝑖,𝑗,V=V𝑖,𝑗+1, 𝑖=1,...,𝑛, 𝑗=1,...,ℎ𝑚−1, 0for 𝑢=V𝑖,ℎ𝑚,V=𝑡, 𝑖=1,...,𝑛. (5) Then, the following flow results in being admissible on this network: 𝑓(𝑢,V)= { { { { { { { { { { { 𝑘𝑖for 𝑢=𝑠,V=V𝑖,1,𝑖=1,...,𝑛 𝑘𝑖for 𝑢=V𝑖,𝑗,V=V𝑖,𝑗+1,𝑖=1,...,𝑛, 𝑗=1,...,ℎ𝑚−1, 𝑘𝑖for 𝑢=V𝑖,ℎ𝑚,V=t,𝑖=1,...,𝑛. (6) Now, let us suppose that we have an ordered list of 𝐿 bookings requests {𝑟1,...,𝑟𝐿},whereeachbookingisgivenby its corresponding 5-tuple. Consider that these bookings have arrived to us in advance to 𝑡1,forinstancethroughthewebsite of the car-rental company. We have to decide whether we can accept them or not. The acceptance of each booking depends on the acceptance or not of the previous ones. We assume that all bookings must be answered following a first-in/first-out criterion, which is the closest approach to the management of bookings that arrive through a web service. We start with the first booking request 𝑟1= (𝑖𝑝1,𝑡𝑝1,𝑖𝑑1,𝑡𝑑1,𝑤1)andweaddthecorrespondingedge from node V𝑖𝑝1,𝑡𝑝1to V𝑖𝑑1,𝑡𝑑1with maximum and minimum capacities equal to 𝑤1. In order to know if there exists an admissible flow in the network 𝑁 = (𝑉,𝐸,𝑠,𝑡,𝑚,𝑐) with the additional edge corresponding to booking 𝑟1, we define an auxiliary network 𝑁andapplyFord-Fulkersonalgorithmonit.The explanation of Ford-Fulkerson algorithm can also be found in [16,18,19,21]. The use of this network 𝑁in order to determine the existence of an admissible flow on a network with minimum capacities is given by the following result that can be found either in [16,page83]orin[21,page92].Itsapplication provides us with a theoretical support for modeling our problem. Theorem 3. Let 𝑁=(𝑉,𝐸,𝑠,𝑡,𝑚,𝑐)be a network and let one consider its auxiliary network 𝑁defined as follows. (1) The set of nodes of 𝑁consists of the nodes of 𝑁and two new auxiliary nodes 𝑠,𝑡that will be the source and the sink, respectively, of the network 𝑁. (2) To define 𝐸we consider all the edges of 𝐸and we add anewonefrom𝑡to 𝑠, with infinite capacity. (3) For every edge (𝑢,V)∈𝐸with capacity 𝑚(𝑢,V)≥0we also change its maximum capacity 𝑐(𝑢,V)by 𝑐(𝑢,V)− 𝑚(𝑢,V)and we add a new edge (𝑠,V)with maximum capacity 𝑐(𝑠,V)=𝑚(𝑢,V)and another one (𝑢,𝑡)with maximum capacity 𝑐(𝑢,𝑡)=𝑚(𝑢,V). (4) We also set all the minimum capacities of 𝑁to zero. Let 𝑓be a flow of maximum value 𝑓(𝑁)on 𝑁,andlet 𝑓(𝑡,𝑠)be the flow of 𝑓through the edge (𝑡,𝑠).Thereexistsan admissible flow of value 𝑓(𝑡,𝑠) on 𝑁if and only if 𝑓(𝑁)= ∑(𝑢,V)∈𝐸 𝑚(𝑢,V). Remark 4. The proof of Theorem 3shows how to construct theadmissibleflow;wejusthavetodefine𝑓(𝑢,V)=𝑓 (𝑢,V)+ 𝑚(𝑢,V)for every edge (𝑢,V)in the initial network 𝑁,andits value will be 𝑓(𝑡,𝑠). To sum up, the network 𝑁obtained when considering also the first booking 𝑟1has 𝑉∪{𝑠,𝑡}as the set of nodes, 𝑠 as the source, 𝑡as the sink, and the following edges with their corresponding maximum capacities. These new capacities are defined as: 𝑐(𝑢,V)= { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { ∞, for 𝑢=𝑡,V=𝑠, 𝑛 ∑ 𝑖=1𝑘𝑖for 𝑢=𝑠,V=𝑡 , 𝑘𝑖for 𝑢=𝑠 ,V=V𝑖,1, 𝑖=1,...,𝑛, 𝑝𝑖for 𝑢=V𝑖,𝑗,V=V𝑖,𝑗+1, 𝑖=1,...,𝑛, 𝑗=1,...,ℎ𝑚−1, 𝑝ifor 𝑢=V𝑖,ℎ𝑚,V=𝑡, 𝑖=1,...,𝑛, 𝑤1for 𝑢=V𝑖𝑝1,𝑡𝑝1,V=𝑡 , 𝑤1for 𝑢=𝑠 ,V=V𝑖𝑑1,𝑡𝑑1. (7) We have eliminated the edges that should appear on 𝑁with maximum capacity equal to 0. If there exists a maximum flow on this network of value 𝑓(𝑁)=∑𝑛 𝑖=1 𝑘𝑖+
6Journal of Applied Mathematics S T 1,1 1,2 2,1 2,2 (k1,−,k 1)(k2,−,k 2) (0, −, p1) (0, −, p1) (0, −, p2) (0, −, p2) Figure 6: Network 𝑁. 𝑤1, then the booking should be accepted by Theorem 3.Ifitis not accepted, we remove the edges (V𝑖𝑝1,𝑡𝑝1,𝑡)and (𝑠,V𝑖𝑑1,𝑡𝑑1). If yes, then we keep these two edges on 𝑁. Example 5. Supposethatwehavetwodepots,1and 2,with 𝑘1cars at depot 1 and 𝑘2cars at depot 2. We consider each depot at two different times, 𝑡=1and 𝑡=2.Suppose that we have a booking of 𝑤1cars from depot 1at time 𝑡1 to depot 2at time 𝑡2.InFigure6we have the initial network 𝑁with the minimum and maximum capacities at every edge. Theflowisnotindicatedatanyarc.InFigure7we have the corresponding auxiliary network 𝑁wherewehavereduced the minimum capacities 0ofthearcsasitisindicatedin(7). We recall that the arcs with maximum capacity equal to 0are also removed. After dealing with 𝑟1,wepasstonextbooking𝑟2= (𝑖𝑝2,𝑡𝑝2,𝑖𝑑2,𝑡𝑑2,𝑤2)andweproceedasbefore,addingtwonew edges to 𝑁with capacity 𝑤2: 𝑐(𝑢,V)={ { { { { 𝑤2,for 𝑢=V𝑖𝑝2,𝑡𝑝2,V=𝑡 , 𝑤2,for 𝑢=𝑠 ,V=V𝑖𝑑2,𝑡𝑑2.(8) If for dealing with an arbitrary booking 𝑟= (𝑖𝑝,𝑡𝑝,𝑖𝑑,𝑡𝑑,𝑤),one(ortwo)oftheedges(V𝑖𝑝,𝑡𝑝,𝑡)and (𝑠,V𝑖𝑝,𝑡𝑝)are already defined on 𝑁;whatwehavetodois to sum 𝑤to the existing maximum capacity of that edge and test the admissibility of 𝑁. If the booking should not beaccepted,thenwejusthavetodecreasethemaximum capacity of that edge on 𝑤,leavingtheedgewiththeprevious capacity. Remark 6. Our model lets us cancel a booking some time after it was already accepted. It is sufficient to decrease the maximum capacity along the corresponding edge in as many units as the booking indicates, removing it if, afterwards, its S S T T 1,1 1,2 2,1 2,2 (0, −, p1) (0, −, p1) (0, −, p2) (0, −, p2) (0, −, k1) (0, −, k2) (0, −, ∞) (0, −, k1+k 2) Figure 7: Auxiliary network 𝑁. maximum capacity is 0. But we have to check if doing this we get a network without an admissible flow. On one hand, this could happen with one-way bookings when the car was required to be at another city in the future for being used for another booking departing from there. In this case, the car must be moved there by the company staff. On the other hand, thelackofanadmissibleflowonthenetworkcanalsocome from the necessity of needing more parking spaces available at the departure city during part of the time that the car was reserved. 5. Algorithm for Computing the Admissibility of the Network 𝑁 In this section we explain how we define the graph of 𝑁 in order to maximize the flow on this network. The Ford- Fulkerson algorithm provides a solution for the quest of a maximum flow between a source and a sink on a network. As we have mentioned in the previous section, the acceptance of a booking depends on verifying whether a certain network 𝑁with minimum capacities admits a flow or not, and this can be reduced to find a maximum flow on an auxiliary network 𝑁. The following algorithm shows how to define 𝑁andhowtouseitinordertoacceptorrejecta reservation. Step 1. Notation (1.1) 𝑛, number of depots. (1.2) For every 1≤𝑖≤𝑛,𝑝𝑖stands for the number of parking places available at depot 𝑖. (1.3) For every 1≤𝑖≤𝑛,𝑘𝑖denotes the initial number of cars at depot 𝑖. (1.4) ℎ𝑚 is the total number of time moments considered, 𝑡1,...,𝑡ℎ𝑚. (1.5) The network 𝑁will have ℎ𝑚𝑛+4nodes; that is, 𝑛 depots at ℎ𝑚 different times plus 4 nodes for 𝑠,𝑡,𝑠, and 𝑡.
Journal of Applied Mathematics 7 (1.6) 𝐴=(𝑎 𝑖,𝑗)is matrix of capacities in 𝑁,whose dimensions are (ℎ𝑚𝑛+4)×(ℎ𝑚𝑛+4). The nodes are enumerated in the adjacency matrix as follows: (i) For 1≤𝑖≤𝑛,1≤𝑗≤ℎ𝑚, V𝑖,𝑗 → 𝑛(𝑗−1)+𝑖, (ii) 𝑡→ℎ𝑚𝑛+1, (iii) 𝑠→ℎ𝑚𝑛+2, (iv) 𝑡→ℎ𝑚𝑛+3, (v) 𝑠→ℎ𝑚𝑛+4. (1.7) Set {𝑟1,...,𝑟𝐿}asalistofbookings.Set𝛼=1,which will be the counter for the reservations. (1.8) Set Λ=0, which will accumulate the number of cars in accepted bookings. Step 2. Initilialize 𝐴 For every 1 ≤ 𝑖,𝑗 ≤ ℎ𝑚𝑛+4, we define the following: 𝑎𝑖,𝑗 = { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { 𝑝ℓfor 𝑖=𝑘𝑛+ℓ,𝑗=𝑖+𝑛,0≤𝑘≤ℎ𝑚−2, 1≤ℓ≤𝑛, 𝑝ℓfor 𝑖=(ℎ𝑚−1)𝑛+ℓ,𝑗=ℎ𝑚𝑛+1, 1≤ℓ≤𝑛, 𝑘ℓfor 𝑖=ℎ𝑚𝑛+4, 𝑗=ℓ,1≤ℓ≤𝑛, 𝑛 ∑ ℓ=1𝑘ℓfor 𝑖 = ℎ𝑚𝑛+2, 𝑗 = ℎ𝑚𝑛+3, ∞for 𝑖 = ℎ𝑚𝑛+1, 𝑗 = ℎ𝑚𝑛+2, 0elsewhere. (9) Remark. 𝑎𝑖,𝑗 =0canrepresentthelackofanedgeorthe existence of an edge with capacity equal to 0. Step 3. Analyze the bookings. While 𝛼≤𝐿,take𝑟𝛼=(𝑖 𝑝,𝛼,𝑡𝑝,𝛼,𝑖𝑑,𝛼,𝑡𝑑,𝛼,𝑤𝛼). (3.1) Update the following elements of 𝐴: 𝑎𝑖,𝑗 ={ { { { { 𝑎𝑖,𝑗 +𝑤 𝛼for 𝑖=ℎ𝑚𝑛+4, 𝑗=𝑛(𝑡 𝑑,𝛼 −1)+𝑖𝑑,𝛼, 𝑎𝑖,𝑗 +𝑤 𝛼for 𝑖=𝑛(𝑡 𝑝,𝛼 −1)+𝑖𝑝,𝛼,𝑗=ℎ𝑚𝑛+3. (10) (3.2) Maximize the flow 𝑓(𝑁)of the network 𝑁using Ford-Fulkerson algorithm. (3.3) If 𝑓(𝑁)=Λ+∑𝑛 𝑖=1 𝑘𝑖+𝑤 𝛼,then (i) accept the booking 𝑟𝛼, (ii) update Λ=Λ+𝑤 𝛼 elsewhere, (iii) undo the assignments in 𝐴of Step (3.1). (3.4) Set 𝛼=𝛼+1andreturntoStep3. Step 4. Wefinishwhenallthebookingshavebeenprocessed. In order to reduce the computational cost of the above algorithmwehaveanalyzeditsimplementationbasedonthe notion of a residual network. Let 𝑁 = (𝑉,𝐸,𝑠,𝑡,𝑐) be a network with a flow 𝑓over 𝑁. Without loss of generality, we assume that each pair of nodes is connected in just one sense, either (𝑢,V)∈𝐸or (V,𝑢) ∈ 𝐸but not at the same time. We define the residual network 𝑁𝑓as the network 𝑁𝑓= (𝑉,E,𝑠,𝑡, 𝑐), with the same nodes, source, and sink as 𝑁.The set of arcs Econsists of all the arcs of the form (𝑢,V)such that either (𝑢,V)or (V,𝑢)belong to 𝐸;thatis,everyarcof𝐸 is maintained and it has also an associated arc in the opposite sense. Besides, the new capacities, 𝑐,onthisnewsetEare defined as 𝑐(𝑢,V)={ { { 𝑐(𝑢,V)−𝑓(𝑢,V),if (𝑢,V)∈𝐸, 𝑓(𝑢,V),if (V,𝑢)∈𝐸. (11) We define an 𝑓-augmenting path on 𝑁𝑓as a path from 𝑠to 𝑡,namely, 𝑝, such that all the edges in this path have positive capacity. We define the capacity of 𝑝,namely, 𝑐 𝑝as the minimum of the capacities of all the arcs in 𝑝.Theflowis maximum when there is not an 𝑓-augmenting path on 𝑁𝑓. Let us consider the network 𝑁 𝑓associated with the network 𝑁defined in previous algorithm with the initial flow defined in (6), which results in being admissible in 𝑁. Then, the new adjacency matrix 𝐴𝑓=(𝑎 𝑓 𝑖,𝑗)that corresponds to the network 𝑁 𝑓will be 𝑎𝑓 𝑖,𝑗 = { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { 𝑝ℓ−𝑘ℓfor 𝑖=𝑘𝑛+ℓ,𝑗=𝑖+𝑛, 0≤𝑘≤ℎ𝑚−2, 1≤ℓ≤𝑛, 𝑘ℓfor 𝑗=𝑘𝑛+ℓ,𝑖=𝑗−𝑛,1≤𝑘≤ℎ𝑚−1, 1≤ℓ≤𝑛, 𝑝ℓ−𝑘ℓfor 𝑖=(ℎ𝑚−1)𝑛+ℓ,𝑗=ℎ𝑚𝑛+1, 1≤ℓ≤𝑛, 𝑘ℓfor 𝑖=ℎ𝑚𝑛+1, 𝑗=(ℎ𝑚−1)𝑛+ℓ, 1≤ℓ≤𝑛, 𝑘ℓfor 𝑖=ℓ,𝑗=ℎ𝑚𝑛+4, 1≤ℓ≤𝑛, 𝑛 ∑ ℓ=1𝑘ℓfor 𝑖 = ℎ𝑚𝑛+3, 𝑗 = ℎ𝑚𝑛+2, 𝑛 ∑ ℓ=1𝑘ℓfor 𝑖 = ℎ𝑚𝑛+2, 𝑗 = ℎ𝑚𝑛+1, ∞for 𝑖 = ℎ𝑚𝑛+1, 𝑗 = ℎ𝑚𝑛+2, 0elsewhere. (12)
8Journal of Applied Mathematics k1+k 2 k1+k 2 k1 k1 k1 w1 w1 k2 k2 k2∞p1−k 1 p1−k 1 p2−k 2 p2−k 2 S T Figure 8: The network of Example 5after the first iteration of Step (3.1) in the algorithm. The arcs in black belong to 𝑁,andthearcs with a purple (dashed) line represent the additional edges to be considered with the former ones of 𝑁in order to have the residual network of 𝑁. After each booking 𝑟𝛼=(𝑖 𝑝,𝛼,𝑡𝑝,𝛼,𝑖𝑑,𝛼,𝑡𝑑,𝛼,𝑤𝛼),welook for an 𝑓augmenting path 𝑝from 𝑠to 𝑡in the residual network associated with the network 𝑁 𝑓.Theresidualone is updated following the indications in (10). For the sake of clarity, we provide, in Figure 8,theresidualnetworkof 𝑁in Example 5after the first iteration of Step (3.1) in the algorithm. The edges with 0capacity and the labels of all the nodes except 𝑠and 𝑡have been removed in order to get a neater picture. 6. A Simplified Algorithm for Computing the Admissibility of a Flow on a Network We refer again to Example 5.Thenodesthatstandfor the drop-off depot before the drop-off time, the nodes that refer to the pick-up depot before the pick-up time, and 𝑠 canberemovedbecauseifsomeofthemappearinan𝑓augmenting path, they do it in a cycle, and this cycle can be erased from the 𝑓-augmenting path without decreasing its capacity. Therefore, the only way to find an 𝑓-augmenting path without cycles from 𝑠to 𝑡is to consider the following path: {𝑠,V2,2,𝑡,V1,2,V1,1,𝑡}. Therefore, a simplification of the residualnetworkinwhatconcernstothisbookingcanbeseen in Figure 9. Such a path exists if the following conditions are fulfilled whether 𝑤1≤𝑝 1−𝑘 1and 𝑤1≤𝑘 2.Sobychecking them we can omit the restrictions given by the arcs (𝑠,V2,2) and (V1,1,𝑡),andthenetwork𝑁is reduced to the time-space part plus the initial sink 𝑡,seeFigure10. Taking this into account, Step 3in the algorithm of Section 5can be significantly simplified. Let us take a booking (𝑖𝑝,𝑡𝑝,𝑖𝑑,𝑡𝑑,𝑤).Inordertoacceptit,weonlyhavetofind,if there exists, a path that connects the node V𝑖𝑑,𝑡𝑑with the node V𝑖𝑝,𝑡𝑝with capacity greater than or equal to 𝑤.Suchapathcan be easily found using a shortest path algorithm, like Dijkstra’s, k1 w1 w1 k2 k2 p1−k 1 p2−k 2 p2−k 2 T T1,1 1,2 2,1 2,2 S Figure 9: A simplified version of the residual network of Example 5 is to be considered in order to decide whether to accept or not the booking (V1,1,V2,2,𝑤1). This is accepted if we find an 𝑓-augmenting path from 𝑆to 𝑇to be increased in 𝑤1units. The arcs in the 𝑓augmenting path are represented in green. k1 k2 k2 p1−k 1 p2−k 2 p2−k 2 T 1,1 1,2 2,1 2,2 Figure 10: A more simplified version of the residual network of Example 5. The booking (V1,1,V2,2,𝑤1)will be accepted if there is an 𝑓-augmenting path from V2at time 𝑡=2to V1at time 𝑡=1 to be increased in 𝑤1units. The arcs in the 𝑓-augmenting path are represented in green. in the residual network associated with 𝑁. This path will be of the form V𝑖𝑝,𝑡𝑝,V𝑖𝑝,𝑡𝑝+1,...,V𝑖𝑝,𝑡ℎ𝑚,𝑡,V𝑖𝑑,𝑡ℎ𝑚,...,V𝑖𝑑,𝑡𝑑+1,V𝑖𝑑,𝑡𝑑.(13) Further information concerning Dijkstra’s algorithm can be found, for instance, in [16,18,19,21,24]. We point out that the use of a shortest path algorithm prevents us from getting an 𝑓-augmentingpathwithcycles. With respect to the previous algorithm, we modify the steps indicated below but considering the matrix 𝐴𝑓previously defined. Step 1.Notation (1.6.bis) 𝐴𝑓=(𝑎 𝑓 𝑖,𝑗)amatrixofdimensions(ℎ𝑚𝑛+1)×(ℎ𝑚𝑛+ 1).Thenodesareenumeratedintheadjacencymatrix as follows: (i) V𝑖,𝑗 → 𝑛(𝑗−1)+𝑖,
Journal of Applied Mathematics 9 (ii) 𝑡→ℎ𝑚𝑛+1; thatis,wehaveremovedthevertex𝑠,𝑡,and𝑠and the adjacent arcs to them. In addition, Step (1.8)is removed. Step 2.Initialization of 𝐴𝑓 In the same way as in (12), but restricting ourselves to the new dimensions of 𝐴𝑓,weomit𝑠,𝑠,𝑡, and their adjacent arcs. Step 3.Analyze the bookings While 𝛼≤𝐿,take𝑟𝛼=(𝑖 𝑝,𝛼,𝑡𝑝,𝛼,𝑖𝑑,𝛼,𝑡𝑑,𝛼,𝑤𝛼). (3.1)Find a shortest path 𝑝between the nodes 𝑛(𝑡𝑑,𝛼 −1)+ 𝑖𝑑,𝛼 and 𝑛(𝑡𝑝,𝛼 −1)+𝑖𝑝,𝛼. (3.2)Compute the capacity of 𝑝,namely, 𝑐 𝑝. (3.3)If 𝑤𝛼≤ 𝑐 𝑝then do the following. (i) Accept the booking 𝑟𝛼. (ii) Update the following elements of 𝐴𝑓: 𝑎𝑓 𝑖,𝑗 = { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { 𝑎𝑓 𝑖,𝑗 −𝑤 𝛼 for 𝑖=𝑛(𝑡 𝑑,𝛼 −1)+𝑖𝑑,𝛼 +𝑘𝑛, 𝑗=𝑖+(𝑘+1)𝑛,𝑘=0,...,ℎ𝑚−𝑡𝑑,𝛼, 𝑎𝑓 𝑖,𝑗 +𝑤 𝛼 for 𝑖=𝑗+(𝑘+1)𝑛, 𝑗 = 𝑛(𝑡𝑑,𝛼 −1)+𝑖𝑑,𝛼 +𝑘𝑛, 𝑘=0,...,ℎ𝑚−𝑡𝑑,𝛼, 𝑎𝑓 𝑖,𝑗 −𝑤 𝛼 for 𝑖=𝑛(ℎ𝑚−1)+𝑖𝑑,𝛼,𝑗=ℎ𝑚𝑛+1, 𝑎𝑓 𝑖,𝑗 +𝑤 𝛼 for 𝑖=ℎ𝑚𝑛+1, 𝑗=𝑛(ℎ𝑚−1)+𝑖𝑑,𝛼, 𝑎𝑓 𝑖,𝑗 +𝑤 𝛼 for 𝑖=𝑛(ℎ𝑚−1)+𝑖𝑝,𝛼,𝑗=ℎ𝑚𝑛+1, 𝑎𝑓 𝑖,𝑗 −𝑤 𝛼 for 𝑖=ℎ𝑚𝑛+1, 𝑗=𝑛(ℎ𝑚−1)+𝑖𝑝,𝛼, 𝑎𝑓 𝑖,𝑗 +𝑤 𝛼 for 𝑖=𝑛(𝑡 𝑝,𝛼 −1)+𝑖𝑝,𝛼 +𝑘𝑛, 𝑗=𝑖+(𝑘+1)𝑛,𝑘=0,...,ℎ𝑚−𝑡𝑝,𝛼, 𝑎𝑓 𝑖,𝑗 −𝑤 𝛼 for 𝑖=𝑗+(𝑘+1)𝑛,𝑗 = 𝑛(𝑡𝑝,𝛼 −1)+𝑖𝑝,𝛼 +𝑘𝑛, 𝑘=0,...,ℎ𝑚−𝑡𝑝,𝛼. (14) elsewhere (iii) Reject the booking 𝑟𝛼. (3.4)Set 𝛼=𝛼+1and return to Step 3. Step 4.Wefinishwhenallthebookingshavebeenprocessed. 7. Some Additional Considerations about the Model In our assumptions we have considered that we start the scheduling of bookings from scratch starting on time 𝑡1,but this is only the real case once in the company lifetime. The interval of time 𝑡1,...,𝑡ℎ𝑚 must be finite. Nevertheless, we can consider that before running the algorithm on the model we have already confirmed some bookings that started before 𝑡1andsomethatwillfinishafter𝑡ℎ𝑚. In order to introduce them in our model: (i) for every existing booking (𝑖𝑝,𝑡𝑝,𝑖d,𝑡𝑑,𝑤)with 𝑡𝑝< 𝑡1and 𝑡1≤𝑡 𝑑≤𝑡 ℎ𝑚,weaddanewedge(𝑠,V𝑖𝑑,𝑡𝑑)with maximum and minimum capacity equal to 𝑤, (ii) for every existing booking (𝑖𝑝,𝑡𝑝,𝑖𝑑,𝑡𝑑,𝑤)with 𝑡1≤ 𝑡𝑝≤𝑡 ℎ𝑚 and 𝑡ℎ𝑚 <𝑡 𝑑,weaddanewedge(V𝑖𝑝,𝑡𝑝,𝑡) with maximum and minimum capacity equal to 𝑤. We have also considered that we are dealing with only one type of car. If our fleet has several types of cars ordered in increasing category as 𝑥1≺𝑥 2≺⋅⋅⋅≺𝑥 𝑙,wewillproposea model with 𝑙-layers. In the lower one we have a network for cars of type 𝑥1, in the one above of it we deal with the cars of type 𝑥2,andsoon.Weshouldpointoutthatinthiscase the number of parking spaces is shared by several types of cars. Sometimes the clients could ask for a car of low type, for instance 𝑥1,andthecompanycouldhavenoneofthose cars available of this layer for renting. However, we can try to seeifwecanofferhimacaroftype𝑥2.Ifthisisthecase,we canconfirmthebookingandgranttheclientwithanupgrade when he arrives to the pick-up depot. The client will be happy andtheservicehaveacceptedabookingthatotherwisecould be lost. 8. Results and Discussion The proposed model simulates the flow of the fleet of vehicles of a car-rental service without staff dedicated to move cars from one location to another one, as could sometimes be needed to do due to one-way bookings. This model has the advantage that let us recover the flow of cars across the depots alongthetime,asitisindicatedinRemark6. The model is based on determining the admissibility of aflowonanetworkwithminimumcapacities.Itsimplementation is backed by Theorem 3.Inourfirstmodelevery new booking only requires defining at most one new edge on the auxiliary network and applying the well-known Ford- Fulkerson algorithm on it. Later, a simplification of the network permits us to solve the problem using a shortest path algorithm. On one hand, Ford-Fulkerson algorithm can be easily computed on a network with Mathematica©by using the command NetworkFlow [network, source, sink]oftheCombinatorica package. In our case, network would be the graph associated with 𝑁,𝑠would be the source, and 𝑡would be the sink. The complexity of Ford-Fulkerson algorithm is O(|E|⋅𝑓(𝑁)),whereEis the set of edges in the network 𝑁 and 𝑓(𝑁)is the maximum flow on it, see for instance [19,