pub struct ForestStats {
pub tree_cuts: u64,
pub scanned_vertices: u64,
pub candidate_edges: u64,
pub replacements: u64,
}Expand description
Cumulative replacement-search work, from ForestGraph::stats.
A stable interface of the experimental ETT engine
(crate::EngineConfig::EulerTour). The struct is exhaustive: its four
public fields are frozen for 1.x, and a new field requires a major release.
§Guaranteed
- Each field counts the event its documentation names, in units of events.
- Every counter is
0on a new graph (ForestGraph::new,Default) and afterForestGraph::reset_stats. - Between resets, counters only grow, and each saturates at
u64::MAXinstead of wrapping. - Queries (
ForestGraph::connected,ForestGraph::node_count,ForestGraph::edge_count,ForestGraph::stats) never change them. replacements <= tree_cuts(at most one replacement per removed spanning edge),replacements <= candidate_edges(a replacement is a tested entry) andreplacements <= scanned_vertices(it is found while scanning a vertex).
§Implementation-dependent
The exact values for a given operation sequence: which edges belong to the spanning forest, which side is scanned, the order in which vertices and entries are examined and where the search stops depend on the implementation and may change in any release. Do not compare values across versions.
§Examples
use knotrel_core::{ForestGraph, ForestStats};
let mut graph = ForestGraph::new();
graph.link(1, 2)?;
graph.link(2, 3)?;
graph.link(3, 1)?;
graph.cut(1, 2)?;
let stats = graph.stats();
assert!(stats.replacements <= stats.tree_cuts);
assert!(stats.replacements <= stats.candidate_edges);
graph.reset_stats();
assert_eq!(graph.stats(), ForestStats::default());Fields§
§tree_cuts: u64Deleted edges that belonged to the maintained spanning forest.
scanned_vertices: u64Candidate-bearing vertices yielded on the smaller side after tree cuts. Pruned empty regions and unvisited vertices after success are excluded.
candidate_edges: u64Non-tree adjacency entries tested for a crossing replacement.
replacements: u64Successful promotions of non-tree edges into the forest.