pub trait ParallelGraphAlgorithm: GraphAlgorithm {
// Required method
fn execute_parallel(
&self,
store: &LpgStore,
params: &Parameters,
num_threads: usize,
) -> Result<AlgorithmResult>;
// Provided method
fn parallel_threshold(&self) -> usize { ... }
}Expand description
A graph algorithm that supports parallel execution.
Algorithms implementing this trait can automatically switch between sequential and parallel execution based on graph size.
Required Methods§
Sourcefn execute_parallel(
&self,
store: &LpgStore,
params: &Parameters,
num_threads: usize,
) -> Result<AlgorithmResult>
fn execute_parallel( &self, store: &LpgStore, params: &Parameters, num_threads: usize, ) -> Result<AlgorithmResult>
Executes the algorithm with explicit parallelism control.
Provided Methods§
Sourcefn parallel_threshold(&self) -> usize
fn parallel_threshold(&self) -> usize
Minimum node count to trigger parallelization.
Below this threshold, sequential execution is used to avoid parallelization overhead.