Given a directed graph $G=(V,E)$ with a node labelling function $l:V\rightarrow L$, how would you encode this best for a neural network?If it simplifies the problem, we can add the following assumptions about $G$:$|V|$ is of fixed size $n$.Every node $v$ in $V$ has exactly two successors.$l:V\rightarrow L$ is injective; in particular, instead of using node labels, a total ordering of the nodes would be good enough to infer the original graph labels.What I'm trying to learn is a successor selection for every node $v$ in $V$; in other words, a map $m:V \rightarrow V$ with $m$ subset $E$.Taking all assumptions into consideration, we more or less only have to encode $E$. Obviously, we could use a two hot encoding for every node $v$, resulting in a quadratic number of inputs, but is this the preferred way of going about it?Thanks!
Encoding of graphs as an input to neural nets
graph theory;machine learning