I like the last one. He is very right in the simplest sense. For speed, a probability map test is a great way to fill in lines. But he lacks a few elements. Are you worried if the parties are divided into several places? How about cancellation and refund? Look at the problem a little differently. There are 3 possible states, not 2. M empty spaces, in R Rows, each with three possible states: vacant, filled, canceled, where Canceled has an adjusted probability. How do you deal with this? You can increase the probability of filling out cancellations or refunds by setting them as a new row, all with N places, with a probability of 1 to fill sets from 1 to N places, and you can further increase the probability of filling all places by limiting the probable lot size for N> 2 to batch size> 2, but less than N.
Another way is to use a card. To illustrate this, create a table of small squares relative to the place. now isolate areas and connect them with external lines. These are your rows and columns. put a letter in each local place to indicate availability. Now create a database that references this file. You can add a section in which you determine the number of seats in the row, and then identify the ticket number for the venue based on this, and you can run simple tests to fill the seats. This will โMinimizeโ the gaps, but probably will not completely eliminate them. If, like me, you work with showpeople \ entertainers \ musicians and venues, mapping is key. The main group I work with is small and has a loyal, but constantly changing following. This is a program for children, community communication and a performance group in one. The problem I had was that many people wanted to sit with friends, etc. So I came up with a plan with several tickets \ ROW \ TABLE. How do you deal with this? For each unit that you do, you must make a position in your programming. Rows and columns are good for work. We will start there. With tables, put them in rows and columns, and you can beautifully cut them. It may not be perfect, but it works, with a little tweaking for each shared unit.
Consider this ... just enter your places from left to right. Follow this pattern when actually assigning seats to a ticket: For a column, row a go left-> right (which fills the seats in a straight line) row b goes right-> left (now follow the math below) do the same for each column ( think of it as a place in the Carnegie Hall, where each column has passages on each side and goes in several rows). The math for each row in the column is pretty simple. Take full places in even lines for group orders: If partysize> elseSeatsInRow mult seat # _in_row is -1, then add # _Normal = S to place (where S is place # _within_row), if S * -1> 0, S * - 1 = S endif, so the venue is filled with a group and one, holding the parties together. Now, to throw you through a few more cycles ...... Say that you adjust prices every 15 rows or so, then higher price areas can fill up more slowly, so you can add incentives, but only for these areas or adjust incentives for each area and the number of tickets available in that area, and so on. Now add the ability to check other pricing areas for the remaining places to place the group (remember that they just have to be in the same area, and they will still be sitting next to each other, I would focus on the columns to save time, but for each of them), and now you can even send a request to fill in the empty seats in more expensive areas at a lower price, just to fill the meeting place in the immediate vicinity of the show and keep people happy with their priya firs. Now for the choice ...... you may have people who choose their place, if there is a place to sit. In the situation I'm going to, the venues change like a date, so I have to bend this algorithm for all this. Mostly, speaking is charity work, and people are parents, friends, community members, etc., who know the groups that perform and know each other. If they know where someone is sitting, they will want to be around. Get the number of tickets they want, and show off areas with lots of seats available at will; you can even go either row-wise or column-wise (to use your seat-filling example, carnegie has several sets of aisles that separate the column between the rows, so you can either change the column or just continue working with the truck as young Mr. Simpson will say: โAye Karumba!โ, each of which has different design layouts, if you change, you need to make a plan for your databases and work with it, this model is flexible, since it can be configured for several diagrams) in anyway to be right Use it in an original way: use the original test to go in a straight line (here you can select the column and row of your buddies, then check the column and then adjacent columns for the same rows where seat number is checked for proximity, use the math from the original proximity keeper above, if friends are on the left, check the left column on the right seat #, if friends are on the right, check the right column on the left seat # and even compare the cancellations discussed later, the operands of the original test can simply be swapped, or you can flip b, etc.) if you select the areas in which places are open, then enter the number of them, and then select only the remaining areas in which there are many suitable places (run the test on 2 or more lines if necessary, again the same tests as above are implemented in the rows of the column), they will most likely sit together if you performed the above test correctly, but in the worst case they will be located as close as possible (and how often this test passes, a? You can offer it as an option with a special price as long as you have a place to fill, but logically, you should put the cap on partysize, which will be placed in this secondary location, and this will most likely fail more often, so how do you get closer to your show. Now comes the fun part, clearing the spaces. Some people walk the deer or are probably late because they are at work or in traffic and want to catch a show or see how their child put on a ridiculous performance of peter pan. If your free space in any particular row or column is 1, and there are no more places around it (what should happen if people cancel), or you have canceled the whole group, you need to return them to the sorting hat. There are several ways. You can create a large number of seats for each section and work with it, but it may be better to simply open a new list to keep small arrays of neighboring seats that can fill the seats in your main; alternatively, you can create a seating text file for the card, marking each seat as free, full, canceled and save the canceled group pointers, then check the cancellation mapping after each cancellation and create separate mappings for different group sizes that contain lists of seats for each size. You can name the cards using the VenueTitle_Cancel_GroupSize object, and then encode the test to check all the cards where GroupSize> = for your new group. This makes it difficult to find your buddies because you have a new test, but you can use the same preliminary tests to align them to scan available seats and draw: check if there are any cancellations, check the number of adjacent seats for each cancellation (how many in the new group? will they be placed in the cancellation slot? Offer them a discount on the remaining places in the cancellation slot and then process all this data) ...... This is not quite an algorithm, not even close, just a mental design for a problem with ton base arithmetic the IF test, which should work like lightning, but you can divide these tests, separating machines that run them, and wait for the return of all the processes, and then add the results together, etc. (old multi-processor polling of a remote file, database query software located on remote computers, with newer servers, you can run the test faster by linking them together in XSERVE and setting up multi-network farms that process data with less u nits that process your web interface).
Planning: Find out how to divide places (places), then find out how to calculate the number of sections \ places and how to evaluate tickets, and then find out if you want people to choose their price using an interactive or simplified view. With a lot of interaction, you may encounter several spaces. If there are several of them, you can have price reductions or special invitations to interested parties, etc. With listings on places. This allows you to maximize your venue and offer options that maximize your satisfaction. I'm not sure what caused this algorithm, but using bubble sorting, a database or something like that, you can set your own values โโfor ticket sales and all the information you need when booking. This allows the cancellation to be treated as a separate element, but LINKED, set flags and re-add data for operations that prevent excessive or unproven. The main way to do this: if you book, you will get time stamps for each of the last transactions, N + 1 (where N is the number of transactions with overexposure), and each after the last reservation (which filled the place or just under) will be installed in a new table with the same transaction information, after which they will be checked to see if they still fit, and if not, they will be returned, sent via email and / or using phonecalled. This way you can check the number of seats available and see if anyone wants to cut back on their batch. You can also offer them new offers by exporting your information to a new spreadsheet for the CMS and keeping them happy. This is a lot of work, but this method can run several parallel tests if configured and processed correctly. This is probably a long and boring answer, but the credit belongs to Lior, who usually used the test. This is just my long program to maximize if you have the processing power and time to create the code.