@@ -24,53 +24,13 @@ use rustkernel_core::{
2424 kernel:: KernelMetadata ,
2525 traits:: { BatchKernel , GpuKernel , RingKernelHandler } ,
2626} ;
27- use serde:: { Deserialize , Serialize } ;
2827use std:: collections:: VecDeque ;
2928use std:: time:: Instant ;
3029
3130// ============================================================================
3231// PageRank Kernel
3332// ============================================================================
3433
35- /// PageRank operation type.
36- #[ derive( Debug , Clone , Copy , Serialize , Deserialize ) ]
37- pub enum PageRankOp {
38- /// Query the current PageRank score for a node.
39- Query ,
40- /// Perform one iteration of PageRank.
41- Iterate ,
42- /// Reset all scores.
43- Reset ,
44- /// Initialize with a graph.
45- Initialize ,
46- }
47-
48- /// PageRank request.
49- #[ derive( Debug , Clone , Serialize , Deserialize ) ]
50- pub struct PageRankRequest {
51- /// Node ID to query (for Query operation).
52- pub node_id : Option < u64 > ,
53- /// Operation type.
54- pub operation : PageRankOp ,
55- /// Graph data (for Initialize operation).
56- pub graph : Option < CsrGraph > ,
57- /// Damping factor (default: 0.85).
58- pub damping : Option < f32 > ,
59- }
60-
61- /// PageRank response.
62- #[ derive( Debug , Clone , Serialize , Deserialize ) ]
63- pub struct PageRankResponse {
64- /// Score for the queried node.
65- pub score : Option < f64 > ,
66- /// Whether the algorithm has converged.
67- pub converged : bool ,
68- /// Current iteration count.
69- pub iteration : u32 ,
70- /// Full result (for Query after convergence).
71- pub result : Option < CentralityResult > ,
72- }
73-
7434/// PageRank kernel state.
7535#[ derive( Debug , Clone , Default ) ]
7636pub struct PageRankState {
0 commit comments