Multigraph depreciation

Hi guys

I’m reading through the codebase to get familiar with your work. I came across this:

            if multigraph is not None:
                dgl_warning("multigraph will be deprecated." \
                            "DGL will treat all graphs as multigraph in the future.")

Could you possibly explain to me why this is going to be set as the default?

This is because most of the current DGL APIs already support multigraph cases and we feel it is not necessary for users to specify that anymore. For example, the g.in_degrees API can correctly count the parallel edges and the g.update_all API will aggregate messages from those edges too.

There are a few exceptions. For example, g.edge_ids(u, v) returns the id for each edge pair. In a multigraph case, there could be multiple edge ids for the same (u, v) pair. Therefore, you can specify g.edge_ids(u, v, return_uv=True) to return (u, v, eid) tuple of tensors to distinguish each (u, v) pair. Since this kinds of APIs are rare, we just add flags for each of them making the multigraph flag essentially redundant.

Hi @minjie - thanks a lot for your response, it got lost in my email and I only just saw it.

What you say makes sense. Just one thing to clarify

For example, the g.in_degrees API can correctly count the parallel edges and the g.update_all API will aggregate messages from those edges too.

I assume here by parallel edges you mean edges in a different graph handled by a parallel operation? Please correct me if I am wrong.

Parallel edges are edges that share the same end nodes.