§
    bŠtjœ  ã                   óZ   — d Z ddlmZ ddlZdgZ ej        dd¬¦  «        d„ ¦   «         ZdS )z 
Generators for interval graph.
é    )ÚSequenceNÚinterval_graphT)ÚgraphsÚreturns_graphc                 óÞ  — t          | ¦  «        } | D ]]}t          |t          ¦  «        rt          |¦  «        dk    st	          d¦  «        ‚|d         |d         k    rt          d|› �¦  «        ‚Œ^t          j        ¦   «         }d„ | D ¦   «         }|                     |¦  «         |rG| 	                    ¦   «         x\  }}}|D ])}|\  }}	||k    r|	|k    r| 
                    ||¦  «         Œ*|°G|S )ao  Generates an interval graph for a list of intervals given.

    In graph theory, an interval graph is an undirected graph formed from a set
    of closed intervals on the real line, with a vertex for each interval
    and an edge between vertices whose intervals intersect.
    It is the intersection graph of the intervals.

    More information can be found at:
    https://en.wikipedia.org/wiki/Interval_graph

    Parameters
    ----------
    intervals : a sequence of intervals, say (l, r) where l is the left end,
    and r is the right end of the closed interval.

    Returns
    -------
    G : networkx graph

    Examples
    --------
    >>> intervals = [(-2, 3), [1, 4], (2, 3), (4, 6)]
    >>> G = nx.interval_graph(intervals)
    >>> sorted(G.edges)
    [((-2, 3), (1, 4)), ((-2, 3), (2, 3)), ((1, 4), (2, 3)), ((1, 4), (4, 6))]

    Raises
    ------
    :exc:`TypeError`
        if `intervals` contains None or an element which is not
        collections.abc.Sequence or not a length of 2.
    :exc:`ValueError`
        if `intervals` contains an interval such that min1 > max1
        where min1,max1 = interval
    é   zZEach interval must have length 2, and be a collections.abc.Sequence such as tuple or list.r   é   z*Interval must have lower value first. Got c                 ó,   — g | ]}t          |¦  «        ‘ŒS © )Útuple)Ú.0Úintervals     ú`/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/networkx/generators/interval_graph.pyú
<listcomp>z"interval_graph.<locals>.<listcomp>=   s   € ÐBÐBÐB¨H�˜h™œÐBÐBÐBó    )ÚlistÚ
isinstancer   ÚlenÚ	TypeErrorÚ
ValueErrorÚnxÚGraphÚadd_nodes_fromÚpopÚadd_edge)
Ú	intervalsr   ÚgraphÚtupled_intervalsÚmin1Úmax1Ú	interval1Ú	interval2Úmin2Úmax2s
             r   r   r      s3  € õJ �Y‘”€IØð Vð VˆÝ˜8¥XÑ.Ô.ð 	µ3°x±=´=ÀAÒ3EÐ3EÝðBñô ð ð �AŒ;˜ !œÒ$Ð$ÝÐTÈ(ÐTÐTÑUÔUÐUð %õ ŒH‰JŒJ€EàBÐB¸	ÐBÑBÔBÐØ	×ÒÐ)Ñ*Ô*Ð*à
ð 5Ø!1×!5Ò!5Ñ!7Ô!7Ð7‰
ˆˆd�YØ)ð 	5ð 	5ˆIØ"‰JˆD�$Ø�tŠ|ˆ| ¨¢ Ø—’˜y¨)Ñ4Ô4Ð4øð ð 5ð €Lr   )Ú__doc__Úcollections.abcr   Únetworkxr   Ú__all__Ú_dispatchabler   r   r   r   ú<module>r*      so   ððð ð %Ð $Ð $Ð $Ð $Ð $à Ð Ð Ð àÐ
€ð €Ô˜¨TÐ2Ñ2Ô2ð9ð 9ñ 3Ô2ð9ð 9ð 9r   