code: def has_constraint_violation(A, right_eigenvectors, epsilon=1E-8):
      
  
      lhs = 1 - A[0, 1:].sum()
      rhs = dot(right_eigenvectors[:, 1:], A[1:, 0])
      rhs = -1 * rhs.min()
  
      if abs(lhs - rhs) > epsilon:
          return True
      else:
          return False
docs: Check for constraint violations in transformation matrix.
  
      Parameters
      ----------
      A : ndarray
          The transformation matrix.
      right_eigenvectors : ndarray
          The right eigenvectors.
      epsilon : float, optional
          Tolerance of constraint violation.
  
      Returns
      -------
      truth : bool
          Whether or not the violation exists
  
  
      Notes
      -------
      Checks constraints using Eqn 4.25 in [1].
  
  
      References
      ----------
      .. [1]  Deuflhard P, Weber, M.,  "Robust perron cluster analysis in
       conformation dynamics,"
      Linear Algebra Appl., vol 398 pp 161-184 2005.