Self-loop
A self-loop is a graph edge whose source and destination are the same vertex.
Graph Algorithms for Data Science
A self-loop is a graph relationship whose start node and end node are the same node.
- How it is used
- Uses self-loops to represent same-label relationships and to identify or remove self-interactions during network analysis.
- How deep it goes
- Defines the relationship, illustrates it in a Twitter network, and applies a Cypher filtering procedure before PageRank.
- Examples
- Demonstrates self-loops through Twitter follows, retweets, self-retweets, component visualizations, and a no-self-loops projected graph.
- What you can do after
- Diagnose self-interactions and exclude them from a Cypher-projected graph before calculating weighted PageRank.
Read how Graph Algorithms for Data Science explains self-loop →
Graph Neural Networks in Action
A graph edge that connects a node to itself and, in this recurrent-model diagram, represents a temporal state update.
- How it is used
- Uses self-loops in GCN message passing to retain each node’s information during neighborhood aggregation.
- How deep it goes
- Defines self-loops through adjacency-matrix diagonals and places them in a short GCN preprocessing and aggregation sequence.
- Examples
- Shows self-loops as nonzero adjacency-matrix diagonal entries and as part of the GCN embedding computation.
- What you can do after
- Operate/configure GCN preprocessing by adding self-loops before weight multiplication and normalized message aggregation.
Read how Graph Neural Networks in Action explains self-loop →
Related concepts
- edgekind of · An edge is a graph connection between two vertices that represents a relationship and may be directed, labeled, or weighted.
- message passingalternative to · A communication or computation technique in which entities exchange messages to transmit or propagate information, coordinate work, or update state.
- graph convolutional networkused by · A graph convolutional network is a graph neural network that computes representations by transforming and aggregating information from graph neighborhoods.
- graph neural networkused by · A graph neural network is a neural-network model that learns representations or predictions from graph-structured data by combining information from connected entities.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

