dgl.prop_nodes_bfs

dgl.prop_nodes_bfs(graph, source, message_func, reduce_func, reverse=False, apply_node_func=None)[source]

使用 BFS 生成的节点前沿进行消息传播。

参数:
  • graph (DGLGraph) – 图对象。

  • source (list, tensor of nodes) – 源节点。

  • message_func (callable) – 消息函数。

  • reduce_func (callable) – 聚合函数。

  • reverse (bool, optional) – 如果为 True,则沿入边方向遍历。

  • apply_node_func (callable, optional) – 更新函数。

另见

dgl.traversal.bfs_nodes_generator