liveBook · Manning

Undirected graph

As explained in Graph Algorithms for Data Science

An undirected network is a network whose relationships have no traversal direction and therefore connect node pairs symmetrically.

An undirected graph connects node pairs symmetrically: the relationship has no meaningful direction, so traversal works from either endpoint. Friendship is a typical example because mutual connection is implied. In a labeled-property graph, the relationship can still have a type and properties such as a friendship date. section 2.1.1 section 2.2.1

Represent and query an undirected relationship in practical graph workflows:

  • Write a Cypher relationship without a direction marker, such as (:Person)-[:FRIEND {since: 2016}]-(:Person). section 2.2
  • When the database stores only directed links, represent one undirected connection with two opposite directed relationships. section 2.1.1 section 7.2
  • Ignore relationship direction during Cypher traversal when direction adds no semantic value, avoiding unnecessary duplicate storage where appropriate. section 2.5 section 2.2.1
  • Account for undirected semantics in algorithm calculations; for example, potential neighbor connections are halved when computing a clustering coefficient. section 10.3.5

Friendship and hashtag co-occurrence

A friendship between Thomas and Elaine can be modeled as a single FRIEND connection whose direction is ignored during traversal. Likewise, if #NLP co-occurs with #AI, the co-occurrence is mutual; a weighted undirected network can record the count of shared appearances. In GDS, that connection is represented as two opposite directed relationships. section 2.2 section 7.2

Figure 2.2 (A) represents a directed graph; (B) represents an undirected graph.
02-02

Compare the visual difference between directed relationships and an undirected connection. section 2.1.1

How Graph Algorithms for Data Science covers it

How deep it goes
Explains bidirectional traversal, Cypher notation, directed encodings, storage choices, and an algorithmic denominator adjustment.
Examples
Uses mutual friendship, weighted hashtag co-occurrence, and common-neighbor clustering coefficients as concrete examples.
What it assumes
Assumes basic nodes and relationships, while introducing traversal direction and its representation from first principles.
What you can do after
Apply via Cypher by modeling, traversing, projecting, and analyzing relationships with undirected semantics.
How it connects
Connects undirected graphs with directed graphs, Cypher, labeled-property graphs, graph algorithms, graph databases, and link prediction.

Also explained in

Compare how 5 books explain undirected graph →

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.