Graphormer extends the Transformer architecture to graphs. However, due to the linear sequence limitations of transformers, it is crucial to inject graph structural information into the model operators. To encode structure of the graph, Graphormer proposes two structural embeddings: Edge encodings (𝑐 𝑖𝑗 ) and Spatial encodings (𝑏 𝜙(𝑣 𝑖 ,𝑣 𝑗 ) ). Both encodings are injected during the Graphormer self-attention mechanism, defined as