concepts.benchmark.algorithm_env.graph.random_generate_graph_dnc#
- random_generate_graph_dnc(n, p=None, directed=False, np_random=None)[source]#
Random graph generation method as in DNC, the Differentiable Neural Computer paper. Sample
nodes in a unit square. sample out-degree ( ) of each nodes, connect to nearest neighbors (Euclidean distance) in the unit square.- Parameters:
n (int) – the number of nodes in the graph.
p (float | None) –
control the range of the sample of out-degree. Default:
(float):
(int):
(tuple):
directed (bool) – directed or Undirected graph. Default: False (undirected)
np_random (RandomState | None) – the random state.
- Returns:
A randomly generated graph.
- Return type:
graph