pub struct AlgoParams {
pub collection: String,
pub edge_label: Option<String>,
pub damping: Option<f64>,
pub max_iterations: Option<usize>,
pub tolerance: Option<f64>,
pub source_node: Option<String>,
pub sample_size: Option<usize>,
pub direction: Option<String>,
pub resolution: Option<f64>,
pub mode: Option<String>,
pub personalization_vector: Option<HashMap<String, f64>>,
}Expand description
Generic parameter bag for all graph algorithms.
Each algorithm validates and extracts the parameters it needs, ignoring the rest. Unknown parameters are silently ignored rather than rejected — this allows forward-compatible DDL extensions.
Fields§
§collection: StringTarget collection name.
edge_label: Option<String>Optional edge label filter — only edges with this label are traversed.
damping: Option<f64>PageRank damping factor (default: 0.85).
max_iterations: Option<usize>Maximum iterations for iterative algorithms (PageRank, LabelProp, Louvain).
tolerance: Option<f64>Convergence tolerance for PageRank (default: 1e-7).
source_node: Option<String>Source node for SSSP.
sample_size: Option<usize>Sample size for approximate centrality (betweenness, closeness).
None = exact computation.
direction: Option<String>Direction for degree centrality: “in”, “out”, “both”.
resolution: Option<f64>Resolution parameter for Louvain (default: 1.0).
mode: Option<String>Mode for triangle counting / diameter: “global”, “per_node”, “exact”, “approximate”.
personalization_vector: Option<HashMap<String, f64>>Per-node initial rank seed for Personalized PageRank.
When None, PageRank initializes uniformly (1.0/n per node) — standard behavior.
When Some(map), PPR initializes each node id to map[id] (normalized to sum=1.0);
nodes missing from the map start at 0.0. Bias toward seed nodes makes them and their
neighbors rank higher.
Implementations§
Source§impl AlgoParams
impl AlgoParams
Sourcepub fn damping_factor(&self) -> f64
pub fn damping_factor(&self) -> f64
PageRank damping factor, validated to (0.0, 1.0).
Sourcepub fn iterations(&self, default: usize) -> usize
pub fn iterations(&self, default: usize) -> usize
Max iterations with sensible default per algorithm.
Defence-in-depth: the pgwire handler clamps ITERATIONS to
MAX_ITERATIONS_CAP before dispatch, but any alternate entry
point (native protocol, internal dispatch) also lands here, so
we enforce the ceiling at the engine boundary too.
Sourcepub fn convergence_tolerance(&self) -> f64
pub fn convergence_tolerance(&self) -> f64
Convergence tolerance, validated to positive.
Sourcepub fn louvain_resolution(&self) -> f64
pub fn louvain_resolution(&self) -> f64
Louvain resolution parameter, validated to positive.
Trait Implementations§
Source§impl Clone for AlgoParams
impl Clone for AlgoParams
Source§fn clone(&self) -> AlgoParams
fn clone(&self) -> AlgoParams
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AlgoParams
impl Debug for AlgoParams
Source§impl Default for AlgoParams
impl Default for AlgoParams
Source§fn default() -> AlgoParams
fn default() -> AlgoParams
Source§impl<'de> Deserialize<'de> for AlgoParams
impl<'de> Deserialize<'de> for AlgoParams
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl<'__msgpack_de> FromMessagePack<'__msgpack_de> for AlgoParams
impl<'__msgpack_de> FromMessagePack<'__msgpack_de> for AlgoParams
Source§impl PartialEq for AlgoParams
impl PartialEq for AlgoParams
Source§fn eq(&self, other: &AlgoParams) -> bool
fn eq(&self, other: &AlgoParams) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for AlgoParams
impl Serialize for AlgoParams
impl StructuralPartialEq for AlgoParams
Auto Trait Implementations§
impl Freeze for AlgoParams
impl RefUnwindSafe for AlgoParams
impl Send for AlgoParams
impl Sync for AlgoParams
impl Unpin for AlgoParams
impl UnsafeUnpin for AlgoParams
impl UnwindSafe for AlgoParams
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<T> FromMessagePackOwned for Twhere
T: for<'a> FromMessagePack<'a>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
impl<T> Scalar for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.