pub struct IncrementalPageRank { /* private fields */ }Expand description
Stateful incremental PageRank engine bound to a mutable graph.
Implementations§
Source§impl IncrementalPageRank
impl IncrementalPageRank
Sourcepub fn new(
graph: DynamicGraph,
damping: f64,
max_iter: usize,
tol: f64,
) -> GraphalgResult<Self>
pub fn new( graph: DynamicGraph, damping: f64, max_iter: usize, tol: f64, ) -> GraphalgResult<Self>
Create an engine over graph and converge an initial cold-start solve.
damping— the teleport-complementd ∈ [0, 1](typically0.85).max_iter— power-iteration cap per (re)solve.tol— L1 convergence tolerance between successive iterates.
Sourcepub fn rank_of(&self, v: usize) -> GraphalgResult<f64>
pub fn rank_of(&self, v: usize) -> GraphalgResult<f64>
PageRank of a single vertex.
Sourcepub fn last_iterations(&self) -> usize
pub fn last_iterations(&self) -> usize
Iterations consumed by the most recent (re)solve — strictly informational, useful for demonstrating the warm-start speed-up in tests/benchmarks.
Sourcepub fn graph(&self) -> &DynamicGraph
pub fn graph(&self) -> &DynamicGraph
Borrow the underlying graph.
Sourcepub fn apply_insert(&mut self, u: usize, v: usize) -> GraphalgResult<()>
pub fn apply_insert(&mut self, u: usize, v: usize) -> GraphalgResult<()>
Insert a directed edge and re-converge from the warm start.
Sourcepub fn apply_remove(&mut self, u: usize, v: usize) -> GraphalgResult<()>
pub fn apply_remove(&mut self, u: usize, v: usize) -> GraphalgResult<()>
Remove a directed edge and re-converge from the warm start.
Sourcepub fn apply_batch(
&mut self,
updates: &[(usize, usize, bool)],
) -> GraphalgResult<()>
pub fn apply_batch( &mut self, updates: &[(usize, usize, bool)], ) -> GraphalgResult<()>
Apply a batch of (u, v, is_insert) mutations atomically, re-converging
once at the end (cheaper than re-solving per edge).
Trait Implementations§
Source§impl Clone for IncrementalPageRank
impl Clone for IncrementalPageRank
Source§fn clone(&self) -> IncrementalPageRank
fn clone(&self) -> IncrementalPageRank
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for IncrementalPageRank
impl RefUnwindSafe for IncrementalPageRank
impl Send for IncrementalPageRank
impl Sync for IncrementalPageRank
impl Unpin for IncrementalPageRank
impl UnsafeUnpin for IncrementalPageRank
impl UnwindSafe for IncrementalPageRank
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more