A Simple SQL Select Query to Crawl All Connected People in a Social Graph

A simple SQL Select query to crawl all connected people in a social graph?

So you want get all friends of someone, including n-th degree friends? I don't think it is possible without recursion.

How you can do that is explained here:
https://inviqa.com/blog/graphs-database-sql-meets-social-network

How do sites like LinkedIn efficiently display 1st/2nd/3rd-level relationship next to each person's name?

You may be able to leverage axioms about small world networks to optimize this type of traversal.

Small world networks are characterized by "hubs" the represent very dense interconnections of other nodes. Most nodes in the network will generally either connect within a few hops to a topologically nearby node (1-4 hops away) or will route through one or more such hubs. This is one of the main reasons that small world networks behave the way they do.



Related Topics



Leave a reply



Submit