liveBook · Manning

Retweet network

As explained in Graph Algorithms for Data Science

A retweet network is a graph model representing users retweeting posts from other users.

A retweet network models users retweeting posts from other users as a graph. In a labeled-property graph, users publish tweets, and retweets connect users with the tweets they amplify. section 2.3 section 2.3.3

Choose the representation according to the questions the analysis must answer:

  • Represent a retweet directly as a RETWEETS relationship between the original tweet and the user who retweeted it. section 2.3.3
  • Represent the retweet as a separate tweet node when later analysis may need to attach additional relationships to that retweet. section 2.3.3
  • Count retweets to identify popular topics or authors, or infer relationships between users from repeated retweeting. section 2.3.3
  • Translate the indirect pattern into a directed, weighted AMPLIFY relationship; its weight equals the number of retweets between users. section 2.3.3

From retweet to amplification

If Vanessa retweets Kim's tweet, the graph can represent that indirect interaction as a direct AMPLIFY relationship from Kim to Vanessa. One retweet gives the relationship weight 1; repeated retweets increase the weight. section 2.3.3

(:User)-[:PUBLISH]->(:Tweet)<-[:RETWEETS]-(:User)

Use this compact pattern to inspect the users, published tweets, and users who retweeted them. section 2.3.3

In Neo4j Browser, sample RETWEETS relationships can be visualized by adapting a generated Cypher query for another relationship type. section 4.1

How Graph Algorithms for Data Science covers it

How deep it goes
Compares direct and retweet-node representations, then derives weighted directed relationships from repeated interactions.
Examples
Uses Twitter users, tweets, Vanessa retweeting Kim, and Neo4j Browser visualization of RETWEETS relationships.
What you can do after
Build the graph model, infer weighted AMPLIFY relationships, and visualize sample RETWEETS relationships with Cypher.
How it connects
Connects labeled-property graphs, network analysis, directed relationships, weighted relationships, and inferred networks.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Graph Algorithms for Data Science. The section links point to the parts of the book it draws on.