Hi,

I’d like to do hard negative mining as follows -

Given a positive edge (u, v1), the negative edge will be (u, v2) such that v2 is a 2-hop neighbor of u(but not a direct neighbor of u).

I can generate and save all the 2-hop neighbors of each node offline and just load them in a custom negative sampler. But as my graph is quite large(2M nodes, 80M undirected edges), this generation will take a lot of time(a few weeks) and is unacceptable.

Is there a better/faster option? Is there a way in dgl to get a random 2-hop neighbor of a node?

Thanks.