pub struct PageRank { /* private fields */ }Expand description
PageRank centrality kernel.
Calculates PageRank centrality using power iteration with teleportation. This is a Ring kernel for low-latency queries after graph is loaded.
Implementations§
Source§impl PageRank
impl PageRank
Sourcepub fn initialize(&self, graph: CsrGraph, damping: f32)
pub fn initialize(&self, graph: CsrGraph, damping: f32)
Initialize the kernel with a graph for Ring mode operations.
Sourcepub fn query_score(&self, node_id: u64) -> Option<f64>
pub fn query_score(&self, node_id: u64) -> Option<f64>
Query the score for a specific node.
Sourcepub fn current_iteration(&self) -> u32
pub fn current_iteration(&self) -> u32
Get current iteration count.
Sourcepub fn is_converged(&self) -> bool
pub fn is_converged(&self) -> bool
Check if converged.
Sourcepub fn iterate_step(state: &mut PageRankState) -> f64
pub fn iterate_step(state: &mut PageRankState) -> f64
Perform one iteration of PageRank on the given state.
Sourcepub fn initialize_state(graph: CsrGraph, damping: f32) -> PageRankState
pub fn initialize_state(graph: CsrGraph, damping: f32) -> PageRankState
Initialize state for a graph.
Sourcepub fn run_to_convergence(
graph: CsrGraph,
damping: f32,
max_iterations: u32,
threshold: f64,
) -> Result<CentralityResult>
pub fn run_to_convergence( graph: CsrGraph, damping: f32, max_iterations: u32, threshold: f64, ) -> Result<CentralityResult>
Run PageRank to convergence.
Source§impl PageRank
PageRank can be used in both batch and ring modes.
This is the batch mode implementation.
impl PageRank
PageRank can be used in both batch and ring modes. This is the batch mode implementation.
Sourcepub async fn compute_batch(
&self,
graph: CsrGraph,
damping: f32,
max_iterations: u32,
threshold: f64,
) -> Result<CentralityResult>
pub async fn compute_batch( &self, graph: CsrGraph, damping: f32, max_iterations: u32, threshold: f64, ) -> Result<CentralityResult>
Execute PageRank as a batch operation.
Convenience method that runs the algorithm to convergence.
Trait Implementations§
Source§impl BatchKernel<CentralityInput, CentralityOutput> for PageRank
impl BatchKernel<CentralityInput, CentralityOutput> for PageRank
Source§fn execute<'life0, 'async_trait>(
&'life0 self,
input: CentralityInput,
) -> Pin<Box<dyn Future<Output = Result<CentralityOutput>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn execute<'life0, 'async_trait>(
&'life0 self,
input: CentralityInput,
) -> Pin<Box<dyn Future<Output = Result<CentralityOutput>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn validate_input(&self, _input: &I) -> Result<(), KernelError>
fn validate_input(&self, _input: &I) -> Result<(), KernelError>
Source§impl GpuKernel for PageRank
impl GpuKernel for PageRank
Source§fn metadata(&self) -> &KernelMetadata
fn metadata(&self) -> &KernelMetadata
Source§fn requires_gpu_native(&self) -> bool
fn requires_gpu_native(&self) -> bool
Source§impl RingKernelHandler<K2KBarrier, K2KBarrierRelease> for PageRank
RingKernelHandler for K2K barrier synchronization.
impl RingKernelHandler<K2KBarrier, K2KBarrierRelease> for PageRank
RingKernelHandler for K2K barrier synchronization.
Implements barrier synchronization for distributed PageRank iterations.
Source§fn handle<'life0, 'life1, 'async_trait>(
&'life0 self,
_ctx: &'life1 mut RingContext<'_>,
msg: K2KBarrier,
) -> Pin<Box<dyn Future<Output = Result<K2KBarrierRelease>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn handle<'life0, 'life1, 'async_trait>(
&'life0 self,
_ctx: &'life1 mut RingContext<'_>,
msg: K2KBarrier,
) -> Pin<Box<dyn Future<Output = Result<K2KBarrierRelease>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn initialize<'life0, 'life1, 'async_trait>(
&'life0 self,
_ctx: &'life1 mut RingContext<'_>,
) -> Pin<Box<dyn Future<Output = Result<(), KernelError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: Sync + 'async_trait,
fn initialize<'life0, 'life1, 'async_trait>(
&'life0 self,
_ctx: &'life1 mut RingContext<'_>,
) -> Pin<Box<dyn Future<Output = Result<(), KernelError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: Sync + 'async_trait,
Source§fn shutdown<'life0, 'life1, 'async_trait>(
&'life0 self,
_ctx: &'life1 mut RingContext<'_>,
) -> Pin<Box<dyn Future<Output = Result<(), KernelError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: Sync + 'async_trait,
fn shutdown<'life0, 'life1, 'async_trait>(
&'life0 self,
_ctx: &'life1 mut RingContext<'_>,
) -> Pin<Box<dyn Future<Output = Result<(), KernelError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: Sync + 'async_trait,
Source§impl RingKernelHandler<K2KIterationSync, K2KIterationSyncResponse> for PageRank
RingKernelHandler for K2K iteration synchronization.
impl RingKernelHandler<K2KIterationSync, K2KIterationSyncResponse> for PageRank
RingKernelHandler for K2K iteration synchronization.
Used in distributed PageRank to synchronize iterations across partitions. In a single-instance setting, this validates the worker’s iteration state and returns convergence status based on the reported delta.
Source§fn handle<'life0, 'life1, 'async_trait>(
&'life0 self,
_ctx: &'life1 mut RingContext<'_>,
msg: K2KIterationSync,
) -> Pin<Box<dyn Future<Output = Result<K2KIterationSyncResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn handle<'life0, 'life1, 'async_trait>(
&'life0 self,
_ctx: &'life1 mut RingContext<'_>,
msg: K2KIterationSync,
) -> Pin<Box<dyn Future<Output = Result<K2KIterationSyncResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn initialize<'life0, 'life1, 'async_trait>(
&'life0 self,
_ctx: &'life1 mut RingContext<'_>,
) -> Pin<Box<dyn Future<Output = Result<(), KernelError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: Sync + 'async_trait,
fn initialize<'life0, 'life1, 'async_trait>(
&'life0 self,
_ctx: &'life1 mut RingContext<'_>,
) -> Pin<Box<dyn Future<Output = Result<(), KernelError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: Sync + 'async_trait,
Source§fn shutdown<'life0, 'life1, 'async_trait>(
&'life0 self,
_ctx: &'life1 mut RingContext<'_>,
) -> Pin<Box<dyn Future<Output = Result<(), KernelError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: Sync + 'async_trait,
fn shutdown<'life0, 'life1, 'async_trait>(
&'life0 self,
_ctx: &'life1 mut RingContext<'_>,
) -> Pin<Box<dyn Future<Output = Result<(), KernelError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: Sync + 'async_trait,
Source§impl RingKernelHandler<PageRankConvergeRing, PageRankConvergeResponse> for PageRank
RingKernelHandler for PageRank convergence.
impl RingKernelHandler<PageRankConvergeRing, PageRankConvergeResponse> for PageRank
RingKernelHandler for PageRank convergence.
Runs PageRank to convergence using K2K coordination for iterative state.
Source§fn handle<'life0, 'life1, 'async_trait>(
&'life0 self,
_ctx: &'life1 mut RingContext<'_>,
msg: PageRankConvergeRing,
) -> Pin<Box<dyn Future<Output = Result<PageRankConvergeResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn handle<'life0, 'life1, 'async_trait>(
&'life0 self,
_ctx: &'life1 mut RingContext<'_>,
msg: PageRankConvergeRing,
) -> Pin<Box<dyn Future<Output = Result<PageRankConvergeResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn initialize<'life0, 'life1, 'async_trait>(
&'life0 self,
_ctx: &'life1 mut RingContext<'_>,
) -> Pin<Box<dyn Future<Output = Result<(), KernelError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: Sync + 'async_trait,
fn initialize<'life0, 'life1, 'async_trait>(
&'life0 self,
_ctx: &'life1 mut RingContext<'_>,
) -> Pin<Box<dyn Future<Output = Result<(), KernelError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: Sync + 'async_trait,
Source§fn shutdown<'life0, 'life1, 'async_trait>(
&'life0 self,
_ctx: &'life1 mut RingContext<'_>,
) -> Pin<Box<dyn Future<Output = Result<(), KernelError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: Sync + 'async_trait,
fn shutdown<'life0, 'life1, 'async_trait>(
&'life0 self,
_ctx: &'life1 mut RingContext<'_>,
) -> Pin<Box<dyn Future<Output = Result<(), KernelError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: Sync + 'async_trait,
Source§impl RingKernelHandler<PageRankIterateRing, PageRankIterateResponse> for PageRank
RingKernelHandler for PageRank single iteration.
impl RingKernelHandler<PageRankIterateRing, PageRankIterateResponse> for PageRank
RingKernelHandler for PageRank single iteration.
Performs one power iteration step in Ring mode.
Source§fn handle<'life0, 'life1, 'async_trait>(
&'life0 self,
_ctx: &'life1 mut RingContext<'_>,
msg: PageRankIterateRing,
) -> Pin<Box<dyn Future<Output = Result<PageRankIterateResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn handle<'life0, 'life1, 'async_trait>(
&'life0 self,
_ctx: &'life1 mut RingContext<'_>,
msg: PageRankIterateRing,
) -> Pin<Box<dyn Future<Output = Result<PageRankIterateResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn initialize<'life0, 'life1, 'async_trait>(
&'life0 self,
_ctx: &'life1 mut RingContext<'_>,
) -> Pin<Box<dyn Future<Output = Result<(), KernelError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: Sync + 'async_trait,
fn initialize<'life0, 'life1, 'async_trait>(
&'life0 self,
_ctx: &'life1 mut RingContext<'_>,
) -> Pin<Box<dyn Future<Output = Result<(), KernelError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: Sync + 'async_trait,
Source§fn shutdown<'life0, 'life1, 'async_trait>(
&'life0 self,
_ctx: &'life1 mut RingContext<'_>,
) -> Pin<Box<dyn Future<Output = Result<(), KernelError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: Sync + 'async_trait,
fn shutdown<'life0, 'life1, 'async_trait>(
&'life0 self,
_ctx: &'life1 mut RingContext<'_>,
) -> Pin<Box<dyn Future<Output = Result<(), KernelError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: Sync + 'async_trait,
Source§impl RingKernelHandler<PageRankQueryRing, PageRankQueryResponse> for PageRank
RingKernelHandler for PageRank queries.
impl RingKernelHandler<PageRankQueryRing, PageRankQueryResponse> for PageRank
RingKernelHandler for PageRank queries.
Enables low-latency score queries for individual nodes in Ring mode.