Difference of frontier and block

Hi I’m beginner of DGL.
I’ve studied sample_block function in NeighborSampler of dataloading.
But I can’t understand why they make block by frontier.
In my understanding, block is bipartite graph with src and dst nodes sets.
But also frontier has src and dst list.

Can anybody explain why they adjust to_block function to frontier?

Thanks

Hi @KijinKHU ,

Both of them are DGL graphs used in sampling but the difference is block is relabeled. For example, when using 2 seed nodes [1, 4] to sample 4 edges [(1, 4), (1, 6), (4, 8), (4, 9)], the edges of frontier are the same as the sampled edges. After block = dgl.to_block(frontier), the node IDs are mapped into a contiguous range from 1 to 5 (since there are only 5 unique nodes). And the edges become [(1, 2), (1, 3), (2, 4), (2, 5)].

1 Like

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