I have some sources of data, and each one of this sources have a cost per request. I know wich data attributes each one of these sources have, and what are the best sources for each attribute.
Given a list of attributes, I have to decide the best group of datasources to consume, thinking about Quality of the data first, and secondly about costs.
Its common to make requests to multiple datasources, getting just some attributes from each one, but i will give a simple example below:
Say I have something like this:
DATASOURCE A costs $0.50 returns NAME (good), BIRTHDAY (good), ADDRESS (good)
DATASOURCE B costs $1 and returns NAME (good), MONTHLY INCOME (good), ADDRESS (medium)
DATASOURCE C costs $0.70 returns MONTHLY INCOME (good), NAME (medium)
If i want NAME, it would be better to consume DATASOURCE A (quality and cost of NAME).
If i want MONTHLY INCOME, it would be better to consume DATASOURCE C. (quality and cost of MONTHLY INCOME)
If i want NAME and MONTHLY INCOME, now it would be better to consume DATASOURCE B (because NAME and MONTHLY INCOME are GOOD).
But if i want NAME, MONTHLY INCOME and ADDRESS, I need to consume DATASOURCE A (for NAME and ADDRESS) but will consume DATASOURCE B too for MONTHLY INCOME.
Im trying to make some algorithm that makes sense to do it, but its getting very messy hehe. I would love any help with the logic. Maybe in javascript, java, c# or anything else I could read and have good idea about the best way to solve this.
Any help will be apreciated.
edit
some things to note:
I will have only 3 types of Quality here, and always prefer the best quality, so If i know any datasource has quality GOOD for the attribute, i can filter all other datasources with quality lower than Good for this attribute.
I know that in my case, we will have something like 5 or 10 datasources at all, and only 2 or 3 will have the same attribute.