Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 363437
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T13:20:33+00:00 2026-05-12T13:20:33+00:00

stock allocation problem. I have a problem where each of a known set of

  • 0

stock allocation problem.

I have a problem where each of a known set of products with various rates of sale need to be allocated into one of more of a fixed number of buckets.
Each product must be in at least one bucket and buckets cannot share product.
All buckets must be filled, and products will usually be in more than one bucket
My problem is to optimize the allocation of products into all of the buckets such that it maximises the amount of time before any one product sells out.

To complicate matters, each type of bucket may hold differing amounts of each type of product.
This is not necessarily related to the size of the product (which is not known), but may be arbitrary.
Eg,

  • Bucket A holds 10 Product 1, Bucket B holds 20 product 2, however
  • Bucket A holds 5 Product 2, Bucket B holds 8 Product 1.

So, as inputs we have a set of products and their sales velocity eg

  • Product 1 Sells 6 per day
  • Product 2 Sells 5 per day
  • Product 3 Sells 4 per day
  • Product 4 Sells 7 per day

A set of Buckets

  • Bucket A
  • Bucket B
  • Bucket C
  • Bucket D
  • Bucket E
  • Bucket F
  • Bucket G

And a Product-Bucket lookup table to determine each buckets capacity for each product eg

  • Prod 1 Bucket A = 40;
  • Prod 1 Bucket B = 45:
  • Prod 1 Bucket C = 40;
  • …
  • Prod 2 Bucket A = 35;
  • …
  • Prod 2 Bucket E = 20;
  • …
  • etc

Approaches i have tried so far include

  1. reduce the products per bucket to a common factor – until I realised the product-bucket size relationship was arbitrary.

  2. Place products into buckets at random and the iterate through each product swapping for an existing product in a bucket and test whether it improves the time taken till sold out.
    My concerns with this approach are that it may take a path that is optimal at the decision time but obscures a later more optimal choice.
    or perhaps the optimal decision requires multiple product changes that will never occur because the individual choices are not optimal.

  3. An exhaustive search – turns out this produces a very large combination of possibilities for a not so large set of products and buckets.

I initially thought the optimum solution would be allocate products in the same ratio as their sale rates, but discovered this not to be true as a configuration holding a very small number of products matching their sales ratios perfectly would be less desirable than a configuration holding much more stock and thus having a longer sale time before first sell out.

Any c# or pseudo code appreciated

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T13:20:33+00:00Added an answer on May 12, 2026 at 1:20 pm

    I suggest a variant of approach 2 based on simulated annealing — great approach to optimization where your underlying strategy is based on steepest-descent or the like. Wikipedia does a good job explaining the idea; the crucial conceptual part is:

    each step of the SA algorithm replaces
    the current solution by a random
    “nearby” solution, chosen with a
    probability that depends on the
    difference between the corresponding
    function values and on a global
    parameter T (called the temperature),
    that is gradually decreased during the
    process

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Storing objects in heterogeneous vector with stack-allocated objects Hello, Say I have an abstract
sorry for the cryptic question title. I'm having a strange problem and i have
I have a memory leak, and I guess it's caused by a wrong usage
I wrote a C program in which I did some pretty heavy stack allocation,
I have a simple scenario, where two servers are connected through a gigabit link.
I've been constructing my own compiler and one large part of it is obviously
I have always been an embedded software engineer, but usually at Layer 3 or
I have a small single-threaded C++ application, compiled and linked using Visual Studio 2005,
I'm developing a game for a course at my school. One of the assignments
OK, so I have this tiny little corner of my code where I'd like

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.