An orientation parameter controls which relationship directions a directed graph algorithm evaluates: outgoing, incoming, or both. It changes how node connectivity is counted without changing the graph itself. section 6.2.1
Choose one of three orientation values:
- NATURAL evaluates out-degree, counting outgoing relationships. section 6.2.1
- REVERSE evaluates in-degree, counting incoming relationships. section 6.2.1
- UNDIRECTED evaluates the sum of in-degree and out-degree, treating both directions together. section 6.2.1
Retweet and shared-audience networks
In a retweet amplification network, NATURAL identifies users spreading content and REVERSE identifies users whose content is retweeted. In a shared-audience network, UNDIRECTED makes sense because shared audiences imply a mutual relationship between streams. section 6.2.1 section 9.3.3
Listing 6.6 Returns the top five users with the highest in-degree
CALL gds.degree.stats('amplify', {orientation:'REVERSE'})
YIELD centralityDistribution
Inspect the reverse orientation in a degree-statistics call using orientation:'REVERSE'. section 6.2.1
Listing 9.6 Projecting the in-memory graph of streams and their shared audience in-memory
run_query("""
CALL gds.graph.project("twitch", "Stream",
{SHARED_AUDIENCE: {orientation: "UNDIRECTED", properties:["weight"]}})
""")
See UNDIRECTED applied during an in-memory graph projection with a relationship weight property. section 9.3.3
