o
    ˷e{                     @   sR   d dl mZ d dlZed ed d dlZd dlmZmZ G dd dZ	dS )    )defaultdictNnumpyscipy)communicabilitycommunicability_expc                   @   s   e Zd Zdd Zdd ZdS )TestCommunicabilityc                 C   sj   ddddddd}t td}| D ]\}}|D ]}|| | tj|| | ddks1J qqd S )NgOQu?gNğ?)r         Hz>abs)r   nx
path_graphitemspytestapprox)selfanswerresultk1valk2 r   e/var/www/ideatree/venv/lib/python3.10/site-packages/networkx/algorithms/tests/test_communicability.pytest_communicability   s   	(z(TestCommunicability.test_communicabilityc           	   
   C   sP  i dddddddddd	d
ddddddddddddddddddddddddddd	ddddd}t t}| D ]\\}}}||| |< qHtg d }t|}| D ]\}}|D ]}|| | tj|| | d!d"ksJ qjqdt|}| D ]\}}|D ]}|| | tj|| | d!d"ksJ qqd S )#N)1r   gjXF{CP?)r   AlbertgNH?)r   Aric)r   Dang.9?)r   Franckg*J?)r   r   )r   r   g}~@)r   r   gi<?)r   r   g-{` @r   r   g+)X?)r   r   )r   r   )r   r   g}~@r   r   g-{` @)r   r   r   r   r   r   g^G<	@gTH?gJi|@))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   dictr   r   Graphr   r   r   r   )	r   answer_origr   r   r   vG1r   r   r   r   r   test_communicability2   sz   	
((z)TestCommunicability.test_communicability2N)__name__
__module____qualname__r   r+   r   r   r   r   r      s    r   )
collectionsr   r   importorskipnetworkxr   'networkx.algorithms.communicability_algr   r   r   r   r   r   r   <module>   s    

