MLDatasets.jl
MLDatasets.jl copied to clipboard
Determine the node index for undirected HeteroGraphs
Edge indices in undirected HeteroGraph are coded as,
edge_index[triplet] = ([s; t], [t; s])
Here s
and t
are node indices of two different types of nodes, so we need a way to determine which node type a node index belongs to.
Our current implementation allows us to use the first half of the graph to find out which node type an index belongs to. The problem appears when edge_indices are not stored as ([s; t], [t; s])
(in the case of user-defined graph).
Also if an edge (s, r, t)
is un-directed, we should also allow indexing using (t, r, s)
. With edge_data and edge_indices being rolled out accordingly.