Блог пользователя Clay123

Автор Clay123, история, 2 недели назад, По-английски

Let's say there is a flight and some passengers want to book seats in it. Some passenger have seat preference while some can adjust on any seat. For ex: let's say there can be 4 passengers with seat preferences W(window), M(middle), W(window), and A(Any) respectively.

The structure of the flight is given below:

  • A B C D E F
  • . . . . . .
  • . . . . . .
  • . . . . . .
  • A and F : Window seats

  • B and E : Middle seats
  • C and D: Aisle seats

Every seat has some cost associated with it and some seats are already booked (they cannot be purchased). Now, we need to assign seats to the passengers such that they are as close as possible and total cost is minimized.

Maximum passengers is upto 10 and there can be 30 rows of seats at max.

Please help me with coming up a good approach to solve this problem.

  • Проголосовать: нравится
  • -6
  • Проголосовать: не нравится

»
2 недели назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Auto comment: topic has been updated by Clay123 (previous revision, new revision, compare).