PageRank

Struct PageRank 

Source
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

Source

pub fn new() -> Self

Create a new PageRank kernel.

Source

pub fn initialize(&self, graph: CsrGraph, damping: f32)

Initialize the kernel with a graph for Ring mode operations.

Source

pub fn query_score(&self, node_id: u64) -> Option<f64>

Query the score for a specific node.

Source

pub fn current_iteration(&self) -> u32

Get current iteration count.

Source

pub fn is_converged(&self) -> bool

Check if converged.

Source

pub fn iterate(&self) -> f64

Perform one iteration step using internal state.

Source

pub fn iterate_step(state: &mut PageRankState) -> f64

Perform one iteration of PageRank on the given state.

Source

pub fn initialize_state(graph: CsrGraph, damping: f32) -> PageRankState

Initialize state for a graph.

Source

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.

Source

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

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,

Execute the kernel with the given input. Read more
Source§

fn validate_input(&self, _input: &I) -> Result<(), KernelError>

Validate the input before execution. Read more
Source§

impl Clone for PageRank

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PageRank

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for PageRank

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl GpuKernel for PageRank

Source§

fn metadata(&self) -> &KernelMetadata

Returns the kernel metadata.
Source§

fn validate(&self) -> Result<(), KernelError>

Validate kernel configuration. Read more
Source§

fn id(&self) -> &str

Returns the kernel ID.
Source§

fn requires_gpu_native(&self) -> bool

Returns true if this kernel requires GPU-native execution.
Source§

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,

Handle an incoming message. Read more
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,

Initialize the kernel state. Read more
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,

Called when the kernel is being shut down. Read more
Source§

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,

Handle an incoming message. Read more
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,

Initialize the kernel state. Read more
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,

Called when the kernel is being shut down. Read more
Source§

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,

Handle an incoming message. Read more
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,

Initialize the kernel state. Read more
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,

Called when the kernel is being shut down. Read more
Source§

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,

Handle an incoming message. Read more
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,

Initialize the kernel state. Read more
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,

Called when the kernel is being shut down. Read more
Source§

impl RingKernelHandler<PageRankQueryRing, PageRankQueryResponse> for PageRank

RingKernelHandler for PageRank queries.

Enables low-latency score queries for individual nodes in Ring mode.

Source§

fn handle<'life0, 'life1, 'async_trait>( &'life0 self, _ctx: &'life1 mut RingContext<'_>, msg: PageRankQueryRing, ) -> Pin<Box<dyn Future<Output = Result<PageRankQueryResponse>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Handle an incoming message. Read more
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,

Initialize the kernel state. Read more
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,

Called when the kernel is being shut down. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> ArchivePointee for T

Source§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
Source§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<F, W, T, D> Deserialize<With<T, W>, D> for F
where W: DeserializeWith<F, T, D>, D: Fallible + ?Sized, F: ?Sized,

Source§

fn deserialize( &self, deserializer: &mut D, ) -> Result<With<T, W>, <D as Fallible>::Error>

Deserializes using the given deserializer
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> LayoutRaw for T

Source§

fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>

Gets the layout of the type.
Source§

impl<T> Pointee for T

Source§

type Metadata = ()

The type for metadata in pointers and references to Self.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more