Seating Confusion

dD3

Well-Known Member
Joined
Jun 24, 2008
Messages
139
Reaction score
0
I need some inspiration for a project i'm working on.
Would be great if you could express your thoughts on how to do this.

The program is a ticket system where clients can book seats for an event
by selecting the block of seats they prefer.
Lets say you have two blocks of seats, Block A and Block B
Both blocks has uneven amount of chairs in each row.
Some rows has obsticles inbetween them.

Example:

Block A

[][][][][][][][] Row A (Seats 1 - 8)
[][][][] [][][] Row B (Seats 1 - 7)
[][][][][][][][] Row C (Seats 1 - 8)
[] [][][] [][] Row D (Seats 1 - 6)

Block B

[][][][] [][][] Row A (Seats 9 - 15)
[][][][][][][][] Row B (Seats 8 - 15)
[][][][][][][][] Row C (Seats 9 - 16)
[][][][] [][][] Row D (Seats 7 - 13)

By automation, the seats fill from row A and leave no seats open between ticket buyers.
The ticket buyer and his/her party shouldnt be split up in anyway. If the available seats in the row
is less than the party members, then the whole party should be move up to the next row..
Members of the party may not be placed accross the gaps.

How would you solve this?

Thanks in advance
 
Thanks for your reply.
Both of those websites you mentioned, uses a method where the client select their seats manually.
Thus resulting in many 1 seat gaps. (Who wants to sit next to strangers anyway ;) )
I think it will be better for the user to select the "block" they would like to be in, and let the program automatically
select the seats for you.
 
Thanks for your reply.
Both of those websites you mentioned, uses a method where the client select their seats manually.
Thus resulting in many 1 seat gaps. (Who wants to sit next to strangers anyway ;) )
I think it will be better for the user to select the "block" they would like to be in, and let the program automatically
select the seats for you.

As a user I would hate that. You're trying to optimize for the venue which isn't a bad thing from a business perspective. But if I was forced to take what I considered a worse seat (e.g. on an aisle) only because seats had to be allocated contiguously, would be seriously annoyed. If seats were available further back, surrounded by space but with a better view, I would want those seats. Just a user's opinion.
 
its a pretty simple algorithm, this for a class project or are you looking to sell a solution? I am guessing high school/first year test or project?

All you need to do is keep track of all the empty seats, and then find the smallest continuous space in that your next set of buyers can fit into. Must look for smallest as you then maximize the amount of continuous spaces and therefore max the amount of tickets sold.

If you get all the combinations upfront along with the layout then its a packing problem that there are heuristics for.

This is obviously assuming you can exclude this rule:

By automation, the seats fill from row A and leave no seats open between ticket buyers.

If you can't then you have to just scan for this first gap that your buyers can fit into and place them, as the "Fill from row A" removes flexibility.
 
Last edited:
Thanks for your input.

@stevenv : I get what you are saying. Lets say you do implement the manual selecting of seats, would you stand in a que for 5min longer as you need to wait for the people in front of you to make up their mind on where they would like to sit ?

@phiber : No, this is for an actual event where i need to help with ticket sales.
I already have the algorithm to fill seats from front, in the way its suppose to be, but I can not think of a way on how to indicate where the gaps are within my arrays.

Just thoughts..
 
Rather than using a singular array for a block have you considered using a fixed Matrix? You could have a "noseat" flag to take away any extraneous seats per block ( assuming a fixed column x height matrix )

Example pseudocode:
matrix ( 5,4 )

1 2 3 4 5
1 2 3 4 5
1 2 3 4 5
1 2 3 4 5

case block a:
flag (1,1),(5,1),(1,2),(5,2) would then flag the first and last seat in the first two rows as nonexistant,your search could then just look for blank seats beginning with row1 and moving on from there
 
Last edited:
@stevenv : I get what you are saying. Lets say you do implement the manual selecting of seats, would you stand in a que for 5min longer as you need to wait for the people in front of you to make up their mind on where they would like to sit ?

Fair enough, that is pretty annoying :) is this for an online booking system or store-based? If the latter I understand the reasoning.
 
Thanks PsyWulf, interesting idea, but it wont work.
As in the example, seat numbers don't get removed where the obstructions are. They keep on counting.
How would one implement that if it looks like this:

1 2 3 4 5
1 2 3 4
1 2 3 4 5
etc.
 
@stevenv : Lets say this will be used in a ticket booth.
 
So your seating numbering scheme would look similar to this?

Seating
Block/Row/Seat number

[A/1/1] [A/1/2] [A/1/3] [-GAP-] [A/1/4]
[A/2/1] [A/2/2] [-GAP-] [-GAP-] [A/2/3]
[A/3/1] [A/3/2] [-GAP-] [-GAP-] [A/3/3]

Still a valid matrix to do,could either use array of array of strings
first 2 chars,Block,
next 2,row,
next 2,status,
next 2,seat number ie.

[0A][01][SO][01], seat1 sold
[0A][01][OP][02], seat2 open
[0A][01][OP][03], seat3 open
[0A][01][NN][00], gap
[0A][01][OP][04], seat4 open

or an array of array size 8

Reason I used strings in option 1 is it's actually an array-type already,an array of characters :)

I'll think a bit during lunch if I can think of an easier method,i'm not a morning person
 
Yep makes sense to flag all the gap seats first. That way when the algorithms run it already knows about the gap seats and can fill the next ones. I do however think that there might be some big open seat groups if you use the logic of filling in sequence. What I mean by that is potential 1 or 2 empty seats at the end of rows.
 
Tends to happen with uneven group sizes selecting rows too. It's a bit of a challenge maximizing seating AND accomodating people wanting to sit together
 
Yes I agree, and maybe that should be built in as a "secondary" option. Some people don't mind not sitting together and some prefer to grab that open seat in the front or want to sit at the back, or have the last seat in the row. The default should be autofill but selection should also be available.
 
hmm.. thanks PsyWulf..
I haven't thought about it like that.
Let me try and implement it.

@acidman1: I agree with you. Maybe I should implement web based (for manual seat selection prior to the event) and this automated seat selection (for tickets at the gate).
I think that might keep everyone happy. :)

Thanks for the inputs :)
 
Top
Sign up to the MyBroadband newsletter
X