Convolution on 'edge' in case of heterogeneous graph

Is it possible to perform ‘convolution’ on ‘edge’, not on ‘node’?

I want to think edges in heterogeneous graph as a new node,
and want to do a message passing between edges.

Is it possible to code in dgl?

It sounds like you would like to perform message passing on the line graph of the heterogeneous graph? DGL does have a line_graph function but it only supports homogeneous graphs. For heterogeneous graphs, I’m also not sure how your message and reduce function will look like, since the edges have different types.

Thank you for your reply.
I searched, and I once found the line_graph, but when I implemented it, it didn’t support heterogeneous graph.

Now I am working on a molecule stuff, and I want to take each edge as a new node,
and want to make the angle between them as a new edge feateure of edges(which is considered to be node again).

I think you can just build the graph yourself using dgl.graph or dgl.heterograph. Then the message passing among edges is just the normal message passing among nodes of the new graph.

1 Like

I usually treat the molecule as a homogeneous graph. In fact, if the molecule is treated as a heterogeneous graph, what would the type of all those new edges of the line graph will be? If the new edges wouldn’t have a difference in types (which I think would not, depending on your description), then I would just make a homogeneous graph with edge types (or bond types) stored on the edges as a categorical feature. DGL’s JTNN example constructs the molecule graphs from SMILES this way, and you are welcome to check it out.

1 Like

Thank you for your reply!
It is a great idea to think the molecule graph as homogeneous graph.

So, if it is possible to use line graph,
is it possible to get the line graph back to the original graph, with the orders of features being unchanged!?

Or, can I use the feature made from line graph, to use those at original homogeneous graph?

The picture that I want is,

  1. Make Homogeneous graph to Line graph
    ex) 40 nodes, 330 edges
  2. Update edges ( which corresponds to nodes in line graph).
    ex) 330 nodes, 3123 edges & Update 3123 edges
  3. Declare updated edges ( which corresponds to nodes in line graph ) to edges of original graph.
    ex) Want to make 40 nodes, 330 edges, and want 3123 to be used at update time.

Thank you, always :slight_smile:

It will be hard because by converting the graph into its line graph, you essentially lose node information. I would recommend you to keep the original graph.

I think this is exactly what JTNN’s message passing encoder does. It puts the edge features onto the line graph, does message passing, then puts the updated edge features back to the original graph.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.