N
N
nexus02019-02-19 01:05:37
Algorithms
nexus0, 2019-02-19 01:05:37

Algorithm for selecting top 10 photos?

There are n photos, you need to find the top k most "beautiful" of them and make a rating list (a list in which the photos are arranged in descending order by beauty) for these k photos.
Top k beautiful is determined by one user by making selections between two photos.
Example: there are 200 photos of cats, from which you need to determine the 10 cutest and from these 10 make a rating list in descending order of cuteness.
I hope that I have explained it clearly.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Sergey Sokolov, 2019-02-19
@sergiks

See sorting algorithms . For example, the bubble method will have to go through the entire array up to 10 times, for a total of 199+198+197+...+189 = 2123 comparisons.
But since only the tip is of interest, it can be optimized. Divide photos into pairs, compare in pairs, discard the losers. This reduces the number of candidates by half. 200 -> 100 -> 50 -> 25 -> 13 for 100+50+12=162 comparisons. The remaining 13 should be sorted by the bubble method before selecting the top 10: 12+11+10+...+3 = 75
In total, there are only 237 comparisons, if I'm not mistaken.
In the movie The Social Network (2010) there is an episode where the young Zuckerberg allegedly used the ELO chess rating algorithmin his first application, FaseMash, to compare which of the girls is more attractive. There, too, visitors choose one of two photos. Whether this can reduce the number of comparisons needed is an open question.

O
Oleg, 2019-02-19
@402d

As I understand it, this is a laboratory work on the language.
There are grades A Better b.
The top 10 photos with the most tagging are better than the other.
Select idea from tcomare group by idea sort by count(*) desc limit 10
But then the perversions of other photos in the same position are more often rated better than the first one. etc

A
Alexander Skusnov, 2019-02-19
@AlexSku

Random selection of two photos. We add the winning one, minus the losing one.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question