Game of Thrones, Neo4j, Community Detection, Graph Algorithms, Network Analysis.
MATCH (s:Person) WITH max(s.community_1) as max MATCH (p:Person) // Has been mentioned in book 1 or 2 WHERE (p)-[:INTERACTS_1|:INTERACTS_2]-() AND // Filter our characters who die in the first book NOT coalesce(p.death_book,10) < 2 RETURN id(p) as id,coalesce(p.community_1, max + id(p)) as