Heterograph with weighted edges

Hello,

I am trying to build a heterograph with multiple node types and multiple edge types and with weighted edges.

This answer How to build a weighted graph in dgl? helps me to convert from a networkx weighted graph to a dgl graph for a single edge type, but I don’t know how to then assign it to a heterograph, specifying the node types and edge type.

Any help would be greatly appreciated!

Best regards,
Anna

Is it possible to first create DGLHeteroGraph with single edge types from networkx using dgl.graph and then merge them with dgl.hetero_from_relations?

Hello,

Thank you very much for your help! That is what I was trying to do, but using the “from_networkx” functionality as suggested in the other answer, I wasn’t able to figure out how to set the node types and edge type for each of the individual graphs as required to turn them into a heterograph.

Best regards,
Anna