You are using a version without Ads of this website. Please, consider donating:

Determine number of combinations given a parameter?

I would like to write a program that determines the combinations of certain furniture my store can hold. I want to maximize my possible revenue but the catch is that I can only hold 250 feet of furniture. For example,

Lamp - \$20 - 5 Feet needed
Chair - \$50 - 10 ft needed
Couch - \$200 - 30 ft needed etc etc

How can I do this?
do {
combination algorithm
}
while (total feet of furniture < 250)
This is known as the "knapsack problem" and is NP complete, so in two words: forget it.

That being said, you can try to "guess" a good solution using a genetic algorithm. This should work pretty well (though I haven't applied GAs to this particular problem). If you don't need to know that the result is "optimal", that is (since NP is equivalent to VP (can be verified in polynomial time), this in itself is next-to-impossible for any n > 10). If you really want to try all combinations (which is what you have to do otherwise), you can use std::next_permutation in combination with std::accumulate (go through all size permutations and count the revenue generated).
NP complete doesn't technically mean 'next to impossible', but it does mean 'not practically computable' --meaning that it is usually fairly difficult to solve (as exception said) for any N > 10 or so.

However, if I may be so bold:

Maximizing space, while important, is not the prime mover in display sales. (Clutter/visual overload actually decreases sales.)

Make sure you have good inventory tracking, accounting for time of year and special events (like holidays that sends people shopping for furnature), and build a few attractive displays of furniture arrayed as it might in a domestic environment. Avoid monochromatic or extremely conservative or extremely bright stuff, but make sure you have some nice, strong colors highlighting the woods and leathers and whatnot. That way, when people walk-in, they can feel comfortable and stimulated in any one of the sections. Either on the coffee table keep a catalogue, or on the side (near, but not part-of, the display) have examples, catalogues, pictures, etc. of variations on the elements within the display.

Make sure they are well-lit with natural lighting (avoid using the overhead flourescent lights as your primary lighting) --either via direct sunlight or some properly arranged lamps.

The point is to direct people's attention to something they like --or similar to what they want, then provide them with easy options to browse for the variation they have in mind or colors they prefer (or price they want to pay, etc).

It might be worth your money to hire someone (like an interior decorator) to spend a few days helping you arrange things.

Tracking what people want throughout the year, highlighting new items within a comfortable environment, and a subliminally directed shopping experience will increase sales more than fitting everything you have on the showroom floor. An 'open stockroom' (either allowing people to browse it directly, or if that is illegal or dangerous, indirectly by having the help pull stuff out for a customer --and liberal use of catalogues/other visuals) is just as effective as having it on the floor if something on the floor directed the customer's attention to it.

BTW, I've done sales and inventory and display, but I am not a professional expert on the subject, so don't take my word for absolute gospel. I didn't make any of this up though.

Good luck!

If you are just starting out, take a day or two just to visit other furnature stores in the area (within 60 miles or so) and take notes on what works and what doesn't (for you, personally!). If you don't have your own inventory data, you can ask your suppliers for information on what is hot, when, trends, etc. Since you are their customer, and they make money through your sales, it is worth their time to help you out.
Last edited on
Sorry I wasn't specific enough. I am coding this into a C program. It is not a real life example.
Topic archived. No new replies allowed.