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 6978921
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:49:11+00:00 2026-05-27T17:49:11+00:00

I have asked this question in cstheory too I have a form distribution problem.

  • 0

I have asked this question in cstheory too

I have a form distribution problem. There is n forms in c categories (each form in 1 category). And there is u users, which each user can receive forms from at least one category (but maybe more than one category).

The goal is to distribute forms between users, so each user receive the same amount of forms. I prefer to equally use categories.

For example:

If categories are:

C1 : 20 forms

C2 : 3 forms

C3 : 8 forms

C4 : 2 forms

And users are:

U1 with access to C1 and C2

U2 with access to C2

U3 with access to C3

U4 with access to C1 and C3

U5 with access to C2 and C4

The answer should be:

U1: 1 x C1 + 1 x C2 | 2 x C1 (preferred)

U2: 2 x C2

U3: 2 x C3

U4: 1 x C1 + 1 x C3 | 2 x C1 (preferred) | 2 x C3

U5: 2 x C4

And 23 forms remains.

Do you have any suggestion on how can I write such algorithm?

There could be a second question, which in that some Categories have a SHOULD CONTRIBUTE option. Which if set, all remaining forms in that category will distribute between users who have access to that. for example if C1 have this option enabled, the answer should be:

U1: 1 x C1 + 1 x C2 + 9 C1

U2: 2 x C2

U3: 2 x C3

U4: 2 x C3 (to minimize remaining forms in C3 category) + 10 C1

U5: 2 x C4

and remaining forms would be 0 in C1, 0 in C2, 4 in C3 and 0 in C4.

I think its kinda Bin Packing algorithm, but I am not sure and I don’t know how to solve it! 🙁

Note: The above answers are not best answers, these are just what I think!

  • 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-27T17:49:12+00:00Added an answer on May 27, 2026 at 5:49 pm

    It seems to me that if you fix a number N of forms per user and ask the question: can we give N forms to each user? then you can turn this into a http://en.wikipedia.org/wiki/Maximum_flow_problem problem, where each user can receive flow/forms from their subset of categories, and there is an outflow of capacity N from each user. Also, if you can solve this problem for N you can solve it for all lesser values of N.

    So you could solve the first problem by running max-flow lg (maximum N) times, using a binary chop to find out what the best possible value of N is. Since you can solve it by max flow, you can also solve it by linear programming. Doing it this way, perhaps just for the critical value of N, might allow you to favour some assignments over others, or perhaps to see where there are neighbouring feasible solutions, and then see if you can mix them to use categories equally.

    Example – Create a source, and link it to each of the categories Ci, with the capacity of the link being the number of forms available in that category, so C1 gets a link from the source of capacity 20. Create links with their source’s capacity between users and categories, where the user has access to the category, so U1 gets links to C1 and C2, but U2 only gets a link to C2. Now create links of capacity N from each user to a single sink. If there is an assignment of forms to users that gives every user N forms, then this will produce a maximum flow that fills every link from user to sink, and you can look at the flows between users and categories to see how to assign forms. You could start off with N = 3, because user 2 only has access to a total of 3 forms, so the answer can’t be greater than that. That won’t work because you have said the right answer has N = 2, so the max flow won’t fill all the N=3 capacity links. So your program tries again at 3/2 = 1, and finds a solution – you have provided a solution for N = 2, so there must be one for N = 1. Now the program knows there is a solution for N = 1 but not one for N = 3 so it tries one halfway between at N = (1 + 3) / 2 = 2, and finds your solution. There is one for N = 2 but not for N = 3 so the N = 2 solution is the best you can do.

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

Sidebar

Related Questions

I have asked this question before and the problem was half solved in the
I have already asked this question on SuperUser but it was suggested there that
Others have asked this question, but there's been no good answers that I can
i have asked this question before but no answer was there. so asking again.
okay... I have asked this question about this but there is a new thing
I have been asked this question today. When debugging, there is an error. But
I have asked this question on Telerik forums with no reply so I'm turing
i asked this question yesterday but it doesnt seem to have asked properly so
I have just asked this question an hour ago but with regards to IE8
I am sorry I have already asked this question on Superuser, but nobody answers

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.