Heterogeneous graph
A heterogeneous graph is a graph containing multiple types of nodes, relationships, or both.
Knowledge Graphs and LLMs in Action
A heterogeneous graph is a graph containing multiple types of nodes, relationships, or both.
- How it is used
- Supports link prediction and recommendation by representing different entity and relationship types in one message-passing graph.
- How deep it goes
- Implements construction, disjoint edge splitting, neighbor sampling, embeddings, heterogeneous message passing, and dot-product decoding.
- Examples
- Uses MovieLens users, movies, genres, ratings, reverse edges, sampled neighborhoods, and train–validation–test edge splits.
- What you can do after
- Builds a PyTorch Geometric link-prediction pipeline for heterogeneous recommendation graphs.
Read how Knowledge Graphs and LLMs in Action explains heterogeneous graph →
Graph Algorithms for Data Science
A heterogeneous graph contains multiple node types or multiple relationship types.
- How it is used
- Frames typed graph data for knowledge graph completion and drug-repurposing link prediction.
- How deep it goes
- Defines node, relationship, and triple types, then connects them to embedding models and multiclass link prediction.
- Examples
- Uses stream-sharing graphs, drug-treatment networks, and a complex biomedical graph schema as contrasting examples.
- What you can do after
- Evaluate typed-link predictions as candidates for expert review and subsequent clinical trials.
Read how Graph Algorithms for Data Science explains heterogeneous graph →
Graph Neural Networks in Action
A heterogeneous graph is a graph containing multiple types of nodes or edges.
- How it is used
- Guides graph analysis, transformation, and machine-learning method selection for networks with varied entities or relationships.
- How deep it goes
- Defines heterogeneous structure through contrasts and a recruitment example, but stops short of algorithmic implementation.
- Examples
- Uses recruitment networks with candidates, companies, relationships, and employment edges.
- What you can do after
- Evaluate graph structure and choose suitable analysis, transformation, or machine-learning methods.
Read how Graph Neural Networks in Action explains heterogeneous graph →
Related concepts
- homogeneous graphcontrasts with · A homogeneous graph is a graph whose nodes share one type and whose edges or relationships share one type.
- knowledge graphincludes · A knowledge graph is a graph-structured representation of entities and their semantically meaningful relationships, often including associated attributes or facts.
- graphkind of · A graph is a mathematical structure consisting of vertices connected by edges that represent relationships or connections.
- knowledge graph embeddingaddressed by · Knowledge graph embedding is a technique that represents entities and relationships as low-dimensional vectors while preserving patterns expressed by valid triples.
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.


