# 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.

• Could you elaborate on the problem you are trying to solve? What does your data represent? – Karan Sep 15 '17 at 9:18
• The input graph represents a circuit - the nodes being components and nets/connections are the edges. I thought providing these details in the question might confuse people. – Suresh Sep 15 '17 at 9:40
• Very interesting problem, so you're trying to verify the circuit and component values or is it like auto routing the circuit copper track? – Karan Sep 15 '17 at 9:50
• Mostly to infer patterns in the input, and to generate the an acceptable output which we think depends on these patterns. – Suresh Sep 15 '17 at 13:30
• Does this answer your question? Are there neural networks that accept graphs or trees as inputs? – brazofuerte Apr 25 '20 at 18:20