pub struct DTFGraph { /* private fields */ }Expand description
The augmentation data structure.
Implementations§
Source§impl DTFGraph
impl DTFGraph
pub fn to_undirected<G>(&self) -> Gwhere
G: MutableGraph,
pub fn layer(&mut self, depth: usize) -> DTFLayer<'_>
pub fn num_arcs_at_depth(&self, depth: usize) -> usize
pub fn add_vertex(&mut self, u: Vertex)
pub fn orient_deep<G>(graph: &G, depth: usize) -> DTFGraphwhere
G: Graph,
pub fn edge_subgraph<I>(&self, it: I) -> DTFGraph
pub fn orient<G>(graph: &G) -> DTFGraphwhere
G: Graph,
pub fn add_arc(&mut self, u: &Vertex, v: &Vertex, depth: usize)
pub fn has_arc_at(&self, u: &Vertex, v: &Vertex, depth: usize) -> bool
pub fn get_arc_depth(&self, u: &Vertex, v: &Vertex) -> Option<u32>
pub fn arcs(&self) -> DTFArcIterator<'_> ⓘ
pub fn arcs_at(&self, depth: usize) -> DTFArcIterator<'_> ⓘ
pub fn in_neighbourhoods_iter(&self) -> DTFNIterator<'_> ⓘ
pub fn in_neighbourhoods_iter_at(&self, depth: usize) -> DTFNIterator<'_> ⓘ
pub fn in_neighbours_at<'a>( &'a self, u: &Vertex, depth: usize, ) -> Box<dyn Iterator<Item = &Vertex> + 'a>
pub fn in_neighbours_with_weights(&self, u: &Vertex) -> FxHashMap<Vertex, u32>
Sourcepub fn small_distance(&self, u: &Vertex, v: &Vertex) -> Option<u32>
pub fn small_distance(&self, u: &Vertex, v: &Vertex) -> Option<u32>
Returns the distance between the vertices u and v if it
it smaller than the depth of the augmentation. Otherwise returns None.
Sourcepub fn augment(&mut self, depth: usize, frat_depth: usize)
pub fn augment(&mut self, depth: usize, frat_depth: usize)
Increases the depth of the augmentation.
§Arguments
depth- The target depth of the augmentationfrat_depth- An optimisation parameter. Larger values increase computation time, recommended values are 2 or 1.
Sourcepub fn domset(&mut self, radius: u32) -> VertexSet
pub fn domset(&mut self, radius: u32) -> VertexSet
Computes an approximate $r$-dominating set of the underlying graph,
where $r$ is the provided radius.
Note that if radius is larger than the current augmentation depth
then graph is augmented further until the depth matches the radius.
The approximation ratio is a function of the graph’s ‘sparseness’. See [Dvořák13] and [Reidl16] for the underlying theory and [Brown20] for the details of this specific version of the algorithm.
[Dvořák13] Dvořák, Z. (2013). Constant-factor approximation of the domination number in sparse graphs. European Journal of Combinatorics, 34(5), 833-840.
[Brown20] Brown, C.T., Moritz, D., O’Brien, M.P., Reidl, F., Reiter, T. and Sullivan, B.D., 2020. Exploring neighborhoods in large metagenome assembly graphs using spacegraphcats reveals hidden sequence diversity. Genome biology, 21(1), pp.1-16.
[Reidl16] Reidl, F. (2016). Structural sparseness and complex networks (No. RWTH-2015-07564). Fachgruppe Informatik.
Trait Implementations§
Source§impl Digraph for DTFGraph
impl Digraph for DTFGraph
Source§fn has_arc(&self, u: &Vertex, v: &Vertex) -> bool
fn has_arc(&self, u: &Vertex, v: &Vertex) -> bool
uv exists in the digraph.Source§fn in_degree(&self, u: &Vertex) -> u32
fn in_degree(&self, u: &Vertex) -> u32
u in the digraph.Source§fn out_degree(&self, u: &Vertex) -> u32
fn out_degree(&self, u: &Vertex) -> u32
u in the digraph.Source§fn out_neighbours<'a>(
&'a self,
_: &Vertex,
) -> Box<dyn Iterator<Item = &Vertex> + 'a>
fn out_neighbours<'a>( &'a self, _: &Vertex, ) -> Box<dyn Iterator<Item = &Vertex> + 'a>
u.Source§fn in_neighbours<'a>(
&'a self,
u: &Vertex,
) -> Box<dyn Iterator<Item = &Vertex> + 'a>
fn in_neighbours<'a>( &'a self, u: &Vertex, ) -> Box<dyn Iterator<Item = &Vertex> + 'a>
u.Source§fn in_degrees(&self) -> VertexMap<u32>
fn in_degrees(&self) -> VertexMap<u32>
Source§fn out_degrees(&self) -> VertexMap<u32>
fn out_degrees(&self) -> VertexMap<u32>
Source§impl Graph for DTFGraph
impl Graph for DTFGraph
Source§fn num_vertices(&self) -> usize
fn num_vertices(&self) -> usize
Source§fn contains(&self, u: &Vertex) -> bool
fn contains(&self, u: &Vertex) -> bool
u is contained in the graph.Source§fn vertices<'a>(&'a self) -> Box<dyn Iterator<Item = &Vertex> + 'a>
fn vertices<'a>(&'a self) -> Box<dyn Iterator<Item = &Vertex> + 'a>
Source§fn adjacent(&self, u: &Vertex, v: &Vertex) -> bool
fn adjacent(&self, u: &Vertex, v: &Vertex) -> bool
u and v are connected by an edge.Source§fn neighbours<'a>(
&'a self,
_: &Vertex,
) -> Box<dyn Iterator<Item = &Vertex> + 'a>
fn neighbours<'a>( &'a self, _: &Vertex, ) -> Box<dyn Iterator<Item = &Vertex> + 'a>
u.Source§fn degrees(&self) -> VertexMap<u32>
fn degrees(&self) -> VertexMap<u32>
Source§fn neighbourhood<'a, I>(&self, vertices: I) -> FxHashSet<Vertex>
fn neighbourhood<'a, I>(&self, vertices: I) -> FxHashSet<Vertex>
vertices over vertices, returns all vertices of the graph
which are neighbours of those vertices but not part of vertices themselves.Source§fn closed_neighbourhood<'a, I>(&self, vertices: I) -> FxHashSet<Vertex>
fn closed_neighbourhood<'a, I>(&self, vertices: I) -> FxHashSet<Vertex>
vertices over vertices, returns all vertices of the graph
which are neighbours of those vertices as well as all vertices contained in vertices.Source§fn r_neighbours(&self, u: &Vertex, r: usize) -> FxHashSet<Vertex>
fn r_neighbours(&self, u: &Vertex, r: usize) -> FxHashSet<Vertex>
r to u.Auto Trait Implementations§
impl Freeze for DTFGraph
impl RefUnwindSafe for DTFGraph
impl Send for DTFGraph
impl Sync for DTFGraph
impl Unpin for DTFGraph
impl UnwindSafe for DTFGraph
Blanket Implementations§
Source§impl<D> ArcIterable<D> for Dwhere
D: Digraph,
impl<D> ArcIterable<D> for Dwhere
D: Digraph,
Source§fn arcs(&self) -> ArcIterator<'_, D> ⓘ
fn arcs(&self) -> ArcIterator<'_, D> ⓘ
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
Source§impl<D> DiNeighIterable<D> for Dwhere
D: Digraph,
impl<D> DiNeighIterable<D> for Dwhere
D: Digraph,
Source§fn in_neighbourhoods(&self) -> DiNeighIterator<'_, D> ⓘ
fn in_neighbourhoods(&self) -> DiNeighIterator<'_, D> ⓘ
Source§fn out_neighbourhoods(&self) -> DiNeighIterator<'_, D> ⓘ
fn out_neighbourhoods(&self) -> DiNeighIterator<'_, D> ⓘ
Source§impl<G> EdgeIterable<G> for Gwhere
G: Graph,
impl<G> EdgeIterable<G> for Gwhere
G: Graph,
Source§fn edges(&self) -> EdgeIterator<'_, G> ⓘ
fn edges(&self) -> EdgeIterator<'_, G> ⓘ
Source§impl<G> GraphAlgorithms for Gwhere
G: Graph,
impl<G> GraphAlgorithms for Gwhere
G: Graph,
Source§fn components(&self) -> Vec<HashSet<u32, BuildHasherDefault<FxHasher>>>
fn components(&self) -> Vec<HashSet<u32, BuildHasherDefault<FxHasher>>>
Source§fn degeneracy(
&self,
) -> (u32, u32, Vec<u32>, HashMap<u32, u32, BuildHasherDefault<FxHasher>>)
fn degeneracy( &self, ) -> (u32, u32, Vec<u32>, HashMap<u32, u32, BuildHasherDefault<FxHasher>>)
Source§fn is_bipartite(&self) -> BipartiteWitness
fn is_bipartite(&self) -> BipartiteWitness
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>
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>
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