Graph Data Science

relationship aggregation

Collapsing the parallel relationships between two nodes into one during projection, usually carrying their count or sum as its weight.

Example

Ava bought a kettle and a mug. Ben bought six of the same mug.

cypher
MATCH (source:Customer)-[:BOUGHT]->(target:Product)
WITH source, target, count(*) AS purchases
RETURN gds.graph.project('customer-products', source, target, {
  relationshipProperties: { weight: purchases }
})

The projection holds one relationship for each pair of nodes.

Ben's six relationships to the mug become one carrying weight: 6. Ava bought each of two products once, so those come through carrying weight: 1. An algorithm reading weight still counts six purchases for Ben, without following six relationships to do it.

Lessons that use this term

The lesson and course links below open in a new tab.

5 lessons use this term. Results are ordered by term density.

Get started with Graph Data Science10 mentions

  • Understand relationship aggregationEssential projection techniquesthis lesson, you'll learn about relationship aggregation—a technique for collapsing multiple parallel relationships into a single weighted relationship during6 mentions
  • Challenge: Aggregated projection and analysisEssential projection techniquesConnect Director nodes to Actor nodes through shared Movie nodes Use relationship aggregation to create a weight representing the total number of movies each director-actor pair has worked on together -1 mention
  • Practice relationship aggregationEssential projection techniquesthe previous lesson, you learned the theory behind relationship aggregation1 mention
  • Module recap and what's nextWorking with algorithmsto aggregate multiple relationships into weighted connections When to use relationship aggregation for performance and insight How to design projections based on analytical questions How to match projection1 mention
  • Module recapEssential projection techniques1 mention

All glossary terms