pub struct SimpleCyclesOptions {
pub mode: NeighborMode,
pub min_cycle_length: Option<usize>,
pub max_cycle_length: Option<usize>,
pub max_results: Option<usize>,
}Expand description
Options for Graph::simple_cycles and Graph::simple_cycles_callback.
The default searches for all simple cycles of any length, following edge
directions (NeighborMode::Out) in directed graphs. Lengths count edges,
which for simple cycles equals the number of vertices.
use igraph::{cycles::SimpleCyclesOptions, prelude::*};
let opts = SimpleCyclesOptions::default().with_max_length(4).with_max_results(10);
assert_eq!(opts.max_cycle_length, Some(4));
assert_eq!(opts.mode, NeighborMode::Out);Fields§
§mode: NeighborModeHow edge directions are considered in directed graphs: Out follows
them, In follows them backwards, All ignores them. Ignored for
undirected graphs. Default: Out.
min_cycle_length: Option<usize>Only report cycles with at least this many edges (None: no limit).
max_cycle_length: Option<usize>Only report cycles with at most this many edges (None: no limit).
Bounding the length also bounds the search, making it much faster.
max_results: Option<usize>Stop after this many cycles have been reported (None: no limit).
Implementations§
Source§impl SimpleCyclesOptions
impl SimpleCyclesOptions
Sourcepub fn with_mode(self, mode: NeighborMode) -> Self
pub fn with_mode(self, mode: NeighborMode) -> Self
Sets mode.
Sourcepub fn with_min_length(self, len: usize) -> Self
pub fn with_min_length(self, len: usize) -> Self
Sets min_cycle_length.
Sourcepub fn with_max_length(self, len: usize) -> Self
pub fn with_max_length(self, len: usize) -> Self
Sets max_cycle_length.
Sourcepub fn with_max_results(self, n: usize) -> Self
pub fn with_max_results(self, n: usize) -> Self
Sets max_results.
Trait Implementations§
Source§impl Clone for SimpleCyclesOptions
impl Clone for SimpleCyclesOptions
Source§fn clone(&self) -> SimpleCyclesOptions
fn clone(&self) -> SimpleCyclesOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for SimpleCyclesOptions
Source§impl Debug for SimpleCyclesOptions
impl Debug for SimpleCyclesOptions
Source§impl Default for SimpleCyclesOptions
impl Default for SimpleCyclesOptions
impl Eq for SimpleCyclesOptions
Source§impl PartialEq for SimpleCyclesOptions
impl PartialEq for SimpleCyclesOptions
Source§fn eq(&self, other: &SimpleCyclesOptions) -> bool
fn eq(&self, other: &SimpleCyclesOptions) -> bool
self and other values to be equal, and is used by ==.