Subgraph
A subgraph is a graph whose vertices and edges are subsets of those of another graph, with every included edge connecting included vertices.
Graph Neural Networks in Action
A subgraph is a graph formed from a subset of the nodes and edges of another graph.
- How it is used
- Uses selected graph regions to reduce memory demands, isolate meaningful components, and focus graph neural network training or visualization.
- How deep it goes
- Explains selection, edge filtering, relabeling, feature-label alignment, and identifier recovery, but defers broader subgraph strategies to later treatment.
- Examples
- Demonstrates Amazon product reduction and isolation of a social graph's largest connected component for visualization and degree analysis.
- What you can do after
- Build it from scratch with PyTorch Geometric or NetworkX while maintaining valid edges, aligned attributes, and recoverable original indices.
Read how Graph Neural Networks in Action explains subgraph →
Advanced Algorithms and Data Structures
A subgraph is a graph formed from a subset of the vertices and edges of another graph.
- How it is used
- Uses smaller vertex-and-edge selections as recursive states for planarity testing and as witnesses of non-planarity.
- How deep it goes
- Defines induced and spanning subgraphs, counts their search space, and shows recursive removal with memoization, but stops short of implementation details beyond pseudocode.
- Examples
- Uses K5, K3,3, vertex-removal cases, and cached recursive planarity-testing states.
- What you can do after
- Diagnose planarity by generating smaller vertex-and-edge cases and avoiding duplicate subgraph computations through caching.
Read how Advanced Algorithms and Data Structures explains subgraph →
Related concepts
- treeincludes · A tree is a connected, acyclic structure of nodes, commonly organized hierarchically through parent-child relationships and optionally around a designated root.
- traversalproduced by · Traversal is the systematic process of visiting elements or nodes in a data structure according to its links, ordering, or a specified rule.
- NeighborSamplerproduced by · NeighborSampler is a PyTorch Geometric data-loading function or component that samples node neighborhoods and returns subgraph batches.
- strongly connected componentincludes · A strongly connected component is a maximal set of vertices in a directed graph where every vertex is reachable from every other vertex.
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.

