Skip to main content

SparseLaplacianSolver

Trait SparseLaplacianSolver 

Source
pub trait SparseLaplacianSolver: SolverEngine {
    // Required methods
    fn solve_laplacian(
        &self,
        laplacian: &CsrMatrix<f64>,
        rhs: &[f64],
        budget: &ComputeBudget,
    ) -> Result<SolverResult, SolverError>;
    fn effective_resistance(
        &self,
        laplacian: &CsrMatrix<f64>,
        source: usize,
        target: usize,
        budget: &ComputeBudget,
    ) -> Result<f64, SolverError>;
}
Expand description

Extended trait for solvers that operate on graph Laplacian systems.

A graph Laplacian L = D - A arises naturally in spectral graph theory. Solvers implementing this trait can exploit Laplacian structure (e.g. guaranteed positive semi-definiteness, kernel spanned by the all-ones vector) for faster convergence.

Required Methods§

Source

fn solve_laplacian( &self, laplacian: &CsrMatrix<f64>, rhs: &[f64], budget: &ComputeBudget, ) -> Result<SolverResult, SolverError>

Solve L x = b where L is a graph Laplacian.

The solver may add a small regulariser to handle the rank-deficient case (connected component with zero eigenvalue).

§Errors

Returns SolverError on failure.

Source

fn effective_resistance( &self, laplacian: &CsrMatrix<f64>, source: usize, target: usize, budget: &ComputeBudget, ) -> Result<f64, SolverError>

Compute the effective resistance between two nodes.

Effective resistance R(s, t) = (e_s - e_t)^T L^+ (e_s - e_t) is a fundamental quantity in spectral graph theory.

Implementors§