Chajmz
Chajmz

Reputation: 749

Resource Allocation Algorithm with Constraints

I know that some algorithms exist for my kind of problem but I'm having problems naming it and the solution associated. Here is my problem :

Goal : Maximize the allocation of my wallet money so I can fund most of my project.

Also I would rather have all my project funded at for instance 95%, than having some project funded at 100% and other at 0%.

So I guess the function to minimize would be the sum of all (d-(all the money allocted to this project))² assuming I have not enough money to fund all my projects

Example :

I have 100€ on my first wallet, and I can spend 70% on project 1, 20% on project 3 and 10% on project 3

And I have 200€ my second wallet where I can spend 30% on project 1, 50% on project 2 and 20% and project 3.

About my projects :

  1. Project 1 needs at least 120€
  2. Project 2 needs at least 100€
  3. Project 3 needs at least 110€

Thank you for help !

Upvotes: 1

Views: 1136

Answers (1)

David Eisenstat
David Eisenstat

Reputation: 65427

You can formulate this as a maximum flow problem. Connect a source vertex to vertices corresponding to the wallets, where the capacity of each arc is the amount of money in the wallet. Connect vertices corresponding to the projects to a sink vertex, where the capacity of each arc is the amount of money needed for that project. Connect wallets to projects with arcs whose capacity reflect the amount of money from that wallet that can be spent on that project.

Handling the piecewise quadratic objective is a bit tricky. Luckily, it's convex, so I bet you could use a quadratic program solver to good effect.

Upvotes: 2

Related Questions