The Offline Group Seat Reservation Knapsack Problem With Profit on Seats

In this paper we present the Group Seat Reservation Knapsack Problem with Profit on Seat. This is an extension of the the Offline Group Seat Reservation Knapsack Problem. In this extension we introduce a profit evaluation dependant on not only the space occupied, but also on the individual profit brought by each reserved seat. An application of the new features introduced in the proposed extension is to influence the distribution of passengers, such as assigning seats near the carriage centre for long journeys, and close to the door for short journeys. Such distribution helps to reduce the excess of dwelling time on platform. We introduce a new GRASP based algorithm that solves the original problem and the newly proposed one. In the experimental section we show that such algorithm can be useful to provide a good feasible solution very rapidly, a desirable condition in many real world systems. Another application could be to use the algorithm solution as a startup for a successive branch and bound procedure when optimality is desired. We also add a new class of problem with five test instances that represent some challenging real-world scenarios that have not been considered before. Finally, we evaluate both the existing model, the newly proposed model, and analyse the pros and cons of the proposed algorithm.


I. Introduction
In this paper we extend the Offline Group Seat Reservation Knapsack Problem (GSR-KP) presented in Clausen et al. (2010). In the original formulation, a train with W seats stops in H stations. It is required to allocate n reservations. Each reservation i occupy a set of contiguous seats for w i people from one initial station y i to a final one h i . The profit is identified as to maximise the space occupied during the journey. In our extension the value of the profit of the reservation is dependent also on the profits assigned to seats in which the reservation is eventually allocated.
Our extension makes the problem more realistic, allowing the modelling of scenarios that were not possible to model with the original formulation. The new scenarios cover the cases where the ideal position of an item is affected by how long the item must be kept in its position. We exploit the original naming style and call the new extension Group Seat Reservation Knapsack Problem with Profit on Seat (GSR-KPPS). Moreover, solving realistically sized instances is challenging for a general solver and often having a good solution rapidly may be better than having an optimal solution later, e.g. when there are fixed time constraints.
Thus, we suggest a new GRASP procedure that solves GSR-KP and GSR-KPPS. Eventually, we adapt and improve the original instances considered in Clausen et al. (2010) adding a random profit on seats and proposing five new problems.
The GSR-KP is the problem of maximising the use of seats in a train during its journey. In the offline version, the passengers reserve a seat from a departing station until their arrival station. Each reservation is known in advance and before the train departs. A reservation can occupy on one or more than one seats. Groups of people are considered to be willing to sit on close seats, this is true especially for long journey, e.g. business trips or family trips with children.
For example, according to a survey by Transport Focus (Transport Focus, 2016) in a typical busy UK station that is used for both long and short/commuting journeys, 29% of passengers were travelling in groups, and 7% of passengers were travelling with children.
GSR-KP belongs to the family of the packing problems in two dimensions. In the packing terminology, the reservations are the items, and the train is the bin. The bin and items are rectangles. Packing rectangles into a rectangle is a strongly NP-Complete class of problems (Leung et al., 1990). Regarding the bin, the dimension of the side parallel to the horizontal axis represents the number of seats, while the dimension of the vertical side represents the journey length of the train. For each item, the dimension of the horizontal side represents the number of people in the reservation, while the dimension of the vertical side represents the journey length of the reservation. The dynamic of a reservation consists of reserving a seat, or a group of seats, from a departing station to an arrival station. This special behaviour is modelled by a special constraint which forces the vertical position of the item.
The GSR-KP has similarities with the Dynamic Storage Allocation Problem (DSA) (Garey and Johnson, 1990), but they can be considered two different problems. One of the differences is on the definition of the bin. Both problems consider a fixed height for the bin. However, while the bin in the GSR-KP has a maximum width, the bin in the DSA is generally an open bin. The second difference between the two problems is their objective. The GSR-KP maximises the space occupied, or equivalently minimises the wasted space.
The DSA on the other hand has the same objective as a bin packing problem, i.e. it tries to compress the allocation of memory space toward one side to ensure that the allocated areas are contiguous.
Thus, a solution of the DSA can be a solution of the GSR-KP, but a solution of the GSR-KP may not be a solution of the DSA. A DSA problem only has the same solution as the GSR-KP if it is a special instance with an upper bound on the available storage space, and if the amount of memory space to be allocated is strictly greater than the available storage space.
We propose to extend GSR-KP to create a new model that can distribute the allocation of passengers based on their journey length and the profit of the seats, e.g. allocate reservations of long journeys or groups in the centre of the carriage, and reservations of short journeys or unitary groups near doors, reducing the excess of friction during the boarding/alighting phases (Yazdani et al., 2019). Another notable application is in the events industry, e.g different stands may cost differently depending on their location and size. Applications as such can also be modelled using this newly proposed model, considering the lending requests as reservations with time and size, while the price paid to the lender is dependant on the position in which the request will be placed. A similar problem exists also in the tourism industry, for example in the booking system of an hotel, different room may have a different profit.
Our work can be especially meaningful for the United Kingdom (UK) rail industry (Hatano, 2004;UK, 2016).
The UK rail industry is an open market, Train Operators are private, or a mix of private and public, companies in competition on the main corridors. In longer journeys, i.e. from Liverpool to London, booking a seat in advance is the common rule of thumb to avoid standing up for the whole journey. Train Operators are interested in reducing delays to improve the Public Performance Measure and gain a competitive advantage over competitors.
The first novelty of this paper is the introduction of a new problem extension, the GSR-KPPS, that binds seat-based profit with the length of the reserved journey in a mixed integer programming (MIP) model.
The second novelty is a GRASP based algorithm that is suitable for both GSR-KP and GSR-KPPS. Such algorithm is useful when the time to achieve a solution is fixed.
The third novelty is the adaptation and extension of the instances used in Clausen et al. (2010). We introduced a new group of problems that better represents some challenging real world scenarios than the ones suggested in the original paper.
The paper is organised as follows. In section II we outline

