Encoding of graphs as an input to neural nets 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!
So I ask myself this question:


  Suppose 2 encoding contains the same amount of information, that is,
  all the information about the graph. What factor would make one
  encoding better than the other in terms of performance of neural nets
  (trained with the same number of iterations, etc)


The my personal answer to that is:

Trained neural net (in its simplest version) is just a linear function of its input. So, do you suspect that the function you want to learn can be expressed as a linear function of the input? And this is where the choice of encoding makes a difference.

My stance on these kind of algorithm is that. Ultimately, if you want it to perform well, you need to have a good hypothesis on what kind of function your answer should actually be.