o
    h[                     @   sp   d Z ddlZg dZejddddd Zejddddd	 Zejdddd
d Zejddddd ZdS )z
Famous social networks.
    N)karate_club_graphdavis_southern_women_graphflorentine_families_graphles_miserables_graphT)graphsreturns_graphc            
      C   s   t td} h d}t }||  d|_d}t|dD ]"\}}dd | D }t|D ]\}}|dkr@|j|||d	 q0q|D ]}	|	|v rLd
nd|j	|	 d< qD|S )a  Returns Zachary's Karate Club graph.

    Each node in the returned graph has a node attribute 'club' that
    indicates the name of the club to which the member represented by that node
    belongs, either 'Mr. Hi' or 'Officer'. Each edge has a weight based on the
    number of contexts in which that edge's incident node members interacted.

    The dataset is derived from the 'Club After Split From Data' column of Table 3 in [1]_.
    This was in turn derived from the 'Club After Fission' column of Table 1 in the
    same paper. Note that the nodes are 0-indexed in NetworkX, but 1-indexed in the
    paper (the 'Individual Number in Matrix C' column of Table 3 starts at 1). This
    means, for example, that ``G.nodes[9]["club"]`` returns 'Officer', which
    corresponds to row 10 of Table 3 in the paper.

    Examples
    --------
    To get the name of the club to which a node belongs::

        >>> G = nx.karate_club_graph()
        >>> G.nodes[5]["club"]
        'Mr. Hi'
        >>> G.nodes[9]["club"]
        'Officer'

    References
    ----------
    .. [1] Zachary, Wayne W.
       "An Information Flow Model for Conflict and Fission in Small Groups."
       *Journal of Anthropological Research*, 33, 452--473, (1977).
    "   >   r                           
                        zZachary's Karate Cluba	  0 4 5 3 3 3 3 2 2 0 2 3 2 3 0 0 0 2 0 2 0 2 0 0 0 0 0 0 0 0 0 2 0 0
4 0 6 3 0 0 0 4 0 0 0 0 0 5 0 0 0 1 0 2 0 2 0 0 0 0 0 0 0 0 2 0 0 0
5 6 0 3 0 0 0 4 5 1 0 0 0 3 0 0 0 0 0 0 0 0 0 0 0 0 0 2 2 0 0 0 3 0
3 3 3 0 0 0 0 3 0 0 0 0 3 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
3 0 0 0 0 0 2 0 0 0 3 0 0 0 0 0 0 0 0 0 0 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python3.10/site-packages/networkx/generators/social.py
<listcomp>]   s    z%karate_club_graph.<locals>.<listcomp>r	   weightzMr. HiOfficerclub)
setrangenxGraphadd_nodes_fromname	enumeratesplitadd_edgenodes)
all_membersclub1G
zacharydatrowlinethisrowcolentryvr   r   r   r      s    !
$r   c                  C   sZ   t  } g d}| j|dd g d}| j|dd | g d || jd< || jd< | S )	zReturns Davis Southern women social network.

    This is a bipartite graph.

    References
    ----------
    .. [1] A. Davis, Gardner, B. B., Gardner, M. R., 1941. Deep South.
        University of Chicago Press, Chicago, IL.
    )Evelyn JeffersonLaura MandevilleTheresa AndersonBrenda RogersCharlotte McDowdFrances AndersonEleanor NyePearl OglethorpeRuth DeSandVerne SandersonMyra LiddelKatherina RogersSylvia AvondaleNora FayetteHelen LloydDorothy MurchisonOlivia CarletonFlora Pricer   )	bipartite)E1E2E3E4E5E6E7E8E9E10E11E12E13E14r	   )Y)r8   rK   )r8   rL   )r8   rM   )r8   rN   )r8   rO   )r8   rP   )r8   rR   )r8   rS   )r9   rK   )r9   rL   )r9   rM   )r9   rO   )r9   rP   )r9   rQ   )r9   rR   )r:   rL   )r:   rM   )r:   rN   )r:   rO   )r:   rP   )r:   rQ   )r:   rR   )r:   rS   )r;   rK   )r;   rM   )r;   rN   )r;   rO   )r;   rP   )r;   rQ   )r;   rR   )r<   rM   )r<   rN   )r<   rO   )r<   rQ   )r=   rM   )r=   rO   )r=   rP   )r=   rR   )r>   rO   )r>   rP   )r>   rQ   )r>   rR   )r?   rP   )r?   rR   )r?   rS   )r@   rO   )r@   rQ   )r@   rR   )r@   rS   )rA   rQ   )rA   rR   )rA   rS   )rA   rV   )rB   rR   )rB   rS   )rB   rT   )rB   rV   )rC   rR   )rC   rS   )rC   rT   )rC   rV   )rC   rW   )rC   rX   )rD   rQ   )rD   rR   )rD   rS   )rD   rT   )rD   rV   )rD   rW   )rD   rX   )rE   rP   )rE   rQ   )rE   rS   )rE   rT   )rE   rU   )rE   rV   )rE   rW   )rE   rX   )rF   rQ   )rF   rR   )rF   rT   )rF   rU   )rF   rV   )rG   rR   )rG   rS   )rH   rS   )rH   rU   )rI   rS   )rI   rU   topbottom)r&   r'   r(   add_edges_fromgraph)r0   womeneventsr   r   r   r   h   s   
]
r   c                  C   s   t  } | dd | dd | dd | dd | dd | dd | dd | dd	 | dd
 | d