II. Previous work
To the best of our knowledge, since the original publication of the problem in Clausen et al. (2010), none of the follow-up study on the Group Seat Reservation Problem has shown to be better than the original work. An online version of the seat allocation problem was first published in Boyar and Larsen (1999), and further analysis was made in Goyal (2018). A real-time algorithm that aims to reduce the  (Gonçalves and Resende, 2011b;Gupta et al., 2017;Jegadeshwari and Jais-ree, 2014;Wang and Chen, 2010) and their biased versions Resende, 2011a, 2013), divide and conquer algorithms (in which the solution space is partitioned and searched independently) (Wei et al., 2013), neuro-genetic approaches that mix neural networks and genetic algorithms (Deane and Agarwal, 2013), GRASP algorithms (Resende and Ribeiro, 2019) and GRASP/Path relinking (Alvarez-Valdés et al., 2013), Tabu search (Ceschia and Schaerf, 2013;Crainic et al., 2009) and other greedy randomized heuristics (Crainic et al., 2012;Perboli et al., 2011).
The GSR is a specialised version of the bin packing problem in the two dimensional case, so every algorithm that has been designed for orthogonal two dimensional rectangular packing will work on a GSR problem. The difference in our contribution is that none of them can exploit the nature of the problem: in a two dimensional problem both dimensions are free, while in a GSR problem the allocation toward one dimension is constrained.

III. Definitions, terminology and MIP model
Using the usual terminology of the packing problems and utilising as much as possible the terminology used in Each reservation asks to reserve w i seats from station y i to station y i + h i . Without any loss of generality, we can assume that w i ≤ W .
First, we briefly describe the original GSR-KP as shown in Clausen et al. (2010). The active stations are represented is the set of requests using a seat at station y ∈ Y . Associated with each station y ∈ Y there is a "height" H y that represents the distance from station Finally, let l ij = 1 iff request i is located left of request j.
The original model is shown in Eq: (1)-(8), the item profit is identified with the item area (w i · h i ), the objective (1) is to maximise the profit. Constraint (2) enforces that the number of allocated seats must not exceed the train capacity in any station. Constraint (3) makes sure that two requests i and j are selected, than only one must be on the left of the other. Constraint (4) enforces that two selected items must not overlap. Constraint (5) ensures that an item must be allocated inside the train. The remaining constraints (6)-(8) define the domains of the model variables. We refer the reader to the original paper for a further explanation.
Our model extends the original one by considering also a profit value associated to the seat. From the modelling perspective, it translates in a two-dimensional knapsack problem where the item profit is dependant on a combination of its area and its position inside the bin. The distribution of the passengers among and along the carriages can be modelled by assigning profits on the seats, i.e.
considering the seats of each carriage, the central seats have higher profit than the seats near to the doors (this profits assignment will allocate reservation with longer journey or more people in the center of the carriage).
Let Q := {1, . . . , W } be the set of seats, and p k , k ∈ Q be the profit p k associated to the seat k. Let γ i,k , i ∈ N, k ∈ Q be 1 iff reservation i occupies seat k.
The differences between the models are on the objective (9), which now includes the profit associated on the seat, and in three additional constraints (13)-(15). Considering an unitary profit we will produce the same results of the original model, thus, the proposed model can be considered as an extension of the original problem. Constraint (13) represents the total allocation of a reservation. If the reservation i is booked, then w i seats must be allocated, otherwise none has to be assigned. Constraint (14) enforces the contiguity of the allocated seats k, for the reservation i. Constraint (10) represents the knapsack constraint, which enforce allocation inside the train. Constraints (11) and (12) represent the fact that two items i,j must not overlap.

