K icndZddlZddlmZdgZedej ddd dZy) aGenerators for cographs A cograph is a graph containing no path on four vertices. Cographs or $P_4$-free graphs can be obtained from a single vertex by disjoint union and complementation operations. References ---------- .. [0] D.G. Corneil, H. Lerchs, L.Stewart Burlingham, "Complement reducible graphs", Discrete Applied Mathematics, Volume 3, Issue 3, 1981, Pages 163-174, ISSN 0166-218X. N)py_random_staterandom_cographT)graphs returns_graphc$tjdt|D]k}tjj fd}|j dddk(rtj |Vtj|mS)aReturns a random cograph with $2 ^ n$ nodes. A cograph is a graph containing no path on four vertices. Cographs or $P_4$-free graphs can be obtained from a single vertex by disjoint union and complementation operations. This generator starts off from a single vertex and performs disjoint union and full join operations on itself. The decision on which operation will take place is random. Parameters ---------- n : int The order of the cograph. seed : integer, random_state, or None (default) Indicator of random number generation state. See :ref:`Randomness`. Returns ------- G : A random graph containing no path on four vertices. See Also -------- full_join union References ---------- .. [1] D.G. Corneil, H. Lerchs, L.Stewart Burlingham, "Complement reducible graphs", Discrete Applied Mathematics, Volume 3, Issue 3, 1981, Pages 163-174, ISSN 0166-218X. rc |tzSN)len)xRs b/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/networkx/generators/cographs.pyz random_cograph..=s!c!f*r)nx empty_graphrange relabel_nodescopyrandint full_joindisjoint_union)nseediRRr s @rrrs|J qA 1X)   affh(< = <<1  " Q#A!!!R(A ) Hrr )__doc__networkxrnetworkx.utilsr__all__ _dispatchablerrrr#sJ *  T2- 3- r