+
    �°³jàU  ã                   óÒ  € R t ^ RIt^ RIHt . ROt]P                  ! RR7      RR l4       t]P                  ! RR7      RR l4       t]! R4      ]! R4      ]P                  ! RR7      R	RR
RRRRR/R l4       4       4       t	]! R4      ]! R4      ]P                  ! RR7      RR l4       4       4       t
]! R4      ]! R4      ]P                  ! RR7      RR l4       4       4       tRR ltR# )a{  Laplacian matrix of graphs.

All calculations here are done using the out-degree. For Laplacians using
in-degree, use `G.reverse(copy=False)` instead of `G` and take the transpose.

The `laplacian_matrix` function provides an unnormalized matrix,
while `normalized_laplacian_matrix`, `directed_laplacian_matrix`,
and `directed_combinatorial_laplacian_matrix` are all normalized.
N)Únot_implemented_forÚweight)Ú
edge_attrsc                ó  € ^ RI pVf   \        V 4      p\        P                  ! WVRR7      pVP                  w  rVVP
                  P                  VP                  ^R7      ^ 3We3R7      P                  4       pWt,
          # )už
  Returns the Laplacian matrix of G.

The graph Laplacian is the matrix L = D - A, where
A is the adjacency matrix and D is the diagonal matrix of node degrees.

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

nodelist : list, optional
   The rows and columns are ordered according to the nodes in nodelist.
   If nodelist is None, then the ordering is produced by G.nodes().

weight : string or None, optional (default='weight')
   The edge data key used to compute each value in the matrix.
   If None, then each edge has weight 1.

Returns
-------
L : SciPy sparse array
  The Laplacian matrix of G.

Notes
-----
For MultiGraph, the edges weights are summed.

This returns an unnormalized matrix. For a normalized output,
use `normalized_laplacian_matrix`, `directed_laplacian_matrix`,
or `directed_combinatorial_laplacian_matrix`.

This calculation uses the out-degree of the graph `G`. To use the
in-degree for calculations instead, use `G.reverse(copy=False)` and
take the transpose.

See Also
--------
:func:`~networkx.convert_matrix.to_numpy_array`
normalized_laplacian_matrix
directed_laplacian_matrix
directed_combinatorial_laplacian_matrix
:func:`~networkx.linalg.spectrum.laplacian_spectrum`

Examples
--------
For graphs with multiple connected components, L is permutation-similar
to a block diagonal matrix where each block is the respective Laplacian
matrix for each component.

>>> G = nx.Graph([(1, 2), (2, 3), (4, 5)])
>>> print(nx.laplacian_matrix(G).toarray())
[[ 1 -1  0  0  0]
 [-1  2 -1  0  0]
 [ 0 -1  1  0  0]
 [ 0  0  0  1 -1]
 [ 0  0  0 -1  1]]

>>> edges = [
...     (1, 2),
...     (2, 1),
...     (2, 4),
...     (4, 3),
...     (3, 4),
... ]
>>> DiG = nx.DiGraph(edges)
>>> print(nx.laplacian_matrix(DiG).toarray())
[[ 1 -1  0  0]
 [-1  2 -1  0]
 [ 0  0  1 -1]
 [ 0  0 -1  1]]

Notice that node 4 is represented by the third column and row. This is because
by default the row/column order is the order of `G.nodes` (i.e. the node added
order -- in the edgelist, 4 first appears in (2, 4), before node 3 in edge (4, 3).)
To control the node order of the matrix, use the `nodelist` argument.

>>> print(nx.laplacian_matrix(DiG, nodelist=[1, 2, 3, 4]).toarray())
[[ 1 -1  0  0]
 [-1  2  0 -1]
 [ 0  0  1 -1]
 [ 0  0 -1  1]]

This calculation uses the out-degree of the graph `G`. To use the
in-degree for calculations instead, use `G.reverse(copy=False)` and
take the transpose.

>>> print(nx.laplacian_matrix(DiG.reverse(copy=False)).toarray().T)
[[ 1 -1  0  0]
 [-1  1 -1  0]
 [ 0  0  2 -1]
 [ 0  0 -1  1]]

References
----------
.. [1] Langville, Amy N., and Carl D. Meyer. Googleâ€™s PageRank and Beyond:
   The Science of Search Engine Rankings. Princeton University Press, 2006.

NÚcsr©Únodelistr   Úformat©Úaxis©Úshape)	ÚscipyÚlistÚnxÚto_scipy_sparse_arrayr   ÚsparseÚ	dia_arrayÚsumÚtocsr)ÚGr   r   ÚspÚAÚnÚmÚDs   &&&     Ú`/home/luca/screen-checking/.venv/lib/python3.14/site-packages/networkx/linalg/laplacianmatrix.pyÚlaplacian_matrixr      sp   € óH àÒÜ˜“7ˆÜ
× Ò  ¸fÈUÔS€AØ�7‰7�D€AØ
�	‰	×Ñ˜QŸU™U¨˜U›]¨AÐ.°q°fÐÓ=×CÑCÓE€AØ�5€Ló    c                óL  € ^ RI p^ RIpVf   \        V 4      p\        P                  ! WVRR7      pVP
                  w  rgVP                  ^R7      pVP                  P                  V^ 3Wf3R7      P                  4       p	W•,
          p
VP                  RR7      ;_uu_ 4        RVP                  V4      ,          pRRR4       ^ XVP                  V4      &   VP                  P                  V^ 3Wf3R7      P                  4       pWÊV,          ,          #   + '       g   i     La; i)	uº  Returns the normalized Laplacian matrix of G.

The normalized graph Laplacian is the matrix

.. math::

    N = D^{-1/2} L D^{-1/2}

where `L` is the graph Laplacian and `D` is the diagonal matrix of
node degrees [1]_.

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

nodelist : list, optional
   The rows and columns are ordered according to the nodes in nodelist.
   If nodelist is None, then the ordering is produced by G.nodes().

weight : string or None, optional (default='weight')
   The edge data key used to compute each value in the matrix.
   If None, then each edge has weight 1.

Returns
-------
N : SciPy sparse array
  The normalized Laplacian matrix of G.

Notes
-----
For MultiGraph, the edges weights are summed.
See :func:`to_numpy_array` for other options.

If the Graph contains selfloops, D is defined as ``diag(sum(A, 1))``, where A is
the adjacency matrix [2]_.

This calculation uses the out-degree of the graph `G`. To use the
in-degree for calculations instead, use `G.reverse(copy=False)` and
take the transpose.

For an unnormalized output, use `laplacian_matrix`.

Examples
--------

>>> import numpy as np
>>> edges = [
...     (1, 2),
...     (2, 1),
...     (2, 4),
...     (4, 3),
...     (3, 4),
... ]
>>> DiG = nx.DiGraph(edges)
>>> print(nx.normalized_laplacian_matrix(DiG).toarray())
[[ 1.         -0.70710678  0.          0.        ]
 [-0.70710678  1.         -0.70710678  0.        ]
 [ 0.          0.          1.         -1.        ]
 [ 0.          0.         -1.          1.        ]]

Notice that node 4 is represented by the third column and row. This is because
by default the row/column order is the order of `G.nodes` (i.e. the node added
order -- in the edgelist, 4 first appears in (2, 4), before node 3 in edge (4, 3).)
To control the node order of the matrix, use the `nodelist` argument.

>>> print(nx.normalized_laplacian_matrix(DiG, nodelist=[1, 2, 3, 4]).toarray())
[[ 1.         -0.70710678  0.          0.        ]
 [-0.70710678  1.          0.         -0.70710678]
 [ 0.          0.          1.         -1.        ]
 [ 0.          0.         -1.          1.        ]]
>>> G = nx.Graph(edges)
>>> print(nx.normalized_laplacian_matrix(G).toarray())
[[ 1.         -0.70710678  0.          0.        ]
 [-0.70710678  1.         -0.5         0.        ]
 [ 0.         -0.5         1.         -0.70710678]
 [ 0.          0.         -0.70710678  1.        ]]

See Also
--------
laplacian_matrix
normalized_laplacian_spectrum
directed_laplacian_matrix
directed_combinatorial_laplacian_matrix

References
----------
.. [1] Fan Chung-Graham, Spectral Graph Theory,
   CBMS Regional Conference Series in Mathematics, Number 92, 1997.
.. [2] Steve Butler, Interlacing For Weighted Graphs Using The Normalized
   Laplacian, Electronic Journal of Linear Algebra, Volume 16, pp. 90-98,
   March 2007.
.. [3] Langville, Amy N., and Carl D. Meyer. Googleâ€™s PageRank and Beyond:
   The Science of Search Engine Rankings. Princeton University Press, 2006.
Nr   r   r
   r   Úignore©Údivideç      ð?)Únumpyr   r   r   r   r   r   r   r   r   ÚerrstateÚsqrtÚisinf)r   r   r   Únpr   r   r   Ú_Údiagsr   ÚLÚ
diags_sqrtÚDHs   &&&          r   Únormalized_laplacian_matrixr.   …   sï   € óB ÛàÒÜ˜“7ˆÜ
× Ò  ¸fÈUÔS€AØ�7‰7�D€AØ�E‰E�qˆE‹M€EØ
�	‰	×Ñ˜U A˜J¨q¨fÐÓ5×;Ñ;Ó=€AØ	�€AØ	�‰˜Hˆ×	%Õ	%Ø˜2Ÿ7™7 5›>Õ)ˆ
÷ 
&à'(€Jˆr�x‰x˜
Ó#Ñ$Ø	�‰×	Ñ	˜j¨!˜_°Q°FÐ	Ó	;×	AÑ	AÓ	C€BØ�R•�=Ð÷	 
&×	%ús   Â!DÄD#	Ú
multigraphÚ
undirectedr   Ú
normalizedFÚqg      Ð?c               óþ  € ^ RI Hp ^ RIp^ RIpVf   \	        V 4      p\        V4      p\        V4       U	U
u/ uF  w  ršW©bK	  	  pp	p
^ Tu;8:  d   R8:  g   M \        R4      h^VP                  ,          V,          pV! \        4      pV! \        4      p^VP                  RV,          4      RVP                  RV,          4      ^ ^/pV P                  V^R7       F‘  w  pp
pVV9  g   W«9  d   K  VV,          Wº,          ppVVV3;;,          ^,          uu&   VVV3;;,          ^,          uu&   VVV3;;,          RV,          ,          uu&   VVV3;;,          RV,          ,          uu&   K“  	  . . . pppV P                  4        EF"  w  pp
VV9  g   W«9  d   K  VV,          Wº,          ppVV8w  g   K0  VVV3,          ^ 8X  d?   VP                  V4       VP                  V4       VP                  VVV3,          4       K~  VP                  V4       VP                  V4       VP                  VVV3,          WýVV3,          ,          ,          4       VP                  V4       VP                  V4       VP                  VVV3,          WýVV3,          ,          ,          4       EK%  	  VP                  P                  VVV33Wˆ3\         R7      pVP#                  V4      P%                  ^R7      P'                  4       pV'       dŸ   VP)                  R	R
7      ;_uu_ 4        RVP+                  V4      ,          pRRR4       ^ XVP-                  V4      &   VP                  P/                  V^ 3Wˆ3R7      P1                  4       pVVV,          ,          pVP3                  V4      pVP                  P/                  V^ 3Wˆ3\         R7      P1                  4       pVV,
          # u up
p	i   + '       g   i     Lµ; i)uÁ	  Returns the magnetic Laplacian matrix of DiGraph G.

The magnetic Laplacian matrix (also called the q-magnetic Laplacian) is a
Hermitian matrix for directed graphs that encodes edge directionality
via complex phases [1]_.

Given a weighted directed graph, :math:`G = (V, E, W)`, with :math:`W`
the weighted adjacency matrix, the symmetrized weighted adjacency
matrix is defined as :math:`W' = 0.5 (W + W^{T})`. A skew-symmetric term
:math:`\delta` is introduced to encode directionality, where