IV. Proposed algorithm
In this section we describe the proposed algorithm. The algorithm is a GRASP procedure Resende, 1989, 1995;Ribeiro, 2016, 2019) that exploits a percentage of the best bound found by the continuous relaxation of the problem (relaxing integer and boolean variables to real variables) for enforcing a stopping condition. The rationale to use a GRASP based method is to produce a simple algorithm that produces good solutions in a very limited time. Such algorithm can be used as a startup for a successive branch and bound procedure, or can be used directly when achieving a solution in the timelimit is more important than achieving absolute optimality.
The main procedure, Algorithm 1 (Algorithm will be abbreviated as Alg from now on), is composed by the fol- and if c ≤ 0.5 try to improve the current candidate, otherwise try to improve the best solution found so far. The return values of the main procedure are best, limit and c best . best is the sequence of indexes that represents the best solution, limit is the position of the last fitting reservation index in best, c best is the evaluation of the profit totalised in the feasible part of the best solution.
The evaluation procedure, Alg 2, requires as input the candidate list. We remind that a candidate solution is a permutation of the n indices that represent the reservations, the evaluation procedure "cuts" the candidate up to the last feasible element limit. There are two ideas behind  Martello and Toth (1990)     This complexity can be reduced to O(log 2 (n) · N 2 ) by using a balanced binary tree to represent the already placed objects, and a dichotomy search for the isN otOverlapping(x, i, positioned) procedure.

V. Class instances
The original paper (Clausen et al., 2010) considers problem instances used in the literature of the two-dimensional packing, in a total of 190 experiments in five main classes, namely CGCUT (Christofides and Whitlock, 1977), WANG (Wang, 1983), GCUT (Beasley, 1985), OKP (Fekete et al., 2007), GXON and GXOU (Clausen et al., 2010). The instances can be downloaded from the author's repository 1 . Table I shows a comparison between the main features.
For each feature we report the minimum and maximum because the rest of ticket purchases (near 40% for this type of journeys) are peak and off-peak tickets, which also offer optional or default seat reservations. For peak and off-peak tickets, passengers normally choose reservations to make sure that they have a seat.
• The group size is shaped considering the most likely number of people in a group in a train journey. Based on observations, we have limit the typical number of people in a group to 9 or less, since bigger groups may prefer to reserve directly a bus or a private driver especially in long journeys like the case considered here.

VI. Experimental results
The experiments are divided in two main groups, group one considers unitary profits while group two considers random profit. For each group we evaluated all the instances of the classes in Table I: a total of 195 problem instances per group.
In each experiment we reported the gap, defined as the best bound of the continuous relaxation of the model.
The formula is reported in Eq: (20), where bestbound is the best bound of the continuous relaxation of the model, bestinteger is the best solution found so far, and = 1 10 10 is a small numeric constant to avoid a division by zero error.
We applied the same formula to calculate the gap in the heuristic results as well.
The model in Eq: (9) if we consider 1) a booking system that accepts reservation up to one hour before departure and 2) the seats must be comunicated before people arrive at platform, e.g. by email, by printing the seat number at the station gate, or by a smarthphone application. The proposed algorithm has been run three times for each instance to avoid potential bias due to a lucky initialisation. The stopping criteria for  Table II and Table III report the experiments of group one. Table IV and Table V  In all the instances solved in Tables II-III-IV The experiments of group one, apart from G40U20, G50U20 and GCUT13, are relatively easy to solve for CPLEX: 50% of the experiment classes in the first group have an average gap difference lower than 10%.
The second group is more difficult to solve for CPLEX: 57.89% of the classes ran an average of more than 16 minutes, while the objective degradation was averagely less than 10% in 26.31% of the experiment classes.
DEPL experiments with random profit are reported in  However, letting the heuristic run for an extended period will not improve performance significantly.

VII. Conclusions
In this paper we have developed a mixed integer pro-  seats. The proposed extension covers situations where the ideal position of an item is affected by how long the item must be kept in its allocated position.
We have developed a new GRASP based algorithm that solves the original problem version and the newly proposed one.
We have improved the instances considered in the original paper with five new problems that better represent challenging real world scenarios and we have evaluated the limitations of the proposed algorithm.
In the experimental section we have shown that the proposed algorithm can be useful to provide a first lower bound very rapidly, which can be used as a startup for a successive branch and bound procedure. It can also be very useful in the cases where achieving a solution within a short time limit is more important than achieving an absolute optimality.