User similarities algorithm -


let's have following data users

user1: {location: "topeka, ks", school: "university of texas", interests: ["running"] } user2: {location: "austin, tx", school: "university of texas", interests: ["knitting", "running"] } user3: {location: "topeka, ks", school: "university of kansas" interests: ["kayaking"]} 

given information, i'm writing matching algorithm pairs "best" users. there few criteria -

  1. not properties weighted equally. let's "location" far more heavily weighted other property. in above though users 1 , 2 share 2 properties (school , "running"), best match user 1 still user 3 because of high weight of location

  2. the algorithm, when running @ scale, should performant. means i'd avoid comparing each user individually each other user. n users o(n^2) operation. ideally i'd develop sort of "score" can generate each user in isolation, since involves looping through users once. can find other users similar scores , determine best match based off that.

  3. the list of interests, locations, schools, etc... not known ahead of time. provided external api , literally string.

is there sort of known algorithm optimizes pairing in way?

thanks!


Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -