code: def directed_combinatorial_laplacian_matrix(
      G, nodelist=None, weight="weight", walk_type=None, alpha=0.95
  ):
      r"""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)` instead.
  
      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
      """
      import scipy as sp
  
      P = _transition_matrix(
          G,
          nodelist=nodelist,
          weight=weight,
          walk_type=walk_type,
          alpha=alpha,
      )
  
      n, m = P.shape
  
      evals, evecs = sp.sparse.linalg.eigs(P.T, k=1)
      v = evecs.flatten().real
      p = v / v.sum()
      # NOTE: could be improved by not densifying
      # TODO: Rm csr_array wrapper when spdiags array creation becomes available
      Phi = sp.sparse.csr_array(sp.sparse.spdiags(p, 0, n, n)).toarray()
  
      return Phi - (Phi @ P + P.T @ Phi) / 2.0
  
file_path: networkx/networkx/linalg/laplacianmatrix.py
imports: import networkx
  from networkx.utils import not_implemented_for
label_desc: Use image node_id 5 for calling a global function with example usage: directed_combinatorial_laplacian_matrix(G, nodelist, weight, walk_type, alpha) and returns: unknown