U
    ¹mœdÍ  ã                   @   sâ  d Z ddlmZ ddlZe d¡ e ¡ Zdddddd	gZ	d
ddgZ
dd„ e	e
 D ƒZdd„ e	D ƒdd„ e
D ƒ Ze e	e
 ¡ e dddddddddddddddg¡ d d!d"œZd#d$d%d&d'd(d)d*d+d,œ	Ze d-d.d-¡Ze d/e ¡  ¡ ejefeed0œe—Ž ejjed.d1d2�\ZZeeƒZeeƒZeD ]Ze d3¡ e d4¡ �q,e d-d.d.¡ e d5e ¡  ¡ d6d$d%d7d8d9d*d:d;d<œ	ZeeƒZ e  !¡  e"e ƒD ]\Z#Zd.e#d. fee< �q˜ejefeeed=œe—Ž e $¡  e %¡  dS )>a  
===============
Dedensification
===============

Examples of dedensification of a graph.  Dedensification retains the structural
pattern of the original graph and will only add compressor nodes when doing so
would result in fewer edges in the compressed graph.
é    NZDedensificationÚ1Ú2Ú3Ú4Ú5Ú6ÚAÚBÚCc                 C   s   g | ]}d ‘qS )éú   © )Ú.0Únoder   r   ú�/home/sam/Atlas/atlas_env/lib/python3.8/site-packages/../../../share/doc/networkx-3.1/examples/algorithms/plot_dedensification.pyÚ
<listcomp>   s     r   c                 C   s   g | ]}d ‘qS )Úwhiter   ©r   Únr   r   r   r      s     c                 C   s   g | ]}d ‘qS )Úredr   r   r   r   r   r      s     )r   r
   )r   r	   )r   r
   )r   r	   )r   r   )r   r	   )r   r   )r   r   )r   r
   )r   r	   )r   r   )r   r	   )r   r   )r   r   )r   r   TÚblack)Zwith_labelsZ
edgecolors)r   é   )r   é   )r   é   )r   r   )r   r   )r   r   )r   r   )r   r   )r   r   )	r   r   r   r   r   r	   r
   r   r   r   r   zOriginal (%s edges))ÚposÚ
node_colorF)Ú	thresholdÚcopyÚyellowiX  zDedensified (%s edges))r   r   )r   g      è?)ç      ø?r   )r   r   )r   r   )r   g      @)	r   r	   r   r   r   r   r
   r   r   )r   r   Z	node_size)&Ú__doc__Zmatplotlib.pyplotZpyplotZpltZnetworkxÚnxZsuptitleZDiGraphZoriginal_graphZwhite_nodesZ	red_nodesZ
node_sizesZnode_colorsZadd_nodes_fromZadd_edges_fromZbase_optionsr   ZsubplotZax1ÚtitleZnumber_of_edgesZdraw_networkxZsummarizationZ	dedensifyZnonexp_graphZcompression_nodesÚlistZnonexp_node_colorsZnonexp_node_sizesr   ÚappendZ
nonexp_posZc_nodesÚsortÚ	enumerateZspotZtight_layoutÚshowr   r   r   r   Ú<module>   sœ   	

ñÿ
÷  ÿ

÷ÿüû