Machine learning with graph as input and output In my application, I have inputs and outputs that could be represented as graphs. I have a number of acceptable pairs of input and output graphs. I want to use these to train a model.

I am looking for pointers where simple examples of learning methods with graphs as input are discussed. Please note that the graph size is not fixed.

A sample input is

Graph:
  Node A: Component X with parameter size = 12
  Node B: Component Y with parameter size = 30
  Node C: Component Y with parameter size = 30
  A connects to B
  A connects to C


Sample output:

Node A: x=0, y=0
Node B: x=-21, y=0
Node C: x=21, y=0


In this case, we expect the model to understand that input graph is symmetric and a particular way of arranging them is preferred. We want to train the model over a large set of such input-output pairs and then use it to generate output on new inputs.
You can flatten the graph into a matrix and then train it like a normal neural network input. Perhaps an adjacency graph or maybe simply a series of linear equations representing the nodes and convert it into matrix form.