random_generate_special_graph(n, graph_type, directed=False, np_random=None)[source]#

Randomly generate a special type graph.

For list graph, the nodes are randomly permuted and connected in order. If the graph is directed, the edges are directed from the first node to the last node.

  • n (int) – the number of nodes in the graph.

  • graph_type (str) – the type of the graph, e.g. list, tree. Currently only support list.

  • directed (bool) – directed or Undirected graph. Default: False (undirected).

  • np_random (RandomState | None) – the random state.


Generated graph.

Return type: