pub struct TuranDensityComputer {
pub forbidden_clique: usize,
pub bounds: Vec<(usize, u64)>,
}Expand description
Computes Turán densities and exact Turán numbers for small graphs.
Fields§
§forbidden_clique: usizeThe forbidden graph (number of vertices in K_{r+1}).
bounds: Vec<(usize, u64)>Precomputed upper bounds for various n.
Implementations§
Source§impl TuranDensityComputer
impl TuranDensityComputer
Sourcepub fn turan_edges(&self, n: usize) -> u64
pub fn turan_edges(&self, n: usize) -> u64
Compute ex(n, K_{r+1}) = number of edges in the Turán graph T(n,r).
T(n,r) has n vertices partitioned into r equal parts with all edges between parts. |E(T(n,r))| = (r-1)/(2r) * n² (asymptotically).
Sourcepub fn density(&self) -> (usize, usize)
pub fn density(&self) -> (usize, usize)
Compute the Turán density π(K_{r+1}) = (r-1)/r.
Returns the numerator and denominator.
Sourcepub fn cache_bound(&mut self, n: usize, bound: u64)
pub fn cache_bound(&mut self, n: usize, bound: u64)
Cache a precomputed bound ex(n, K_{r+1}) = bound.
Trait Implementations§
Source§impl Clone for TuranDensityComputer
impl Clone for TuranDensityComputer
Source§fn clone(&self) -> TuranDensityComputer
fn clone(&self) -> TuranDensityComputer
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for TuranDensityComputer
impl RefUnwindSafe for TuranDensityComputer
impl Send for TuranDensityComputer
impl Sync for TuranDensityComputer
impl Unpin for TuranDensityComputer
impl UnsafeUnpin for TuranDensityComputer
impl UnwindSafe for TuranDensityComputer
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