I am preparing a booking system and solving a specific problem. I have the following data structure (room number/occupancy/ price):
$room[222][1] = 80;
$room[223][1] = 100; //Room ID 222, occupancy 1 guest, price €100
$room[223][2] = 200; //Room ID 222, occupancy 2 guest, price €200
$room[223][3] = 300; //...
$room[224][1] = 110;
$room[224][2] = 220;
$room[224][3] = 330;
...
I need to find the best (lowest price) combination of rooms for a specified number of guests.
For example: For the 4 guests is the best combination of room $room[222][1] and room $room[223][3]. The total price of the rooms is €380.
Can you help me?