简体   繁体   English

有约束的资源分配算法

[英]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 : 这是我的问题:

  • I have a set W of wallet with money 我的钱包里有只钱包W
  • I have a set P of project on which I can spend my money 我有一个项目P,可以在上面花我的钱
  • Each wallet w has an amount of money M, and I can spend this money only on several project and only a specific amount 每个钱包w都有一个金额M,我只能将这笔钱花在多个项目上,并且只能用于特定金额
  • Each project p needs an amount d of money 每个项目p需要一笔资金d

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%. 同样,我宁愿让我的所有项目获得95%的资金,而不是让某些项目获得100%的资金而其他项目获得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 因此,假设我没有足够的资金来资助我所有的项目,那么我想将要最小化的函数就是所有(d-(分配给该项目的所有资金))²的总和。

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 我的第一个钱包有100欧元,我可以在项目1上花费70%,在项目3上花费20%,在项目3上花费10%

And I have 200€ my second wallet where I can spend 30% on project 1, 50% on project 2 and 20% and project 3. 我有第二个钱包200欧元,可以在项目1上花费30%,在项目2上花费50%,在项目2上花费20%。

About my projects : 关于我的项目:

  1. Project 1 needs at least 120€ 项目1至少需要120欧元
  2. Project 2 needs at least 100€ 项目2至少需要100欧元
  3. Project 3 needs at least 110€ 项目3至少需要110欧元

Thank you for help ! 谢谢你的帮助 !

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. 幸运的是,它是凸的,所以我敢打赌,您可以使用二次程序求解器来达到良好的效果。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM