
    fiz                         d dl mZ d dlZ ej        d            ej        d           d dlZd dlmZmZ  G d d          Z	dS )    )defaultdictNnumpyscipy)communicabilitycommunicability_expc                       e Zd Zd Zd ZdS )TestCommunicabilityc                    ddddddd}t          t          j        d                    }|                                D ]>\  }}|D ]6}||         |         t	          j        ||         |         d          k    sJ 7?d S )NgOQu?gNğ?)r         Hz>abs)r   nx
path_graphitemspytestapprox)selfanswerresultk1valk2s         /var/www/development/aibuddy-work/election-extract/venv/lib/python3.11/site-packages/networkx/algorithms/tests/test_communicability.pytest_communicabilityz(TestCommunicability.test_communicability   s    %*<==%*<==
 
 !q!1!122||~~ 	Q 	QGB Q Qbz"~vbz"~4)P)P)PPPPPPQ	Q 	Q    c           
         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 ]\  \  }}}|||         |<   t          j        g d           }t          |          }|                                D ]>\  }}|D ]6}||         |         t          j        ||         |         d!"          k    sJ 7?t          |          }|                                D ]>\  }}|D ]6}||         |         t          j        ||         |         d!"          k    sJ 7?d 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   s	            r   test_communicability2z)TestCommunicability.test_communicability2   sd   
*
/
 -
 ,	

 0
 /
 !"4
  2
 1
 !"4
 -
  2
 0
 /
  2
  ,!
" 1#
$ 0.10"4 21"43
 
 
8 T""&,,.. 	 	KHRaF2JrNNX  	
 	
 !$$||~~ 	Q 	QGB Q Qbz"~vbz"~4)P)P)PPPPPPQ %R((||~~ 	Q 	QGB Q Qbz"~vbz"~4)P)P)PPPPPPQ	Q 	Qr   N)__name__
__module____qualname__r   r/    r   r   r	   r	      s:        Q Q Q4Q 4Q 4Q 4Q 4Qr   r	   )
collectionsr   r   importorskipnetworkxr   'networkx.algorithms.communicability_algr   r   r	   r3   r   r   <module>r8      s    # # # # # #   G     G        X X X X X X X XDQ DQ DQ DQ DQ DQ DQ DQ DQ DQr   