简体   繁体   中英

Product portfolio optimization in python

I have a list of 100 products and revenues generated by them. I want to find combination of 10 products that maximizes the sum of revenues. I can achieve this by creating all possible combination of 10 products and select the combination that gives the maximum sum of revenue. But, I think this is not the optimal way to solve this as this is just a small scaled example of the main problem I want to solve and there are many more products. Is there any mathematical model that can be used toacheive this?

NB: This problem is different from asset portfolio optimzation where we look at the efficient frontier and choose the optimal portfolio based on risk and return.

A way to optimize running through all possibilities would be to simply find the products with max revenue and combining them:

import numpy as np

procuct_names = ["a", "b", "c", "d"]
product_revenues = [1, 4, 2, 5]
best = []

for i in range(2):
    top_index = product_revenues.index(np.amax(product_revenues))
    best.append([procuct_names[top_index], product_revenues[top_index]])
    del procuct_names[top_index]
    del product_revenues[top_index]

print(best)
[['d', 5], ['b', 4]]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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