Graphs

undirected relationship

A relationship with no direction. Neo4j GDS represents them as parallel relationships in opposite directions.

Also written: undirected relationships, undirected

Learn more in Configuring projections for undirected relationships

Example

Each [:KNOWS] relationship is stored one way, from Ava to Ben and from Ben to Cleo. Projecting them undirected represents each as parallel relationships in opposite directions.

cypher
MATCH (source:Person)-[:KNOWS]->(target:Person)
RETURN gds.graph.project(
  'people',
  source,
  target,
  {},
  {undirectedRelationshipTypes: ['*']}
)

Degree centrality run against people scores Ben 2. Each relationship goes out of both of its nodes, so the one from Ava counts for Ben as much as the one to Cleo. Ava and Cleo each score 1.

Lessons that use this term

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

No published lesson uses this term yet.

All glossary terms