..math::
    \delta_{jk} = \begin{cases}
        +1 & \text{if} j \to k \text{ is an edge and } k \to j \text{ is not}, \\
        -1 & \text{if} k \to j \text{ is an edge and } j \to k \text{ is not}, \\
        0 & \text{if both or neither edge is present.}
        \end{cases}

Then, the magnetic Laplacian matrix is defined as:

.. math::
    L^{(q)} := D - H^{(q)}

where :math:`H^{(q)}` is the Hermitian adjacency matrix with entries
:math:`H^{(q)}_{jk} = W'_{jk} e^{2\pi i q \delta_{jk}}`, and :math:`D` is the
degree matrix associated with the symmetrized weight adjacency matrix :math:`W'`.

If `normalized` is True, compute the normalized version using the Moore-Penrose
inverse :math:`D^{+}}` of the degree matrix :math:`D`. The normalized formula
is then:

.. math::
    L^{(q)}_{norm} = (D^{+})^{0.5} L^{(q)} (D^{+})^{0.5}

Parameters
----------
G : DiGraph
    A directed graph

nodelist : list, optional (default=list(G))
    Node ordering for row/columns.

normalized : bool, optional (default=False)
    Bool that encodes if return the magnetic Laplacian or the normalized magnetic
    Laplacian. If True returns the normalized version.

q : float, optional (default=0.25)
    The phase of the magnetic potential is the charge parameter 0 <= q <= 0.5.
    At q=0 returns the standard Laplacian.

weight : string or None, optional (default='weight')
    Edge attribute key for weights. If None, all edges have weight 1.

Returns
-------
L : SciPy sparse array (complex dtype)
    The magnetic Laplacian matrix of `G` if not `normalized`
    and the normalized version if `normalized`

Raises
------
ValueError
    If q is not between 0 and 0.5

NetworkXNotImplemented
    If `G` is undirected or a multigraph

References
----------
.. [1] Fanuel, M., AlaÃ­z, C. M., FernÃ¡ndez, Ã�., & Suykens, J. A. (2018).
   Magnetic eigenmaps for the visualization of directed graphs.
   Applied and Computational Harmonic Analysis, 44(1), 189â€“199.
   <https://doi.org/10.1016/j.acha.2017.01.004>
)ÚdefaultdictNg      à?z-Parameter q must be a value between 0 and 0.5y              ð?)ÚdataÚdefault)r   Údtyper
   r    r!   r#   r   éÿÿÿÿy       €      ð¿)Úcollectionsr4   r$   r   r   ÚlenÚ	enumerateÚ
ValueErrorÚpiÚintÚfloatÚexpÚedgesÚappendr   Ú	csr_arrayÚcomplexÚabsr   Úravelr%   r&   r'   r   r   Úones)r   r   r1   r2   r   r4   r(   r   r   ÚiÚvÚ
node_indexÚphaseÚdelta_phase_edgeÚmatrix_weightsÚphasesÚuÚwtÚuiÚviÚrowsÚcolsr5   ÚHr*   r,   r-   r   s   &$$$$                       r   Úmagnetic_laplacian_matrixrV   ÷   s_  € õ` (ãÛàÒÜ˜“7ˆô 	ˆH‹€AÜ#,¨XÔ#6Ô7Ñ#6™4˜1�!’$Ñ#6€JÑ7à�ŽM�cŽMÜÐHÓIÐIà�—‘�I˜�M€Eñ #¤3Ó'ÐÙ ¤Ó'€Nà�—‘˜˜U�
Ó# R¨¯©°°eµÓ)<¸aÀÐC€Fà—G‘G °�GÖ3‰ˆˆ1ˆbØ�JÔ !Ô"5Ùà˜A• 
¥ˆBˆØ˜"˜b˜×" aÕ'Ó"Ø˜"˜b˜×" aÕ'Ó"Ø˜˜B�x×  C¨"¥HÕ,Ó Ø˜˜B�x×  C¨"¥HÕ,Õ ñ 4ð ˜2˜r�ˆ$€DØ—‘—	‰ˆˆ1Ø�JÔ !Ô"5Ùà˜A• 
¥ˆBˆØ�Ž8Ø  R Õ)¨QÔ.Ø—‘˜B”Ø—‘˜B”Ø—‘˜N¨B°¨8Õ4Ö5à—‘˜B”Ø—‘˜B”Ø—‘Ø" B¨ 8Õ,¨vÈÈBÀxÕ6PÕ/QÕQôð —‘˜B”Ø—‘˜B”Ø—‘Ø" B¨ 8Õ,¨vÈÈBÀxÕ6PÕ/QÕQ÷ñ% ð, 	�	‰	×Ñ˜T D¨$ <Ð0¸¸ÄgÐÓN€Að �F‰F�1‹I�M‰M˜qˆMÓ!×'Ñ'Ó)€EçØ�[‰[ ˆ[×)Õ)Ø˜rŸw™w u›~Õ-ˆJ÷ *à+,ˆ
�2—8‘8˜JÓ'Ñ(Ø�Y‰Y× Ñ  *¨a ¸¸Ð Ó?×EÑEÓGˆØ�!�b•&�MˆØ—‘Øó
ˆð 	�	‰	×Ñ˜U A˜J¨q¨f¼GÐÓD×JÑJÓL€Aàˆq�5€LùóA 8÷j *×)ús   ·O&Ì&O,Ï,O<	c                ó¢  € ^ RI p^ RIp\        WW#VR7      pVP                  w  r‰VP                  P
                  P                  VP                  ^R7      w  r«VP                  4       P                  pWÌP                  4       ,          pVP                  VP                  V4      4      pVP                  P                  V^ 3Wˆ3R7      P                  4       V,          VP                  P                  RV,          ^ 3Wˆ3R7      P                  4       ,          pVP                  \!        V 4      4      pVWÿP                  ,           R,          ,
          # )až  Returns the directed Laplacian matrix of G.

The graph directed Laplacian is the matrix

.. math::

    L = I - \frac{1}{2} \left (\Phi^{1/2} P \Phi^{-1/2} + \Phi^{-1/2} P^T \Phi^{1/2} \right )

where `I` is the identity matrix, `P` is the transition matrix of the
graph, and `\Phi` a matrix with the Perron vector of `P` in the diagonal and
zeros elsewhere [1]_.

Depending on the value of walk_type, `P` can be the transition matrix
induced by a random walk, a lazy random walk, or a random walk with
teleportation (PageRank).

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

nodelist : list, optional
   The rows and columns are ordered according to the nodes in nodelist.
   If nodelist is None, then the ordering is produced by G.nodes().

weight : string or None, optional (default='weight')
   The edge data key used to compute each value in the matrix.
   If None, then each edge has weight 1.

walk_type : string or None, optional (default=None)
   One of ``"random"``, ``"lazy"``, or ``"pagerank"``. If ``walk_type=None``
   (the default), then a value is selected according to the properties of `G`:
   - ``walk_type="random"`` if `G` is strongly connected and aperiodic
   - ``walk_type="lazy"`` if `G` is strongly connected but not aperiodic
   - ``walk_type="pagerank"`` for all other cases.

alpha : real
   (1 - alpha) is the teleportation probability used with pagerank

Returns
-------
L : NumPy matrix
  Normalized Laplacian of G.

Notes
-----
Only implemented for DiGraphs

The result is always a symmetric matrix.

This calculation uses the out-degree of the graph `G`. To use the
in-degree for calculations instead, use `G.reverse(copy=False)` and
take the transpose.

See Also
--------
laplacian_matrix
normalized_laplacian_matrix
directed_combinatorial_laplacian_matrix

References
----------
.. [1] Fan Chung (2005).
   Laplacians and the Cheeger inequality for directed graphs.
   Annals of Combinatorics, 9(1), 2005
N©r   r   Ú	walk_typeÚalpha©Úkr   r#   ç       @)r$   r   Ú_transition_matrixr   r   ÚlinalgÚeigsÚTÚflattenÚrealr   r&   rE   r   r   Úidentityr:   )r   r   r   rY   rZ   r(   r   ÚPr   r   ÚevalsÚevecsrI   ÚpÚsqrtpÚQÚIs   &&&&&            r   Údirected_laplacian_matrixrl   ˜  s  € óP Ûô 	Ø	 VÈô	€Að �7‰7�D€Aà—9‘9×#Ñ#×(Ñ(¨¯©°Ð(Ó2�L€EØ�‰‹×Ñ€AØ	�E‰E‹G�€Aà�G‰G�B—F‘F˜1“IÓ€Eà
�	‰	×Ñ˜U A˜J¨q¨fÐÓ5×;Ñ;Ó=Ø
õ	à
�)‰)×
Ñ
˜s U�{¨AÐ.°q°fÐ
Ó
=×
CÑ
CÓ
Eõ	Fð ð 	�‰”C˜“FÓ€Aà�—C‘C•˜3�ÕÐr   c                óÀ  € ^ RI p\        WW#VR7      pVP                  w  rxVP                  P                  P                  VP                  ^R7      w  ršV
P                  4       P                  pW»P                  4       ,          pVP                  P                  V^ 3Ww3R7      P                  4       pWÝV,          VP                  V,          ,           R,          ,
          # )at  Return the directed combinatorial Laplacian matrix of G.

The graph directed combinatorial Laplacian is the matrix

.. math::

    L = \Phi - \frac{1}{2} \left (\Phi P + P^T \Phi \right)

where `P` is the transition matrix of the graph and `\Phi` a matrix
with the Perron vector of `P` in the diagonal and zeros elsewhere [1]_.

Depending on the value of walk_type, `P` can be the transition matrix
induced by a random walk, a lazy random walk, or a random walk with
teleportation (PageRank).

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

nodelist : list, optional
   The rows and columns are ordered according to the nodes in nodelist.
   If nodelist is None, then the ordering is produced by G.nodes().

weight : string or None, optional (default='weight')
   The edge data key used to compute each value in the matrix.
   If None, then each edge has weight 1.

walk_type : string or None, optional (default=None)
    One of ``"random"``, ``"lazy"``, or ``"pagerank"``. If ``walk_type=None``
    (the default), then a value is selected according to the properties of `G`:
    - ``walk_type="random"`` if `G` is strongly connected and aperiodic
    - ``walk_type="lazy"`` if `G` is strongly connected but not aperiodic
    - ``walk_type="pagerank"`` for all other cases.

alpha : real
   (1 - alpha) is the teleportation probability used with pagerank

Returns
-------
L : NumPy matrix
  Combinatorial Laplacian of G.

Notes
-----
Only implemented for DiGraphs

The result is always a symmetric matrix.

This calculation uses the out-degree of the graph `G`. To use the
in-degree for calculations instead, use `G.reverse(copy=False)` and
take the transpose.

See Also
--------
laplacian_matrix
normalized_laplacian_matrix
directed_laplacian_matrix

References
----------
.. [1] Fan Chung (2005).
   Laplacians and the Cheeger inequality for directed graphs.
   Annals of Combinatorics, 9(1), 2005
NrX   r[   r   r]   )r   r^   r   r   r_   r`   ra   rb   rc   r   r   Útoarray)r   r   r   rY   rZ   r   re   r   r   rf   rg   rI   rh   ÚPhis   &&&&&         r   Ú'directed_combinatorial_laplacian_matrixrp   ú  s°   € óN äØ	 VÈô	€Að �7‰7�D€Aà—9‘9×#Ñ#×(Ñ(¨¯©°Ð(Ó2�L€EØ�‰‹×Ñ€AØ	�E‰E‹G�€Aà
�)‰)×
Ñ
˜q !˜f¨Q¨FÐ
Ó
3×
;Ñ
;Ó
=€Cà˜•'˜AŸC™C #�IÕ%¨Õ,Õ,Ð,r   c                ó¦  € ^ RI p^ RIpVfA   \        P                  ! V 4      '       d#   \        P                  ! V 4      '       d   RpMRpMRp\        P
                  ! WV\        R7      pVP                  w  r‰VR9   d�   VP                  P                  RVP                  ^R7      ,          ^ 3Wˆ3R7      P                  4       p
VR8X  d   W§,          pV# VP                  P                  VR	R
7      pWÊV,          ,           R,          p V# VR8X  d¬   ^ Tu;8  d   ^8  g   M \        P                  ! R4      hVP                  4       p^V,          WwP                  ^R7      ^ 8H  R3&   WwP                  ^R7      VP                  R3,          P                   ,          pWG,          ^V,
          V,          ,           pV# \        P                  ! R4      h)a*  Returns the transition matrix of G.

This is a row stochastic giving the transition probabilities while
performing a random walk on the graph. Depending on the value of walk_type,
P can be the transition matrix induced by a random walk, a lazy random walk,
or a random walk with teleportation (PageRank).

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

nodelist : list, optional
   The rows and columns are ordered according to the nodes in nodelist.
   If nodelist is None, then the ordering is produced by G.nodes().

weight : string or None, optional (default='weight')
   The edge data key used to compute each value in the matrix.
   If None, then each edge has weight 1.

walk_type : string or None, optional (default=None)
   One of ``"random"``, ``"lazy"``, or ``"pagerank"``. If ``walk_type=None``
   (the default), then a value is selected according to the properties of `G`:
    - ``walk_type="random"`` if `G` is strongly connected and aperiodic
    - ``walk_type="lazy"`` if `G` is strongly connected but not aperiodic
    - ``walk_type="pagerank"`` for all other cases.

