Ë
    D^(hf  ã                   ó$   — d Z ddlZ G d„ d«      Zy)z@Unit tests for the :mod:`networkx.algorithms.efficiency` module.é    Nc                   ó<   — e Zd Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Z	d„ Z
y	)
ÚTestEfficiencyc                 óÚ   — t        j                  «       | _        | j                  j                  g d¢«       t        j                  d«      | _        t        j                  dd«      | _        y )N)é   é   é   é   r   r   )ÚnxÚGraphÚG1Úadd_nodes_fromÚcycle_graphÚG2Úlollipop_graphÚG3©Úselfs    úg/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/networkx/algorithms/tests/test_efficiency.pyÚsetup_methodzTestEfficiency.setup_method   sE   € ä—(‘(“*ˆŒØ�‰×ÑšyÔ)ä—.‘. Ó#ˆŒä×#Ñ# A qÓ)ˆ�ó    c                 óP   — t        j                  | j                  dd«      dk(  sJ ‚y)z>
        When nodes are disconnected, efficiency is 0
        r   r   r   N)r
   Ú
efficiencyr   r   s    r   Ú"test_efficiency_disconnected_nodesz1TestEfficiency.test_efficiency_disconnected_nodes   s#   € ô �}‰}˜TŸW™W a¨Ó+¨qÒ0Ð0Ñ0r   c                 óL   — t        j                  | j                  «      dk(  sJ ‚y)z=
        In a disconnected graph the efficiency is 0
        r   N)r
   Úlocal_efficiencyr   r   s    r   Ú(test_local_efficiency_disconnected_graphz7TestEfficiency.test_local_efficiency_disconnected_graph   s!   € ô ×"Ñ" 4§7¡7Ó+¨qÒ0Ð0Ñ0r   c                 óœ   — t        j                  | j                  dd«      dk(  sJ ‚t        j                  | j                  dd«      dk(  sJ ‚y )Nr   r   r   g      à?)r
   r   r   r   s    r   Útest_efficiencyzTestEfficiency.test_efficiency   s@   € Ü�}‰}˜TŸW™W a¨Ó+¨qÒ0Ð0Ð0Ü�}‰}˜TŸW™W a¨Ó+¨uÒ4Ð4Ñ4r   c                 óL   — t        j                  | j                  «      dk(  sJ ‚y )Ng«ªªªªªê?)r
   Úglobal_efficiencyr   r   s    r   Útest_global_efficiencyz%TestEfficiency.test_global_efficiency    s   € Ü×#Ñ# D§G¡GÓ,°Ò5Ð5Ñ5r   c                 ó„   — t        dd«      D ]1  }t        j                  |«      }t        j                  |«      dk(  rŒ1J ‚ y)zX
        Tests that the average global efficiency of the complete graph is one.
        r   é
   r   N)Úranger
   Úcomplete_graphr    ©r   ÚnÚGs      r   Ú%test_global_efficiency_complete_graphz4TestEfficiency.test_global_efficiency_complete_graph#   sB   € ô �q˜"“ò 	0ˆAÜ×!Ñ! !Ó$ˆAÜ×'Ñ'¨Ó*¨aÓ/Ð/Ð/ñ	0r   c                 ó„   — t        dd«      D ]1  }t        j                  |«      }t        j                  |«      dk(  rŒ1J ‚ y)z¼
        Test that the local efficiency for a complete graph with at least 3
        nodes should be one. For a graph with only 2 nodes, the induced
        subgraph has no edges.
        r   r#   r   N)r$   r
   r%   r   r&   s      r   Ú$test_local_efficiency_complete_graphz3TestEfficiency.test_local_efficiency_complete_graph+   sB   € ô �q˜"“ò 	/ˆAÜ×!Ñ! !Ó$ˆAÜ×&Ñ& qÓ)¨QÓ.Ð.Ð.ñ	/r   c                 óL   — t        j                  | j                  «      dk(  sJ ‚y)zˆ
        Test that the ego graph is used when computing local efficiency.
        For more information, see GitHub issue #2710.
        g«ªªªªªâ?N)r
   r   r   r   s    r   Útest_using_ego_graphz#TestEfficiency.test_using_ego_graph5   s!   € ô
 ×"Ñ" 4§7¡7Ó+¨vÒ5Ð5Ñ5r   N)Ú__name__Ú
__module__Ú__qualname__r   r   r   r   r!   r)   r+   r-   © r   r   r   r      s*   „ ò*ò1ò1ò5ò6ò0ò/ó6r   r   )Ú__doc__Únetworkxr
   r   r1   r   r   ú<module>r4      s   ðÙ Fã ÷46ò 46r   