
    hc                     j    S r SSKrSSKJr  S/r\" S5      \R                  " SSS9S	S j5       5       rg)
a  Generators 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_staterandom_cograph   T)graphsreturns_graphc                 6  ^ [         R                  " S5      m[        U 5       Hr  n[         R                  " TR	                  5       U4S j5      nUR                  SS5      S:X  a  [         R                  " TU5      mM[  [         R                  " TU5      mMt     T$ )a  Returns 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<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.
r   c                     > U [        T5      -   $ N)len)xRs    N/var/www/html/env/lib/python3.13/site-packages/networkx/generators/cographs.py<lambda> random_cograph.<locals>.<lambda>=   s    !c!f*    r   )nxempty_graphrangerelabel_nodescopyrandint	full_joindisjoint_union)nseediRRr   s       @r   r   r      sw    J 	qA1Xaffh(<=<<1"Q#A!!!R(A  Hr   r
   )__doc__networkxr   networkx.utilsr   __all___dispatchabler    r   r   <module>r$      sH     *
 T2- 3 -r   