Skip to main content

MinimumCycleBasisOptions

Struct MinimumCycleBasisOptions 

Source
pub struct MinimumCycleBasisOptions {
    pub bfs_cutoff: Option<usize>,
    pub complete: bool,
    pub use_cycle_order: bool,
}
Expand description

Options for Graph::minimum_cycle_basis.

The default computes an exact minimum cycle basis with each cycle listed in cycle order (bfs_cutoff: None, complete: true, use_cycle_order: true), the same defaults as the igraph R and Python interfaces.

use igraph::cycles::MinimumCycleBasisOptions;
let fast = MinimumCycleBasisOptions::default().with_bfs_cutoff(3).with_complete(false);
assert_eq!(fast.bfs_cutoff, Some(3));
assert!(fast.use_cycle_order);

Fields§

§bfs_cutoff: Option<usize>

None computes an exact minimum basis. Some(k) limits the depth of the BFS trees used to generate candidate cycles, which can speed up the computation substantially: then only the returned cycles of length at most 2k + 1 are guaranteed to belong to some minimum basis. Default: None.

§complete: bool

Only used with a bfs_cutoff. If true, a complete basis is still returned (its cycles longer than 2k + 1 may not be minimal); if false, only the cycles of length at most 2k + 1 are returned, which is faster but does not span the whole cycle space. Default: true.

§use_cycle_order: bool

If true, the edge ids of each cycle are listed in the order they appear along the cycle (at a small cost); if false, their order is unspecified. Default: true.

Implementations§

Source§

impl MinimumCycleBasisOptions

Source

pub fn with_bfs_cutoff(self, k: usize) -> Self

Sets bfs_cutoff to Some(k).

Source

pub fn with_complete(self, complete: bool) -> Self

Sets complete.

Source

pub fn with_cycle_order(self, use_cycle_order: bool) -> Self

Trait Implementations§

Source§

impl Clone for MinimumCycleBasisOptions

Source§

fn clone(&self) -> MinimumCycleBasisOptions

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Copy for MinimumCycleBasisOptions

Source§

impl Debug for MinimumCycleBasisOptions

Source§

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

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

impl Default for MinimumCycleBasisOptions

Source§

fn default() -> Self

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

impl Eq for MinimumCycleBasisOptions

Source§

impl PartialEq for MinimumCycleBasisOptions

Source§

fn eq(&self, other: &MinimumCycleBasisOptions) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for MinimumCycleBasisOptions

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