o
    ˷e                  
   @   s  d Z ddlmZ ddlZed e Zg dZ	g dZ
dd e	e
 D Zdd e	D d	d e
D  Zee	e
  eg d
 e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de ejjeddd\ZZeeZeeZeD ]Zed ed qeddd ed e   d!ddd"d#d$dd%d&d'	Z eeZ!e!"  e#e!D ]\Z$Zde$d fe e< qe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.
    NDedensification)123456)ABCc                 C      g | ]}d qS )    ).0noder   r   /var/www/ideatree/venv/lib/python3.10/site-packages/../../../share/doc/networkx-2.8.6/examples/algorithms/plot_dedensification.py
<listcomp>       r   c                 C   r   )whiter   r   nr   r   r   r      r   c                 C   r   )redr   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
   )r   r	   )r   r   )r	   r   Tblack)with_labels
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   	node_size)'__doc__matplotlib.pyplotpyplotpltnetworkxnxsuptitleDiGraphoriginal_graphwhite_nodes	red_nodes
node_sizesnode_colorsadd_nodes_fromadd_edges_fromdictbase_optionsr   subplotax1titlenumber_of_edgesdraw_networkxsummarization	dedensifynonexp_graphcompression_nodeslistnonexp_node_colorsnonexp_node_sizesr   append
nonexp_posc_nodessort	enumeratespottight_layoutshowr   r   r   r   <module>   s|    	


