Compute social distance between two users

前端 未结 3 513
逝去的感伤
逝去的感伤 2020-11-27 17:24

How you would code an efficient algorithm which can return a social \'distance\' between two users.

For example, when you visit a profile on LinkedIn you can see wha

3条回答
  •  忘掉有多难
    2020-11-27 17:44

    I would have assumed that this would be done by applying a shortest path algorithm, such as breadth first search to a graph database. But they appear to store their entire graph in memory, at least according to this.

    I'm sure that the algorithm ultimately boils down to some form of shortest path one over a graph structure (nodes and edges).

    Edit: Changed the algorithm as per comments.

提交回复
热议问题