How to solve a seating arrangement in Airline–Part 2

Now continue to this project I have created a simple logic which allow to arrange a optimal points without panelising to split any combination or altered a consecutive arrangement as much as possible.

For that I have break down rows in group of 2. Let’s say 2 rows each rows has 6 seats and maximum number of allocation is 12. now we know by given fact that following combinations are possible:

  • 12 bookings which contains 1 ticket per booking.
  • 6 bookings which contains 2 ticket per booking.
  • 4 bookings which contains 3 tickets.
  • 3 bookings which contains 4 tickets.
  • 2 bookings which contains 5 tickets and 1 booking contains 2 tickets.
  • 2 bookings which contains 6 tickets per booking.
  • Now we know by rules if we have 2 booking of 6 tickets each than we have an optimal results which is far away from reality in the bookings. But at least it will give us a clue about the probability  of make a possible pair of tickets or combinations of various positions.
  • Suppose for example we have only 12 seats in other word 2 rows:
  • and we have bookings of 5 tickets, 4 tickets and 3 tickets respectively.

So here are following optimal arrangement

image

Which will generate around  (5 consecutive tickets = +2), for 3 tickets +1 but 4 tickets split therefore its –1 thus +2+1-1 = +2

but if we prioritise group of 4 first then we can have optimal value as given below

image

This will generate (+2 for 4 tickets, +1 for 5 tickets, +1 for 3 tickets), thus it has possibly 4 optimal points to gather.

So here we got a rough idea what are we dealing with. Obviously in logic terms we are still far far away from any coding at all. But that was the first condition for the challenge no need of any computer programming but simple logic of arrangement and make a common sense out of the arrangement.  

Next time I will go through combination of 2s and 3s and possible mix match of each with more and more rows, or may be lets keep it simple to 5 rows to generate an algorithm which give best optimal values from the various combinations.

Leave a Reply

Your email address will not be published. Required fields are marked *