alpha : real
   (1 - alpha) is the teleportation probability used with pagerank

Returns
-------
P : numpy.ndarray
  transition matrix of G.

Raises
------
NetworkXError
    If walk_type not specified or alpha not in valid range
NÚrandomÚlazyÚpagerank)r   r   r7   r#   r
   r   r   )r	   r]   zalpha must be between 0 and 1:NNNz+walk_type must be random, lazy, or pagerank)rr   rs   )r$   r   r   Úis_strongly_connectedÚis_aperiodicr   r?   r   r   r   r   r   Ú	eye_arrayÚNetworkXErrorrn   Únewaxisra   )r   r   r   rY   rZ   r(   r   r   r   r   ÚDIre   rk   s   &&&&&        r   r^   r^   R  sŽ  € óR ÛàÒÜ×#Ò# A×&Ò&Ü�Š˜q×!Ò!Ø$‘	à"‘	à"ˆIä
× Ò  ¸fÌEÔR€AØ�7‰7�D€AØÐ&Ô&Ø�Y‰Y× Ñ  #¨¯©°1¨«Õ"5°qÐ!9À!ÀÐ ÓH×NÑNÓPˆØ˜Ô Ø•ˆAð$ €Hð! —	‘	×#Ñ# A¨eÐ#Ó4ˆAØ˜!•V•˜sÕ"‰Að €Hð 
�jÔ	 Ø�E–˜A–Ü×"Ò"Ð#BÓCÐCà�I‰I‹Kˆà#$ q¥5ˆ�%‰%�Qˆ%‹-˜1Ñ
˜aÐ
Ñ à—‘˜1�“˜bŸj™j¨!˜mÕ,×.Ñ.Õ.ˆØ�I˜˜U� a�Õ'ˆð €Hô ×ÒÐLÓMÐMr   )r   r.   rl   rp   rV   )Nr   )Nr   Ngffffffî?)Ú__doc__Únetworkxr   Únetworkx.utilsr   Ú__all__Ú_dispatchabler   r.   rV   rl   rp   r^   © r   r   Ú<module>r�      s;  ðñó Ý .ò€ð ×Ò˜XÔ&ójó 'ðjðZ ×Ò˜XÔ&ónó 'ðnñb �\Ó"Ù�\Ó"Ø×Ò˜XÔ&ðWØðWØ$)ðWØ-1ðWØ:BóWó 'ó #ó #ðWñ| �\Ó"Ù�\Ó"Ø×Ò˜XÔ&ó\ó 'ó #ó #ð\ñ~ �\Ó"Ù�\Ó"Ø×Ò˜XÔ&óR-ó 'ó #ó #ðR-öjLr   