
    h                         S r SSKrSSKrSSKrSSKrSSKJr  SSKr	SS/r
Sr\R                  R                  S5      S-  rS	 r\	R                   " SS
S9S 5       r\	R                   " SS
S9S 5       rg)z'
Generators for the small graph atlas.
    N)islicegraph_atlasgraph_atlas_gi  znetworkx.generatorszatlas.dat.gzc               #   H  #    [         R                  " [        S5       n U R                  5       nU(       GaQ  UR	                  S5      (       Ga:  [        USS R                  5       5      nU R                  5       n[        USS R                  5       5      n/ nU R                  5       nU(       ad  UR	                  S5      (       dN  UR                  UR                  5       5        U R                  5       nU(       a  UR	                  S5      (       d  MN  [        R                  " 5       nSU 3Ul
        UR                  [        U5      5        UR                  S U 5       5        Uv   U(       a  UR	                  S5      (       a  GM:  SSS5        g! , (       d  f       g= f7f)zSequentially read the file containing the edge list data for the
graphs in the atlas and generate the graphs one at a time.

This function reads the file given in :data:`.ATLAS_FILE`.

rbs   GRAPH   NGc              3   p   #    U  H,  n[        [        [        UR                  5       5      5      v   M.     g 7f)N)tuplemapintsplit).0es     K/var/www/html/env/lib/python3.13/site-packages/networkx/generators/atlas.py	<genexpr>#_generate_graphs.<locals>.<genexpr>X   s%     JAU3sAGGI#677s   46)gzipopen
ATLAS_FILEreadline
startswithr   rstripappendnxGraphnameadd_nodes_fromrangeadd_edges_from)flinegraph_index	num_nodesedgelistr	   s         r   _generate_graphsr&   :   s&     
:t	$zz|tx00 d12hoo/0K::<DDHOO-.I H::<Dtx88.zz| tx88 
A&AFU9-.JJJG- tx00 
%	$	$s$   F"C3FA2F	F"
FF"T)graphsreturns_graphc                     SU s=::  a
  [         :  d  O  [        S[          35      e[        [        [	        5       U S5      5      $ )a  Returns graph number `i` from the Graph Atlas.

For more information, see :func:`.graph_atlas_g`.

Parameters
----------
i : int
    The index of the graph from the atlas to get. The graph at index
    0 is assumed to be the null graph.

Returns
-------
list
    A list of :class:`~networkx.Graph` objects, the one at index *i*
    corresponding to the graph *i* in the Graph Atlas.

See also
--------
graph_atlas_g

Notes
-----
The time required by this function increases linearly with the
argument `i`, since it reads a large file sequentially in order to
generate the graph [1]_.

References
----------
.. [1] Ronald C. Read and Robin J. Wilson, *An Atlas of Graphs*.
       Oxford University Press, 1998.

r   zindex must be between 0 and N)
NUM_GRAPHS
ValueErrornextr   r&   )is    r   r   r   \   s=    D Z7
|DEE')1d344    c                  (    [        [        5       5      $ )a  Returns the list of all graphs with up to seven nodes named in the
Graph Atlas.

The graphs are listed in increasing order by

1. number of nodes,
2. number of edges,
3. degree sequence (for example 111223 < 112222),
4. number of automorphisms,

in that order, with three exceptions as described in the *Notes*
section below. This causes the list to correspond with the index of
the graphs in the Graph Atlas [atlas]_, with the first graph,
``G[0]``, being the null graph.

Returns
-------
list
    A list of :class:`~networkx.Graph` objects, the one at index *i*
    corresponding to the graph *i* in the Graph Atlas.

See also
--------
graph_atlas

Notes
-----
This function may be expensive in both time and space, since it
reads a large file sequentially in order to populate the list.

Although the NetworkX atlas functions match the order of graphs
given in the "Atlas of Graphs" book, there are (at least) three
errors in the ordering described in the book. The following three
pairs of nodes violate the lexicographically nondecreasing sorted
degree sequence rule:

- graphs 55 and 56 with degree sequences 001111 and 000112,
- graphs 1007 and 1008 with degree sequences 3333444 and 3333336,
- graphs 1012 and 1213 with degree sequences 1244555 and 1244456.

References
----------
.. [atlas] Ronald C. Read and Robin J. Wilson,
           *An Atlas of Graphs*.
           Oxford University Press, 1998.

)listr&    r.   r   r   r      s    b  "##r.   )__doc__r   importlib.resources	importlibosos.path	itertoolsr   networkxr   __all__r*   	resourcesfilesr   r&   _dispatchabler   r   r1   r.   r   <module>r=      s      	   /
* 
H   &&'<=N
D T2#5 3#5L T20$ 30$r.   