torch_geometric.datasets.graph_generator.TreeGraph

class TreeGraph(depth: int, branch: int = 2, undirected: bool = False)[source]

Bases: GraphGenerator

Generates tree graphs.

Parameters:
  • depth (int) – The depth of the tree.

  • branch (int, optional) – The branch size of the tree. (default: 2)

  • undirected (bool, optional) – If set to True, the tree graph will be undirected. (default: False)