Trait StreamingAlgorithm

Source
pub trait StreamingAlgorithm<T> {
    // Required methods
    fn initialize(
        &mut self,
        processor: &IncrementalGraphProcessor,
    ) -> Result<()>;
    fn update(
        &mut self,
        processor: &IncrementalGraphProcessor,
        changes: &UpdateResult,
    ) -> Result<()>;
    fn get_result(&self) -> &T;
    fn recompute(&mut self, processor: &IncrementalGraphProcessor) -> Result<()>;
    fn needs_recomputation(&self, changes: &UpdateResult) -> bool;
}
Expand description

Streaming algorithms that can update incrementally as the graph changes These algorithms maintain state and update efficiently rather than recomputing from scratch

Required Methods§

Source

fn initialize(&mut self, processor: &IncrementalGraphProcessor) -> Result<()>

Initialize the algorithm with the current graph state

Source

fn update( &mut self, processor: &IncrementalGraphProcessor, changes: &UpdateResult, ) -> Result<()>

Update the algorithm state based on graph changes

Source

fn get_result(&self) -> &T

Get the current result/state of the algorithm

Source

fn recompute(&mut self, processor: &IncrementalGraphProcessor) -> Result<()>

Force a full recomputation (fallback when incremental update is not sufficient)

Source

fn needs_recomputation(&self, changes: &UpdateResult) -> bool

Check if the algorithm needs full recomputation

Implementors§