通过算法比较许多客户的多个价格选项

Comparing multiple price options for many customers algorithmically(通过算法比较许多客户的多个价格选项)

本文介绍了通过算法比较许多客户的多个价格选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有 1,000,000 名客户.每种商品的销售成本可以表示为价格 A 或价格 B.

We have 1,000,000 customers. The cost of goods sold for each of them can be expressed as price A or price B.

价格A<<价格 B.

价格 A 和价格 B 不是线性关系.在某些情况下,B 的价格是其 2 倍,在某些情况下是 100 倍.

Price A and Price B are not linear to each other. In some cases B is 2 times as expensive, in some it is 100 times.

A 上所有客户的成本是

cost of all the customers on A is

min( (sum(A)/count(A)) , 100 ) * count(A)实际上,如果 A 上的所有客户的平均成本小于 100,则将向上取整为 100.

min( (sum(A)/count(A)) , 100 ) * count(A) Effectively, the average cost of all the customers on A will be rounded up to 100 if it is less than 100.

B 没有这样的限制.

我想在他们的商品上花最少的钱.

I would like to spend the least amount of money on their goods.

如何最大化

cost=min( (sum(A)/count(A)) , 100 ) * count(A) + sum(B)我一直认为这是双背包问题的一种形式,但我无法解决...

cost=min( (sum(A)/count(A)) , 100 ) * count(A) + sum(B) I keep seeing this as a form of a dual knapsack problem, but I can't get it right ...

我可能会用 Python 解决这个问题,很有可能,尽管我怀疑这很重要.

I'd be probably solving this in Python, most likely, although I doubt that matters much.

我已经通过为 x y z 分配分数并在此基础上进行过滤来进行手动分析,我对更多的计算解决方案感兴趣.

I've done manual analyses by assigning scores to x y z and filtering based upon that, I'm interested in more of a computational solution.

有什么方法可以推荐吗?

Any approaches to recommend?

推荐答案

在别处以更简单的方式重申.

Restated in a much easier way elsewhere.

为多个客户搜索最合适的价格

这篇关于通过算法比较许多客户的多个价格选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:通过算法比较许多客户的多个价格选项

基础教程推荐