Struct fast_paths::Params

source ·
pub struct Params {
    pub hierarchy_depth_factor: f32,
    pub edge_quotient_factor: f32,
    pub max_settled_nodes_initial_relevance: usize,
    pub max_settled_nodes_neighbor_relevance: usize,
    pub max_settled_nodes_contraction: usize,
}

Fields§

§hierarchy_depth_factor: f32

Smaller values typically yield less shortcuts and a faster preparation time. The relation to query speeds is less clear. For large values that yield a much higher number of shortcuts queries become slow, but otherwise the query speed might only change by a small amount when you change this parameter. The optimal value can only be found heuristically for your specific graph and can even depend on the other parameters below. We recommend trying different values between 0 and 1.

§edge_quotient_factor: f32

This parameter is simply set to 1.0, because only it’s relative size compared to hierarchy_depth_factor plays a role.

§max_settled_nodes_initial_relevance: usize

The maximum number of settled nodes per witness search performed when priorities are calculated for all nodes initially. Since this does not take much time you should probably keep the default.

§max_settled_nodes_neighbor_relevance: usize

The maximum number of settled nodes per witness search performed when updating priorities of neighbor nodes after a node was contracted. The preparation time can strongly depend on this value and even setting it to a very small value like 0 or 1 might be feasible. Higher values (like ~500+) should yield less shortcuts and faster query times at the cost of a longer preparation time. Lower values (like ~0-100) should yield a faster preparation at the cost of slower query times and more shortcuts. To know for sure you should still run your own experiments for your specific graph.

§max_settled_nodes_contraction: usize

The maximum number of settled nodes per witness search when contracting a node. Higher values like ~500+ mean less shortcuts (fast graph edges), slower preparation and faster queries. Lower values mean more shortcuts, slower queries and faster preparation.

Implementations§

source§

impl Params

source

pub fn new( ratio: f32, max_settled_nodes_initial_relevance: usize, max_settled_nodes_neighbor_relevance: usize, max_settled_nodes_contraction: usize ) -> Self

source

pub fn default() -> Self

Auto Trait Implementations§

§

impl Freeze for Params

§

impl RefUnwindSafe for Params

§

impl Send for Params

§

impl Sync for Params

§

impl Unpin for Params

§

impl UnwindSafe for Params

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> 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> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

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, U> TryFrom<U> for T
where U: Into<T>,

§

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>,

§

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.