I'm facing tho following problem:
let's say is a social network user and as such has a list of friends, . 是一个社交网络用户,因此有一个朋友列表 。 a partition is a function , where is a set of groups such as High-school, university, work, etc'. ,其中是一组诸如高中,大学,工作等的组。
I need to come up with algorithm to partite : :
obviously the resulting partition would not be optimal, but it should be acceptable as a starting point for later refinements.
any thoughts would be greatly appreciated
edit : no it's not homework. i believe homework would have clearer defined requirements and target function. anyway no, this is actually real world problem i'm facing.
also i may have simplified it a bit, but in reality a user could be part of many groups (so it's more like F->P(G) , where P(G) is the power group if G ), so a better algorithm would be able to do that.
The basic idea would be to try to partition them into groups based on which of your friends are friends with each other.
For example, if you are Bob and you know Sally and Larry and Sally and Larry both know each other, they are probably in the same "group". You don't know what that group is yet, but since you all know each other, you probably met at the same place - whether that be work, university, etc.
You could implement this as a directed graph where the nodes are people and the edges are connections. You would then need to group those nodes together based on how well connected they are.
Once you've established the groups, then it's just a matter of querying for a sample from the groups and potentially ambiguous nodes to figure out what the groups actually are.
Sounds like homework, so I won't give away anything else, but that should get you started.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.