# Smart Recommendations for Renting Bikes in Bike-Sharing Systems
## 4 User-Centred Station Recommendation
### Distance Expected Resources  
If a recommendation or information system is used by users to select a station to rent or return a bike, this system could take into account past requests in order to make better estimations of available bikes at a station in the near future. In particular, if a user \(u_{k}\) asks at time \(t\) to rent or return a bike, the system may recommend a station \(s_{i}\), and can assume that the user will take or return a bike there when they arrive, i.e., at time \(t+wtime(l_{k},\;l(s_{i}))\) or \(t+bitme(l_{k},\;l(s_{i}))\), respectively. This information can be used to better determine whether or not there will be available bikes at \(s_{i}\) if another user requests information. In the same way, expected returns of bikes can help to predict available slots. Figure 1 explains this idea in more detail. Suppose that at time \(t\), user \(u_{k}\) (at location \(l_{k}\)) asks for a station to rent a bike, and the given option would be station \(s_{i}\). At time \(t\), there are \(n\) available bikes at station \(s_{i}\), and the system tries to estimate the available bikes at the moment when \(u_{k}\) would actually arrive at \(s_{i}\), i.e., at time \(t_{exp}=t+wtime(l_{k},\;l(s_{i}))\). Before instant \(t\), the system has already recommended station \(s_{i}\) to other users for either renting or returning bikes, and assumes that those users will actually follow the recommendations and, thus, will return or take bikes at their expected arrival times. These actions are reflected  
in Figure 1: at time \(t_{1}\), a bike is expected to be taken; at \(t_{2}\), a bike is expected to be returned, and so on. Let \(changes\big{(}s_{i},t,t_{exp}\big{)}\) denote the sum of the expected changes in the number of available bikes at station \(s_{i}\) in the time interval between the time of issuing a user request \(t\) and the potential arrival of the user at \(t_{exp}\). Here, each bike rental in this period counts as \(-1\), and each bike return counts as \(+1\). In the example, \(changes\big{(}s_{i},t,t_{exp}\big{)}\) would be \(-1\). We can now estimate the number of bikes or slots expected to be available at the arrival time \(t_{exp}\) of user \(u_{k}\) by \(bikes(s_{i},t)\ +\ changes\big{(}s_{i},t,t_{exp}\big{)}\) and \(slots(s_{i},t)\ -\ changes\big{(}s_{i},t,t_{exp}\big{)}\). The system may also take into account the possibility that even if there are some bikes or slots available when user \(u_{k}\) arrives, some of those may have been already \"committed\", e.g., they have been the basis for recommendations to other users who will eventually arrive after the expected arrival time of user \(u_{k}\). In Figure 1, this refers to the events at \(t_{4}\), \(t_{5}\),... \(t_{x}\). Such events could be conceived as \"implicit reservations\", and the system could try to \"block\" a number of bikes or slots for further recommendations. Here, we do not refer to a real blocking of a bike or slot for future users. Instead, the system would simply factor in this information when determining recommendations. The number of \"committed\" bikes or slots depends on the sequence of expected events, and corresponds to the worst cases: the maximum and minimum values of \(changes\big{(}s_{i},t_{exp},t_{x}\big{)}\), the expected changes after the user arrives, up to the last known event at time \(t_{x}\) (or \(t_{x}=t_{exp}\), if there is none). We denote these two values by:  
\[committedSlots\big{(}s_{i},t_{exp}\big{)}\ =\max_{t_{exp}\leq t_{i}\leq t_{x}} \big{(}changes\big{(}s_{i},t_{exp},t_{i}\big{)}\big{)} \tag{7}\]  
and:  
\[committedBikes\big{(}s_{i},t_{exp}\big{)}\ =\ \bigg{|}\min_{t_{exp}\leq t_{i}\leq t _{x}}\big{(}changes\big{(}s_{i},t_{exp},t_{i}\big{)}\big{)}\bigg{|} \tag{8}\]  
In Figure 1, \(committedSlots\big{(}s_{i},t_{exp}\big{)}\ =3\) signifies that three extra slots have to be \"reserved\" because a sequence of two taken and five returned bikes reaches a peak of 3 before \(t_{x}\).