d | dd | dd | dd | dd | dd | dd | d	d | d	d | dd | dd | S )a  Returns Florentine families graph.

    References
    ----------
    .. [1] Ronald L. Breiger and Philippa E. Pattison
       Cumulated social roles: The duality of persons and their algebras,1
       Social Networks, Volume 8, Issue 3, September 1986, Pages 215-256
    
AcciaiuoliMedici
CastellaniPeruzziStrozzi	BarbadoriRidolfi
TornabuoniAlbizziSalviatiPazziBischeriGuadagniGinoriLamberteschir&   r'   r,   r0   r   r   r   r      s,   
r   c                  C   s  t  } | jdddd | jdddd | jdddd | jddd	d | jd
ddd | jdddd | jdddd | jdddd | jdddd | jdddd | jdddd | jdddd | jdddd | jdddd | jdddd | jdddd | jdddd | jdddd | jdddd | jdddd | jdddd | jdddd | jdddd | jdddd | jdddd | jdddd | jdddd | jdddd | jdddd | jdddd | jdddd | jdddd | jdddd | jd ddd | jd ddd | jd ddd | jd ddd | jd ddd | jd ddd | jd!ddd | jd!ddd | jd!ddd | jd!ddd | jd!ddd | jd!ddd | jd!d dd | jd!ddd | jd!dd"d | jd#d!dd | jd#dd$d | jd%d#d&d | jd%d!dd | jd%dd'd | jd(d#dd | jd(dd)d | jd(ddd | jd(d%dd | jd*dd+d | jd*d!dd | jd*d%dd | jd*d#dd | jd*d(dd | jd,ddd | jd,d*dd | jd-d!dd | jd-d*dd | jd-ddd | jd.d!dd | jd/d.dd | jd/ddd | jd/d!dd | jd/d*dd | jd0ddd | jd1ddd | jd1d*dd | jd2ddd | jd2d-dd | jd3ddd | jd3d2dd | jd3d-dd | jd4d2dd | jd4d3dd | jd4ddd | jd4d-dd | jd5d2dd | jd5d3dd | jd5d4dd | jd5ddd | jd5d-dd | jd6d2dd | jd6d3dd | jd6d4dd | jd6d5dd | jd6ddd | jd6d-dd | jd7d%dd | jd8d%dd | jd9d#dd | jd9d%dd | jd:d9dd | jd:d%dd | jd:d#dd | jd;ddd | jd;d(dd | jd;d*dd | jd<d,dd | jd<ddd | jd=d,dd | jd>d?dd | jd@d>dd | jd@d%dd | jd@d*dd | jd@ddd | jdAd(dd | jdAddd | jdBdAdd | jdBd#dd | jdCdAd"d | jdCd(dd | jdCddd | jdDdCdd | jdDd7dd | jdEdCdd | jdFdCdd | jdFdAdd | jdFd(dd | jdGdCd	d | jdGdAd'd | jdGd7dd | jdGdFdd | jdGd(dHd | jdGddId | jdGddd | jdGd%dd | jdGd9dd | jdGd@dd | jdJdAdd | jdJdGdd | jdKdGdd | jdKd9dd | jdKd@dd | jdLdGd$d | jdLd@d$d | jdLd*d	d | jdLdKdd | jdLddd | jdMdLdNd | jdMdGdd | jdMd@d	d | jdMdKdd | jdOd@dd | jdOdLdd | jdOdMdd | jdPd@dd | jdPdLd	d | jdPdOdd | jdPdMdd | jdPdKdd | jdPdGdd | jdQdGd"d | jdQdLd+d | jdQdMd&d | jdQd@d$d | jdQdKdd | jdQd9dd | jdQdPd	d | jdQdOdd | jdRdMdd | jdRd@dd | jdRdQd	d | jdRdKdd | jdRdLdd | jdRdPdd | jdRdOdd | jdRdGdd | jdSdGdd | jdSdQd'd | jdSd@dd | jdSdRdd | jdSdLdd | jdSdPd	d | jdSdOdd | jdSdMd"d | jdSdKdd | jdSddd | jdTdRdd | jdTdSd$d | jdTd@dd | jdTdQdd | jdTdLdd | jdTdPdd | jdTdOdd | jdTdMdd | jdTdKdd | jdTdGdd | jdUdSdd | jdUdLdd | jdUdMdd | jdUdQdd | jdUdTdd | jdUd@dd | jdUdRdd | jdUdPdd | jdUdOdd | jdVdKdd | jdWd%dd | jdWddd | jdWd#dd | jdWd*dd | jdWd@dd | jdWd9dd | jdXd%d	d | jdXdWd	d | jdXddd | jdXd#dd | jdXd*dd | jdXd@dd | jdXd9dd | jdYd%dd | jdYdXdd | jdYdWdd | jdYddd | jdYd#dd | jdYd*dd | jdYd9dd | jdYdLdd | jdZd*dd | jdZdXdd | jdZdWdd | jdZdYdd | jdZddd | jdZd@dd | jdZd9dd | jdZd%dd | jd[d(dd | jd[d*dd | jd[ddd | jd\d@dd | jd]d@dd | jd]d\dd | jd^dXdd | jd^dWdd | jd^d%dd | jd^d@dd | jd^d9dd | jd^dYdd | jd^dZdd | jd_dSdd | jd_dTdd | jd_dUdd | jd_dRdd | jd_dQdd | jd_d@dd | jd_dLdd | S )`zReturns coappearance network of characters in the novel Les Miserables.

    References
    ----------
    .. [1] D. E. Knuth, 1993.
       The Stanford GraphBase: a platform for combinatorial computing,
       pp. 74-87. New York: AcM Press.
    NapoleonMyrielr	   r    MlleBaptistiner   MmeMagloirer   r   CountessDeLoGeborandChamptercierCravatteCountr
   OldManValjeanLabarrer   r   
MargueriteMmeDeRIsabeauGervais	Listolier	Tholomyesr   FameuilBlacheville	FavouriteDahliaZephineFantine	   MmeThenardierr   
Thenardierr   r   Cosette   Javertr   Fauchelevent
BamataboisPerpetueSimpliceScaufflaireWoman1JudgeChampmathieuBrevet
ChenildieuCochepaille	PontmercyBoulatruelleEponineAnzelmaWoman2MotherInnocentGribier	MmeBurgon	JondretteGavrocheGillenormandMagnonMlleGillenormandMmePontmercyMlleVauboisLtGillenormandMariusr   r   	BaronessTMabeufEnjolras
Combeferre   	ProuvaireFeuilly
CourfeyracBahorelBossuetJoly	GrantaireMotherPlutarch	GueulemerBabet
ClaquesousMontparnasse	ToussaintChild1Child2BrujonMmeHuchelouprn   ro   r   r   r   r   !  s   
r   )	__doc__networkxr&   __all___dispatchabler   r   r   r   r   r   r   r   <module>   s    
X
 
!