Jump to content

Hotel Room Occupancy Optimization Problem


fiveworlds

Recommended Posts

Not sure about "the most optimal", as there is always something that can be fixed.. But I would start from splitting customers by room types, to different lists. Each list sort by date at which customer is checking in to room. Find the earliest date and the farthest date from the all customers in the list. Then there is needed to find eventual conflict between different customers dates. The most optimal is when checking in of one customer is immediately after checking out of previous customer, so there is the smallest possible empty room days. If there is no conflict between various customers, and they follow one by another, you can assign room number to them.

Edited by Sensei
Link to comment
Share on other sites

So this is the database entity relationship diagram that I have at the moment. A user can log into the wordpress site fill in a few details the size of the room etc. and a booking reference is generated for that customer pending approval. Customers that have already been approved a place have to be given a room but I can assign any room to customers that have yet to be approved. It is difficult because while I don't want customers waiting too long for approval I also want to fill as many rooms as possible limiting the amount customers have to change rooms. It is easy to just fill the hotel until all spots are occupied since I know the number of rooms available in total.

sbNoJf0.png

Link to comment
Share on other sites

Is it the real work, or just exercise?

I wouldn't tell customer which room number they are getting, just verify whether any room of type they want is empty at given date range, and give some code instead.. This would allow the most optimal room assignment..

If it's real work - why not show map with the all rooms, with the all dates, and let people pick up on timeline.. ?

We have here cinemas in which you can log in, and reserve seats, and buy tickets on-line. There is showed entire cinema room which is playing movie (each room has different settings of seats, in rows and columns, and stairs between them), with the all seats as buttons. They are green or red, indicating whether seat is already reserved or not. User can click on them to reserve them.

In hotel website you could even show virtual visualization of each room (spherical mapping), scrollable in H and P axes.

 

Edited by Sensei
Link to comment
Share on other sites

Quote

We have here cinemas in which you can log in, and reserve seats, and buy tickets on-line. There is showed entire cinema room which is playing movie (each room has different settings of seats, in rows and columns, and stairs between them), with the all seats as buttons. They are green or red, indicating whether seat is already reserved or not. User can click on them to reserve them.

Yeah we have them here too. It would be cool to get that to work for hotels but it would also be a lot more difficult. Cinemas tend to follow a very tabular seating arrangement therefore you can just use a table to map all the seats. A hotel is different because the general layout is generally not as tabular you would be looking at using image maps which involve actual people working coordinates out for the map so it wouldn't scale as easily. 

 

Link to comment
Share on other sites

To find whether there is conflict between different customers, you could fill unsigned int by bits. Each bit, one day of month. unsigned int has 32 bits, enough for entire month <= 31 days.

mask |= 1<<day_numer;

Then find conflict by doing bit-wise and operation between couple masks. There is no conflict, if returns 0.

if( mask1 & mask2 ) { // conflict }

Each room, 12 unsigned int masks for entire year.

Link to comment
Share on other sites

When I saw the title I thought this was going to be about Hilbert's hotel. This becomes a more interesting problem if you have infinitely many arrivals and you don't want to force guests to move too much as new guests arrive.

Link to comment
Share on other sites

Quote

When I saw the title I thought this was going to be about Hilbert's hotel. This becomes a more interesting problem if you have infinitely many arrivals and you don't want to force guests to move too much as new guests arrive.

It is plenty interesting for me I am making a website for a real travel agency which takes bookings for many hotels and flights. All bookings require approval from the hotel and I don't want to force guests to move too much.

Link to comment
Share on other sites

3 hours ago, fiveworlds said:

It is plenty interesting for me I am making a website for a real travel agency which takes bookings for many hotels and flights. All bookings require approval from the hotel and I don't want to force guests to move too much.

I apologize if my attempt at lighthearted hotel-related mathematical humor struck you as diminishing or denigrating the importance of your project. But if a guy named Cantor shows up, look out.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.