pub struct CycleBasisBounds {
pub max_cycles: Option<usize>,
pub max_cycle_length: Option<usize>,
pub max_per_scc: Option<usize>,
}Expand description
Bounds for limiting cycle basis computation.
Cycle basis can produce many cycles in dense graphs. These bounds prevent memory explosion and excessive computation time.
§Example
use sqlitegraph::algo::CycleBasisBounds;
// Stop after finding 100 cycles
let bounds = CycleBasisBounds {
max_cycles: Some(100),
..Default::default()
};Fields§
§max_cycles: Option<usize>Maximum number of cycles to compute.
When this limit is reached, enumeration stops and cycles_skipped
is incremented to reflect cycles not collected.
max_cycle_length: Option<usize>Maximum cycle length to include.
Cycles longer than this are ignored. Useful for finding “short” dependency cycles in large graphs.
max_per_scc: Option<usize>Maximum cycles per SCC.
Prevents explosion in large strongly connected components. Each SCC contributes at most this many cycles to the basis.
Implementations§
Source§impl CycleBasisBounds
impl CycleBasisBounds
Sourcepub fn with_max_cycles(self, max: usize) -> Self
pub fn with_max_cycles(self, max: usize) -> Self
Sets the maximum number of cycles to compute.
Sourcepub fn with_max_cycle_length(self, max: usize) -> Self
pub fn with_max_cycle_length(self, max: usize) -> Self
Sets the maximum cycle length to include.
Sourcepub fn with_max_per_scc(self, max: usize) -> Self
pub fn with_max_per_scc(self, max: usize) -> Self
Sets the maximum cycles per SCC.
Sourcepub fn is_bounded(&self) -> bool
pub fn is_bounded(&self) -> bool
Returns true if any bound is set.
Trait Implementations§
Source§impl Clone for CycleBasisBounds
impl Clone for CycleBasisBounds
Source§fn clone(&self) -> CycleBasisBounds
fn clone(&self) -> CycleBasisBounds
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CycleBasisBounds
impl Debug for CycleBasisBounds
Source§impl Default for CycleBasisBounds
impl Default for CycleBasisBounds
Source§fn default() -> CycleBasisBounds
fn default() -> CycleBasisBounds
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for CycleBasisBounds
impl RefUnwindSafe for CycleBasisBounds
impl Send for CycleBasisBounds
impl Sync for CycleBasisBounds
impl Unpin for CycleBasisBounds
impl UnsafeUnpin for CycleBasisBounds
impl UnwindSafe for CycleBasisBounds
Blanket Implementations§
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more