S
S
Sergey2012-06-19 07:46:30
Algorithms
Sergey, 2012-06-19 07:46:30

Can you help with sales forecasting?

We have the planned revenue we need, say, 1,000,000 rubles. We have a list of goods, for example, from 1000 items, each of which has a price and “ease of sale” (i.e. this product is easier to sell, but this one is more difficult), we have a commodity balance (this product has 100 pieces, and this 30 ). What algorithm should be used to calculate the number of different products required for sales to achieve the planned revenue?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
vanxant, 2012-06-19
@TsarS

You have a classic task on optimization methods (man optimization methods).
First, enter the designations:
Goal - planned revenue
for the i-th product
price[i] - price
qty[i] - balance in stock
w[i] - marketability difficulty
plan[i] - desired plan
Next, I advise you to start with the case of two products, so it's all very clear. As you deal with two, you will deal with any number.
Take a pen and draw a graph.
On the x-axis you have plan[1], on the y-axis you have plan[2].
Draw two lines and mark the areas below them:
plan[1]<=qty[1]
plan[2]<=qty[2]
Draw another line and shade the area ABOVE it
plan[1]*price[1] + plan[ 2]*price[2] >= Goal
The shaded triangle you get is your potential solution space. If the triangle did not work out, then with your initial data it is impossible to solve the problem at all (you need to either reduce the Wishlist or increase stocks in warehouses).
Some of the corners may have fractional coordinates - we round them up to integers so that the new coordinates lie inside the solution space.
For the case of three products, you will get not a triangle, but a pyramid of 4 points, for 1000 products - a 1001-dimensional "pyramid" of triangles.
Then write out your objective function:
Ф(plan[]) = plan[1]*w[1] + plan[2]*w[2] (… + plan[i]*w[i] + ....)
You need to find the point in the solution space where your function will have a minimum. This way you will find a minimum sales plan that fulfills all your restrictions.
You are a freeloader because your objective function Ф is linear. It can be proved that its minimum will lie in one (or several) corners of the triangle/pyramid. Therefore, you just need to count the values ​​of Ф in all corners and choose among them those where the value of Ф () will be minimal.
Why are several minimal solutions possible - well, if for example you have two products with the same price and the same complexity, then it makes no difference to you whether to sell one or the other.
Actually everything, the task is solved.

J
Juggler, 2012-06-19
@Juggler

I wrote an article on Habré on inventory management. There is an algorithm, but its goal is slightly different - to make purchases to provide a certain guaranteed level of service - the probability that a person will find the product they are looking for in stock.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question