I have hard time understanding how to implement cross linkage keywords in ruby on rails project, so I will try to explain by real example.
We have array of categories. Each category has from 1 to 10-15 (not strict) keywords (e.g. if category is 'iPods', then keywords would be like 'iPods', 'buy iPods free shipping', etc.).
What I need to do is to create an array of random cross-link keywords, so that for each category I had keywords, that are not for that category. So for example if you'r on the same iPods category shop page, those links should be not 'buy iPods', because you are already looking for that, but similar, like 'buy beats headphones', which will lead to 'Beats headphones' category.
Now the problem. How can I generate such random cross-linked list of 'category -> m random keywords except ones for that category', so that:
- each keyword got covered by at least one category
- all keywords have to be from different catogories
- times each keyword (and this keyword's category?) taken is average with others.
I think that is actually is probability/statistics/combinatorics problem but I look for quick solution, can you point me to some algorithms that can solve that - "place n balls k types between k baskets, so that each ball appear in baskets evenly and every type is covered evenly."?
Aucun commentaire:
Enregistrer un commentaire