o
    ˷e                     @   s   d Z ddlZddlmZ ddlmZ ddlmZ ddlm	Z	 ddl
mZ g Zeg d	 G d
d deZG dd deZG dd deZG dd de	ZdS )ac  

.. deprecated:: 2.6

   The ordered variants of graph classes in this module are deprecated and
   will be removed in version 3.0.

Consistently ordered variants of the default base classes.
Note that if you are using Python 3.6+, you shouldn't need these classes
because the dicts in Python 3.6+ are ordered.
Note also that there are many differing expectations for the word "ordered"
and that these classes may not provide the order you expect.
The intent here is to give a consistent order not a particular order.

The Ordered (Di/Multi/MultiDi) Graphs give a consistent order for reporting of
nodes and edges.  The order of node reporting agrees with node adding, but for
edges, the order is not necessarily the order that the edges were added.

In general, you should use the default (i.e., unordered) graph classes.
However, there are times (e.g., when testing) when you may need the
order preserved.

Special care is required when using subgraphs of the Ordered classes.
The order of nodes in the subclass is not necessarily the same order
as the original class.  In general it is probably better to avoid using
subgraphs and replace with code similar to:

.. code-block:: python

    # instead of SG = G.subgraph(ordered_nodes)
    SG = nx.OrderedGraph()
    SG.add_nodes_from(ordered_nodes)
    SG.add_edges_from((u, v) for (u, v) in G.edges() if u in SG if v in SG)

    N)OrderedDict   )DiGraph)Graph)MultiDiGraph)
MultiGraph)OrderedGraphOrderedDiGraphOrderedMultiGraphOrderedMultiDiGraphc                       2   e Zd ZdZeZeZeZeZd fdd	Z	  Z
S )r   zConsistently ordered variant of :class:`~networkx.Graph`.

    .. deprecated:: 2.6

       OrderedGraph is deprecated and will be removed in version 3.0.
       Use `Graph` instead, which guarantees order is preserved for
       Python >= 3.7
    Nc                    (   t jdtdd t j|fi | d S )NzOrderedGraph is deprecated and will be removed in version 3.0.
Use `Graph` instead, which guarantees order is preserved for
Python >= 3.7
   
stacklevelwarningswarnDeprecationWarningsuper__init__selfincoming_graph_dataattr	__class__ O/var/www/ideatree/venv/lib/python3.10/site-packages/networkx/classes/ordered.pyr   B      	zOrderedGraph.__init__N__name__
__module____qualname____doc__r   node_dict_factoryadjlist_outer_dict_factoryadjlist_inner_dict_factoryedge_attr_dict_factoryr   __classcell__r   r   r   r   r   3       	r   c                       r   )r	   zConsistently ordered variant of :class:`~networkx.DiGraph`.

    .. deprecated:: 2.6

       OrderedDiGraph is deprecated and will be removed in version 3.0.
       Use `DiGraph` instead, which guarantees order is preserved for
       Python >= 3.7
    Nc                    r   )NzOrderedDiGraph is deprecated and will be removed in version 3.0.
Use `DiGraph` instead, which guarantees order is preserved for
Python >= 3.7
r   r   r   r   r   r   r   r   ^   r   zOrderedDiGraph.__init__r    r!   r   r   r   r   r	   O   r+   r	   c                       6   e Zd ZdZeZeZeZeZeZ	d fdd	Z
  ZS )r
   a  Consistently ordered variant of :class:`~networkx.MultiGraph`.

    .. deprecated:: 2.6

       OrderedMultiGraph is deprecated and will be removed in version 3.0.
       Use `MultiGraph` instead, which guarantees order is preserved for
       Python >= 3.7
    Nc                    r   )NzOrderedMultiGraph is deprecated and will be removed in version 3.0.
Use `MultiGraph` instead, which guarantees order is preserved for
Python >= 3.7
r   r   r   r   r   r   r   r   {   r   zOrderedMultiGraph.__init__r    r"   r#   r$   r%   r   r&   r'   r(   edge_key_dict_factoryr)   r   r*   r   r   r   r   r
   k       	r
   c                       r,   )r   a  Consistently ordered variant of :class:`~networkx.MultiDiGraph`.

    .. deprecated:: 2.6

       OrderedMultiDiGraph is deprecated and will be removed in version 3.0.
       Use `MultiDiGraph` instead, which guarantees order is preserved for
       Python >= 3.7
    Nc                    r   )NzOrderedMultiDiGraph is deprecated and will be removed in version 3.0.
Use `MultiDiGraph` instead, which guarantees order is preserved for
Python >= 3.7
r   r   r   r   r   r   r   r      r   zOrderedMultiDiGraph.__init__r    r-   r   r   r   r   r      r/   r   )r%   r   collectionsr   digraphr   graphr   multidigraphr   
multigraphr   __all__extendr   r	   r
   r   r   r   r   r   <module>   s    #