Ë
    D^(h6  ã                   ó¼   — d Z ddlZddlmZ g d¢Zej                  d„ «       Z ed«      ej                  d„ «       «       Z ed«      ej                  d„ «       «       Z	y)	zDegree centrality measures.é    N)Únot_implemented_for)Údegree_centralityÚin_degree_centralityÚout_degree_centralityc                 óÈ   — t        | «      dk  r| D �ci c]  }|d“Œ c}S dt        | «      dz
  z  }| j                  «       D ��ci c]  \  }}|||z  “Œ }}}|S c c}w c c}}w )a¥  Compute the degree centrality for nodes.

    The degree centrality for a node v is the fraction of nodes it
    is connected to.

    Parameters
    ----------
    G : graph
      A networkx graph

    Returns
    -------
    nodes : dictionary
       Dictionary of nodes with degree centrality as the value.

    Examples
    --------
    >>> G = nx.Graph([(0, 1), (0, 2), (0, 3), (1, 2), (1, 3)])
    >>> nx.degree_centrality(G)
    {0: 1.0, 1: 1.0, 2: 0.6666666666666666, 3: 0.6666666666666666}

    See Also
    --------
    betweenness_centrality, load_centrality, eigenvector_centrality

    Notes
    -----
    The degree centrality values are normalized by dividing by the maximum
    possible degree in a simple graph n-1 where n is the number of nodes in G.

    For multigraphs or graphs with self loops the maximum degree might
    be higher than n-1 and values of degree centrality greater than 1
    are possible.
    é   ç      ð?)ÚlenÚdegree©ÚGÚnÚsÚdÚ
centralitys        úg/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/networkx/algorithms/centrality/degree_alg.pyr   r   	   sl   € ôH ˆ1ƒv�‚{ØÖ ˜��1‘Ò Ð àŒs�1‹v˜‰|Ñ€AØ'(§x¡x£z×2™t˜q !�!�Q˜‘U‘(Ð2€JÑ2ØÐùò	 !ùó 3ó   “
AÁAÚ
undirectedc                 óÈ   — t        | «      dk  r| D �ci c]  }|d“Œ c}S dt        | «      dz
  z  }| j                  «       D ��ci c]  \  }}|||z  “Œ }}}|S c c}w c c}}w )a
  Compute the in-degree centrality for nodes.

    The in-degree centrality for a node v is the fraction of nodes its
    incoming edges are connected to.

    Parameters
    ----------
    G : graph
        A NetworkX graph

    Returns
    -------
    nodes : dictionary
        Dictionary of nodes with in-degree centrality as values.

    Raises
    ------
    NetworkXNotImplemented
        If G is undirected.

    Examples
    --------
    >>> G = nx.DiGraph([(0, 1), (0, 2), (0, 3), (1, 2), (1, 3)])
    >>> nx.in_degree_centrality(G)
    {0: 0.0, 1: 0.3333333333333333, 2: 0.6666666666666666, 3: 0.6666666666666666}

    See Also
    --------
    degree_centrality, out_degree_centrality

    Notes
    -----
    The degree centrality values are normalized by dividing by the maximum
    possible degree in a simple graph n-1 where n is the number of nodes in G.

    For multigraphs or graphs with self loops the maximum degree might
    be higher than n-1 and values of degree centrality greater than 1
    are possible.
    r   r	   )r
   Ú	in_degreer   s        r   r   r   5   sl   € ôT ˆ1ƒv�‚{ØÖ ˜��1‘Ò Ð àŒs�1‹v˜‰|Ñ€AØ'(§{¡{£}×5™t˜q !�!�Q˜‘U‘(Ð5€JÑ5ØÐùò	 !ùó 6r   c                 óÈ   — t        | «      dk  r| D �ci c]  }|d“Œ c}S dt        | «      dz
  z  }| j                  «       D ��ci c]  \  }}|||z  “Œ }}}|S c c}w c c}}w )aï  Compute the out-degree centrality for nodes.

    The out-degree centrality for a node v is the fraction of nodes its
    outgoing edges are connected to.

    Parameters
    ----------
    G : graph
        A NetworkX graph

    Returns
    -------
    nodes : dictionary
        Dictionary of nodes with out-degree centrality as values.

    Raises
    ------
    NetworkXNotImplemented
        If G is undirected.

    Examples
    --------
    >>> G = nx.DiGraph([(0, 1), (0, 2), (0, 3), (1, 2), (1, 3)])
    >>> nx.out_degree_centrality(G)
    {0: 1.0, 1: 0.6666666666666666, 2: 0.0, 3: 0.0}

    See Also
    --------
    degree_centrality, in_degree_centrality

    Notes
    -----
    The degree centrality values are normalized by dividing by the maximum
    possible degree in a simple graph n-1 where n is the number of nodes in G.

    For multigraphs or graphs with self loops the maximum degree might
    be higher than n-1 and values of degree centrality greater than 1
    are possible.
    r   r	   )r
   Ú
out_degreer   s        r   r   r   g   sl   € ôT ˆ1ƒv�‚{ØÖ ˜��1‘Ò Ð àŒs�1‹v˜‰|Ñ€AØ'(§|¡|£~×6™t˜q !�!�Q˜‘U‘(Ð6€JÑ6ØÐùò	 !ùó 7r   )
Ú__doc__ÚnetworkxÚnxÚnetworkx.utils.decoratorsr   Ú__all__Ú_dispatchabler   r   r   © ó    r   ú<module>r!      s}   ðÙ !ã Ý 9â
P€ð ×Ññ(ó ð(ñV �\Ó"Ø×Ññ-ó ó #ð-ñ` �\Ó"Ø×Ññ-ó ó #ñ-r    