# Towards Robust Representations of Spatial Networks Using Graph Neural Networks
## 4 Methods  
### Constructing Heterogeneous Graph Representations  
The heterogeneous graph representations is a graph representation with more than one node type and/or edge type. Given a set of spatial elements with their spatial coordinates, we define the edge relations between spatial elements using known spatial relations such as _intersects_ and _within_-x distance. In Figure 2, we present an abstraction of the heterogeneity in spatial networks. Note that in this paper, we focus on streets and buildings which is depicted accordingly in Figure 1.  
In this article, we consider a heterogeneous graph representation as a directed graph representation. We follow the traditional definitions of concepts from graph theory. See Table 2 for a definition of graph concepts used in this article. Our focus is on deriving heterogeneous spatial representations for spatial elements. There are two challenges that need to be discussed. The first challenge is the difference between the physical representations of spatial elements and general network representation as defined by graph theory. We define the physical representations of spatial elements as the convention used for storing the elements in ubiquitous systems and geo-spatial data stores such as maps. \begin{table}
\begin{tabular}{c l} \hline \hline
**Notation** & **Definition** \\ \hline \(\mathcal{G}=(\mathcal{V},\mathcal{E})\) & A graph representation \\ \(\mathcal{V}\) & set of nodes in \(\mathcal{G}\) \\ \(\mathcal{E}\) & set of edges in \(\mathcal{G}\) \\ \(\mathcal{P}\) & semantic path \\ \(\mathcal{D}_{\mathcal{G}}\) & the network schema of \(\mathcal{G}\) \\ \(|\mathcal{V}|\) & number of nodes in \(\mathcal{G}\) \\ \(|\mathcal{A}|\) & number of node types in \(\mathcal{G}\) \\ \(|\mathcal{R}|\) & number of relation types in \(\mathcal{G}\) \\ \(\mathbf{h}\) & node representation \\ \(\mathcal{Y}\) & set of class labels for nodes in \(\mathcal{G}\) \\ \(\mathcal{N}(v)\) & Neighbourhood of a node \(v\) \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Notations and definitions. Within the context of spatial elements, while certain types of spatial elements are physically represented as networks, others are not. Street networks are an example of spatial networks that usually are physically represented as networks. Because their physical representation follows the network conventions of graph theory, there is little to no additional overhead required to derive their graph representation. In this case, the graph representation of a street network could be one where the nodes are street segments and the edges indicate adjacency between the street segments. Other elements such as buildings and natural bodies are not necessarily represented physically as networks. Hence, at the very least, deriving their graph representations requires a scoping of the relations to be considered. The second challenge is that there exists an arbitrary number of spatial elements and relations that could be considered. Bear in mind that the spatial elements to be considered while deriving a graphical representation should be beneficial to the task at hand. For example, when trying to build a model that infers the type of a street as residential, encoding the relation between that street and other buildings (where the type of the building could be encoded as a node feature) may be beneficial to the model than say its relation to bus \begin{table}
\begin{tabular}{c p{142.3 pt}} \hline \hline
**Concept** & **Definition** \\ \hline Adjacent nodes & The nodes of a graph representation are adjacent if an edge connects them. \\ \hline Incidence & A node and an edge of a graph are incident if the edge connects the node to another node. \\ \hline Node degree & The number of edges incident to the node. \\ \hline Directed graph & A graph representation is said to be directed if the edges have a direction. \\ \hline Connected graph & A graph representation is said to be connected if all of its nodes can be accessed from any other node. \\ \hline \hline \end{tabular}
\end{table}