ķ
 ,ĩ[c           @   sŅ   d  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 j d d	 d
 d g  d e f d     YZ d	 e f d     YZ d
 e f d     YZ d e
 f d     YZ d S(   sÄ  
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:

    # 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)

i˙˙˙˙(   t   OrderedDicti   (   t   Graph(   t
   MultiGraph(   t   DiGraph(   t   MultiDiGrapht   OrderedGrapht   OrderedDiGrapht   OrderedMultiGrapht   OrderedMultiDiGraphc           B   s&   e  Z d  Z e Z e Z e Z e Z RS(   s9   Consistently ordered variant of :class:`~networkx.Graph`.(   t   __name__t
   __module__t   __doc__R    t   node_dict_factoryt   adjlist_outer_dict_factoryt   adjlist_inner_dict_factoryt   edge_attr_dict_factory(    (    (    s7   lib/python2.7/site-packages/networkx/classes/ordered.pyR   -   s
   c           B   s&   e  Z d  Z e Z e Z e Z e Z RS(   s;   Consistently ordered variant of :class:`~networkx.DiGraph`.(   R	   R
   R   R    R   R   R   R   (    (    (    s7   lib/python2.7/site-packages/networkx/classes/ordered.pyR   5   s
   c           B   s,   e  Z d  Z e Z e Z e Z e Z e Z RS(   s>   Consistently ordered variant of :class:`~networkx.MultiGraph`.(	   R	   R
   R   R    R   R   R   t   edge_key_dict_factoryR   (    (    (    s7   lib/python2.7/site-packages/networkx/classes/ordered.pyR   =   s   c           B   s,   e  Z d  Z e Z e Z e Z e Z e Z RS(   s@   Consistently ordered variant of :class:`~networkx.MultiDiGraph`.(	   R	   R
   R   R    R   R   R   R   R   (    (    (    s7   lib/python2.7/site-packages/networkx/classes/ordered.pyR   F   s   N(   R   t   collectionsR    t   graphR   t
   multigraphR   t   digraphR   t   multidigraphR   t   __all__t   extendR   R   R   R   (    (    (    s7   lib/python2.7/site-packages/networkx/classes/ordered.pyt   <module>   s   
	