knotrel_core/configuration.rs
1//! Explicit engine selection, independent of any transport or environment.
2
3use crate::{ForestGraph, Graph, GraphError, HdtGraph, NodeId, cluster_forest::ClusterForestGraph};
4
5/// Immutable cardinality ceilings for one graph instance.
6///
7/// `None` is unlimited (the default); zero forbids new entries. Cuts retain
8/// vertices. These limits do not bound allocator capacity or resident memory.
9/// Enforced by [`ConnectivityGraph`]; raw algorithm types remain unlimited.
10#[derive(Debug, Clone, Copy, Default, PartialEq, Eq)]
11pub struct GraphLimits {
12 /// Maximum registered vertices, including isolated vertices.
13 pub max_nodes: Option<usize>,
14 /// Maximum live undirected edges.
15 pub max_edges: Option<usize>,
16}
17
18/// The implementation chosen when creating a graph.
19///
20/// Selection is immutable for the lifetime of a [`ConnectivityGraph`].
21/// No automatic switching or answer cache is introduced by this configuration.
22#[derive(Debug, Clone, Copy, Default, PartialEq, Eq)]
23#[non_exhaustive]
24pub enum EngineConfig {
25 /// Compact adjacency with a fresh BFS for each connectivity query.
26 #[default]
27 CompactBfs,
28 /// Euler-tour forest with candidate-pruned replacement search: a stable
29 /// interface for an experimental engine.
30 ///
31 /// This is not HDT and does not provide polylogarithmic update bounds.
32 /// The variant, its selector `"ett"` ([`EngineConfig::as_str`]) and the
33 /// [`ForestGraph`] API stay compatible across 1.x, like
34 /// [`EngineConfig::Hdt`]: they are removed or renamed only after a
35 /// deprecation and in a major release, and `#[non_exhaustive]` on this
36 /// enum does not authorize removing them. "Experimental" qualifies only the
37 /// engine's performance, maturity and usage recommendation
38 /// ([`EngineConfig::is_experimental`] returns `true`).
39 EulerTour,
40 /// Deterministic HDT with level-based replacement search: a stable
41 /// interface for an experimental engine.
42 ///
43 /// The variant, its selector `"hdt"` ([`EngineConfig::as_str`]) and the
44 /// [`HdtGraph`] API stay compatible across 1.x: they are removed or
45 /// renamed only after a deprecation and in a major release, and
46 /// `#[non_exhaustive]` on this enum does not authorize removing them.
47 /// "Experimental" qualifies only the engine's performance, maturity and
48 /// usage recommendation ([`EngineConfig::is_experimental`] returns `true`):
49 /// it carries no performance, latency or memory promise, lifecycle support
50 /// is not available, and [`EngineConfig::CompactBfs`] remains the default.
51 Hdt,
52 /// Cluster forest (Wulff-Nilsen, SODA 2013, §3, with the path compression
53 /// of De Man et al., PVLDB 2025, §4): a stable interface for an
54 /// experimental engine, new in 1.1.
55 ///
56 /// The variant and its selector `"cluster-forest"`
57 /// ([`EngineConfig::as_str`]) stay compatible across 1.x like
58 /// [`EngineConfig::EulerTour`] and [`EngineConfig::Hdt`]: they are
59 /// removed or renamed only after a deprecation and in a major release,
60 /// and `#[non_exhaustive]` on this enum does not authorize removing them.
61 /// "Experimental" qualifies only the engine's performance, maturity and
62 /// usage recommendation ([`EngineConfig::is_experimental`] returns
63 /// `true`): it carries no performance, latency or memory promise, and
64 /// [`EngineConfig::CompactBfs`] remains the default. The backend type
65 /// itself is internal: use the engine through [`ConnectivityGraph`] or
66 /// [`crate::LifecycleGraph`], which supports it.
67 ///
68 /// Updates are `O(log² N)` amortized by this project's derivation for
69 /// this variant (ADR 0014), not by a published theorem; queries walk to
70 /// the roots in `O(log N)`. It accepts at most 2²⁸ vertices and 2²⁸ edges
71 /// and reports more as [`GraphError::NodeLimitExceeded`] or
72 /// [`GraphError::EdgeLimitExceeded`] carrying that limit (or the
73 /// configured [`GraphLimits`] value, when lower). Under
74 /// [`crate::LifecycleGraph`] the enforced limits are 2²⁷ − 512 nodes and
75 /// 2²⁸ edges, leaving room for retired slots. Through
76 /// [`ConnectivityGraph`] the configured limits are checked first (node
77 /// before edge), then the engine's capacity: at that capacity a
78 /// configured edge limit can therefore be reported before the engine's
79 /// node capacity.
80 ClusterForest,
81}
82
83impl EngineConfig {
84 /// Returns the stable external selector for this engine.
85 pub fn as_str(self) -> &'static str {
86 match self {
87 Self::CompactBfs => "compact-bfs",
88 Self::EulerTour => "ett",
89 Self::Hdt => "hdt",
90 Self::ClusterForest => "cluster-forest",
91 }
92 }
93
94 /// Whether this engine is qualified as experimental: its performance,
95 /// maturity and usage recommendation carry no promise, although its
96 /// public interface may be stable.
97 ///
98 /// Returns `false` for [`EngineConfig::CompactBfs`] and `true` for
99 /// [`EngineConfig::EulerTour`], [`EngineConfig::Hdt`] and
100 /// [`EngineConfig::ClusterForest`] in this release. The value for the
101 /// experimental engines may stay `true` for the whole 1.x
102 /// series; it becomes `false` only when an engine is promoted, in a minor
103 /// release that records it in the release notes, and it never changes
104 /// from `false` to `true` for an existing engine. The value says nothing about the interface's
105 /// stability class: both variants are stable interfaces either way. The
106 /// server reports the same value as the `experimental` field of
107 /// `GET /v1/info`.
108 ///
109 /// # Examples
110 ///
111 /// ```
112 /// use knotrel_core::EngineConfig;
113 ///
114 /// assert!(!EngineConfig::CompactBfs.is_experimental());
115 /// assert!(EngineConfig::EulerTour.is_experimental());
116 /// assert!(EngineConfig::Hdt.is_experimental());
117 /// assert!(EngineConfig::ClusterForest.is_experimental());
118 /// assert_eq!(EngineConfig::Hdt.as_str(), "hdt");
119 /// assert_eq!(EngineConfig::ClusterForest.as_str(), "cluster-forest");
120 /// ```
121 pub fn is_experimental(self) -> bool {
122 matches!(self, Self::EulerTour | Self::Hdt | Self::ClusterForest)
123 }
124}
125
126/// An owned graph with an explicitly selected, immutable implementation.
127///
128/// All engines preserve the [`Graph`] operation contract, including growing
129/// `u64` IDs and retained vertices after cuts. This wrapper adds constant-time
130/// enum dispatch; operation costs are those of [`Graph`], [`ForestGraph`], [`HdtGraph`]
131/// or the internal cluster forest ([`EngineConfig::ClusterForest`]).
132/// It reads no environment variables or files and performs no internal locking.
133///
134/// ```
135/// use knotrel_core::{ConnectivityGraph, EngineConfig};
136/// let mut graph = ConnectivityGraph::new(EngineConfig::EulerTour);
137/// graph.link(1, u64::MAX)?;
138/// assert!(graph.connected(1, u64::MAX)?);
139/// # Ok::<(), knotrel_core::GraphError>(())
140/// ```
141#[derive(Debug)]
142pub struct ConnectivityGraph {
143 backend: Backend,
144 limits: GraphLimits,
145}
146
147#[derive(Debug)]
148enum Backend {
149 Compact(Graph),
150 EulerTour(ForestGraph),
151 Hdt(HdtGraph),
152 /// Boxed: the backend keeps reusable search buffers inline.
153 ClusterForest(Box<ClusterForestGraph>),
154}
155
156impl Default for ConnectivityGraph {
157 fn default() -> Self {
158 Self::new(EngineConfig::default())
159 }
160}
161
162impl From<Graph> for ConnectivityGraph {
163 /// Takes ownership without rebuilding or losing existing graph state.
164 fn from(graph: Graph) -> Self {
165 Self {
166 backend: Backend::Compact(graph),
167 limits: GraphLimits::default(),
168 }
169 }
170}
171
172impl ConnectivityGraph {
173 /// Creates an empty graph. Every typed configuration is supported.
174 pub fn new(config: EngineConfig) -> Self {
175 Self::with_limits(config, GraphLimits::default())
176 }
177
178 /// Creates an empty graph with immutable cardinality ceilings.
179 pub fn with_limits(config: EngineConfig, limits: GraphLimits) -> Self {
180 Self {
181 limits,
182 backend: match config {
183 EngineConfig::CompactBfs => Backend::Compact(Graph::new()),
184 EngineConfig::EulerTour => Backend::EulerTour(ForestGraph::new()),
185 EngineConfig::Hdt => Backend::Hdt(HdtGraph::new()),
186 EngineConfig::ClusterForest => {
187 Backend::ClusterForest(Box::new(ClusterForestGraph::new()))
188 }
189 },
190 }
191 }
192
193 /// Builds an owned graph by registering `nodes`, then inserting `edges`,
194 /// in the supplied order using [`Self::add_node`] and [`Self::link`].
195 ///
196 /// Duplicate nodes and duplicate/reversed edges are no-ops, including at
197 /// capacity. Edges create missing endpoints; `nodes` is not a closed universe.
198 /// Empty inputs, isolated vertices and disconnected components are valid.
199 /// The returned graph supports the same subsequent dynamic operations and
200 /// retains the selected engine and limits.
201 ///
202 /// Construction is atomic with respect to publication: on error the local
203 /// graph is dropped, not returned partially built. This is not an in-place
204 /// batch or snapshot restore, and returns no per-item change flags.
205 ///
206 /// Work and allocation behavior are those of the ordered incremental calls;
207 /// the constructor adds O(nodes.len() + edges.len()) iteration overhead and
208 /// O(1) auxiliary space. It does not reserve, sort or stage the input.
209 /// No performance improvement is promised.
210 ///
211 /// # Errors
212 ///
213 /// Returns the first [`GraphError`] from the ordered calls: all explicit
214 /// nodes precede every edge; each edge checks self-loop, node limit, then
215 /// edge limit. Later invalid input is not inspected ahead of that error.
216 /// Limits bound cardinality, not memory. As with incremental construction,
217 /// allocation failure is not a recoverable `GraphError`; collection capacity
218 /// overflow may panic and memory exhaustion may abort.
219 ///
220 /// ```
221 /// use knotrel_core::{ConnectivityGraph, EngineConfig, GraphLimits};
222 /// let mut graph = ConnectivityGraph::try_from_edges(
223 /// EngineConfig::EulerTour,
224 /// GraphLimits::default(),
225 /// &[99, 99],
226 /// &[(1, 2), (2, 1), (2, 3)],
227 /// )?;
228 /// assert_eq!(graph.node_count(), 4);
229 /// assert_eq!(graph.edge_count(), 2);
230 /// assert!(graph.connected(1, 3)?);
231 /// assert!(!graph.connected(99, 1)?);
232 /// assert!(graph.cut(2, 3)?);
233 /// assert!(!graph.connected(1, 3)?);
234 /// # Ok::<(), knotrel_core::GraphError>(())
235 /// ```
236 pub fn try_from_edges(
237 engine: EngineConfig,
238 limits: GraphLimits,
239 nodes: &[NodeId],
240 edges: &[(NodeId, NodeId)],
241 ) -> Result<Self, GraphError> {
242 let mut graph = Self::with_limits(engine, limits);
243 for &node in nodes {
244 graph.add_node(node)?;
245 }
246 for &(source, target) in edges {
247 graph.link(source, target)?;
248 }
249 Ok(graph)
250 }
251
252 /// Returns the immutable limits configured for this instance, as passed
253 /// at construction.
254 ///
255 /// They are the enforced limits for every engine except
256 /// [`EngineConfig::ClusterForest`], whose own capacity (2²⁸ vertices and
257 /// 2²⁸ edges) also applies: when it is lower, the error carries the
258 /// capacity instead of the configured value, which this method still
259 /// returns.
260 pub fn limits(&self) -> GraphLimits {
261 self.limits
262 }
263
264 /// Returns the engine that actually owns this graph's state.
265 pub fn engine(&self) -> EngineConfig {
266 match &self.backend {
267 Backend::Compact(_) => EngineConfig::CompactBfs,
268 Backend::EulerTour(_) => EngineConfig::EulerTour,
269 Backend::Hdt(_) => EngineConfig::Hdt,
270 Backend::ClusterForest(_) => EngineConfig::ClusterForest,
271 }
272 }
273
274 /// Releases the adjacency storage of an isolated vertex (`compact-bfs`
275 /// only; a no-op for the other engines and for a vertex with edges).
276 pub(crate) fn release_isolated_storage(&mut self, node: NodeId) {
277 if let Backend::Compact(graph) = &mut self.backend {
278 graph.release_isolated_storage(node);
279 }
280 }
281
282 /// Returns the adjacency capacity held by `node` (`compact-bfs` only).
283 #[cfg(test)]
284 pub(crate) fn adjacency_capacity(&self, node: NodeId) -> Option<usize> {
285 match &self.backend {
286 Backend::Compact(graph) => graph.adjacency_capacity(node),
287 _ => None,
288 }
289 }
290
291 /// Reports whether `node` is registered, in expected O(1) time with every
292 /// engine.
293 ///
294 /// Limit checks use this ID-map lookup instead of a reflexive
295 /// [`Self::connected`] query, which costs O(log V) tree-root walks on the
296 /// Euler-tour and HDT engines.
297 ///
298 /// ```rust
299 /// use knotrel_core::{ConnectivityGraph, EngineConfig};
300 ///
301 /// let mut graph = ConnectivityGraph::new(EngineConfig::Hdt);
302 /// graph.add_node(u64::MAX)?;
303 /// assert!(graph.contains_node(u64::MAX));
304 /// assert!(!graph.contains_node(1));
305 /// # Ok::<(), knotrel_core::GraphError>(())
306 /// ```
307 #[must_use]
308 pub fn contains_node(&self, node: NodeId) -> bool {
309 match &self.backend {
310 Backend::Compact(graph) => graph.contains_node(node),
311 Backend::EulerTour(graph) => graph.contains_node(node),
312 Backend::Hdt(graph) => graph.contains_node(node),
313 Backend::ClusterForest(graph) => graph.contains_node(node),
314 }
315 }
316
317 /// Adds a vertex; returns whether it was absent.
318 /// # Errors
319 /// Returns [`GraphError::NodeLimitExceeded`] without mutation at capacity.
320 /// An existing vertex always returns `Ok(false)`.
321 pub fn add_node(&mut self, node: NodeId) -> Result<bool, GraphError> {
322 if let Some(limit) = self.limits.max_nodes {
323 if self.contains_node(node) {
324 return Ok(false);
325 }
326 if self.node_count() >= limit {
327 return Err(GraphError::NodeLimitExceeded { limit });
328 }
329 }
330 Ok(match &mut self.backend {
331 Backend::Compact(graph) => graph.add_node(node),
332 Backend::EulerTour(graph) => graph.add_node(node),
333 Backend::Hdt(graph) => graph.add_node(node),
334 Backend::ClusterForest(graph) => graph.add_node(node)?,
335 })
336 }
337
338 /// Adds an undirected edge, creating absent endpoints.
339 ///
340 /// Returns whether the edge was absent. A self-loop returns
341 /// [`GraphError::SelfLoop`] without creating its endpoint.
342 /// Limit checks precede all mutation; node limits take precedence over edge
343 /// limits. Duplicate edges succeed unchanged even at capacity. Each check
344 /// uses expected O(1) ID-map lookups, never a graph traversal, tree-root
345 /// walk or speculative insert.
346 /// # Errors
347 /// Self-loops or cardinality violations leave the entire graph unchanged.
348 pub fn link(&mut self, source: NodeId, target: NodeId) -> Result<bool, GraphError> {
349 if source == target {
350 return Err(GraphError::SelfLoop { node: source });
351 }
352 if let Some(limit) = self.limits.max_nodes {
353 let missing =
354 usize::from(!self.contains_node(source)) + usize::from(!self.contains_node(target));
355 if missing > limit.saturating_sub(self.node_count()) {
356 return Err(GraphError::NodeLimitExceeded { limit });
357 }
358 }
359 if let Some(limit) = self.limits.max_edges
360 && self.edge_count() >= limit
361 {
362 let exists = match &self.backend {
363 Backend::Compact(g) => g.contains_edge(source, target),
364 Backend::EulerTour(g) => g.contains_edge(source, target),
365 Backend::Hdt(g) => g.contains_edge(source, target),
366 Backend::ClusterForest(g) => g.contains_edge(source, target),
367 };
368 return if exists {
369 Ok(false)
370 } else {
371 Err(GraphError::EdgeLimitExceeded { limit })
372 };
373 }
374 match &mut self.backend {
375 Backend::Compact(graph) => graph.link(source, target),
376 Backend::EulerTour(graph) => graph.link(source, target),
377 Backend::Hdt(graph) => graph.link(source, target),
378 Backend::ClusterForest(graph) => graph.link(source, target),
379 }
380 }
381
382 /// Removes an edge while retaining vertices.
383 ///
384 /// Returns false for an absent edge or endpoint. A self-loop returns
385 /// [`GraphError::SelfLoop`].
386 pub fn cut(&mut self, source: NodeId, target: NodeId) -> Result<bool, GraphError> {
387 match &mut self.backend {
388 Backend::Compact(graph) => graph.cut(source, target),
389 Backend::EulerTour(graph) => graph.cut(source, target),
390 Backend::Hdt(graph) => graph.cut(source, target),
391 Backend::ClusterForest(graph) => graph.cut(source, target),
392 }
393 }
394
395 /// Returns exact connectivity in the current graph.
396 ///
397 /// Returns [`GraphError::UnknownNode`] for an absent endpoint, checking
398 /// the source first. A known vertex is connected to itself.
399 pub fn connected(&self, source: NodeId, target: NodeId) -> Result<bool, GraphError> {
400 match &self.backend {
401 Backend::Compact(graph) => graph.connected(source, target),
402 Backend::EulerTour(graph) => graph.connected(source, target),
403 Backend::Hdt(graph) => graph.connected(source, target),
404 Backend::ClusterForest(graph) => graph.connected(source, target),
405 }
406 }
407
408 /// Enables neighbor listing on the [`Graph`] engine
409 /// ([`Graph::enable_neighbor_listing`]); does nothing for the experimental
410 /// engines, which cannot list neighbors. Returns whether listing is
411 /// available.
412 pub fn enable_neighbor_listing(&mut self) -> bool {
413 match &mut self.backend {
414 Backend::Compact(graph) => {
415 graph.enable_neighbor_listing();
416 true
417 }
418 Backend::EulerTour(_) | Backend::Hdt(_) | Backend::ClusterForest(_) => false,
419 }
420 }
421
422 /// Returns the [`Graph`] engine when this graph uses
423 /// [`EngineConfig::CompactBfs`], for adjacency inspection with
424 /// [`Graph::degree`] and [`Graph::neighbors_after`]. The experimental engines
425 /// keep no per-node adjacency list, so they return `None`.
426 ///
427 /// ```rust
428 /// use knotrel_core::{ConnectivityGraph, EngineConfig};
429 ///
430 /// let mut graph = ConnectivityGraph::new(EngineConfig::CompactBfs);
431 /// graph.link(1, 2)?;
432 /// assert_eq!(graph.as_compact().and_then(|g| g.degree(1)), Some(1));
433 /// assert!(graph.enable_neighbor_listing());
434 /// assert!(!ConnectivityGraph::new(EngineConfig::Hdt).enable_neighbor_listing());
435 /// assert!(ConnectivityGraph::new(EngineConfig::EulerTour).as_compact().is_none());
436 /// # Ok::<(), knotrel_core::GraphError>(())
437 /// ```
438 #[must_use]
439 pub fn as_compact(&self) -> Option<&Graph> {
440 match &self.backend {
441 Backend::Compact(graph) => Some(graph),
442 Backend::EulerTour(_) | Backend::Hdt(_) | Backend::ClusterForest(_) => None,
443 }
444 }
445
446 /// Returns the number of registered vertices.
447 pub fn node_count(&self) -> usize {
448 match &self.backend {
449 Backend::Compact(graph) => graph.node_count(),
450 Backend::EulerTour(graph) => graph.node_count(),
451 Backend::Hdt(graph) => graph.node_count(),
452 Backend::ClusterForest(graph) => graph.node_count(),
453 }
454 }
455
456 /// Returns the number of undirected edges.
457 pub fn edge_count(&self) -> usize {
458 match &self.backend {
459 Backend::Compact(graph) => graph.edge_count(),
460 Backend::EulerTour(graph) => graph.edge_count(),
461 Backend::Hdt(graph) => graph.edge_count(),
462 Backend::ClusterForest(graph) => graph.edge_count(),
463 }
464 }
465
466 /// Calls `visit` once for every registered vertex, isolated ones included,
467 /// in unspecified order.
468 ///
469 /// **Experimental** (new in 1.3): a bulk read for snapshots and exports,
470 /// available on every engine. `O(V)` time; allocates nothing.
471 ///
472 /// ```rust
473 /// use knotrel_core::{ConnectivityGraph, EngineConfig};
474 ///
475 /// let mut graph = ConnectivityGraph::new(EngineConfig::Hdt);
476 /// graph.link(1, 2)?;
477 /// graph.add_node(7)?;
478 /// let mut nodes = Vec::new();
479 /// graph.for_each_node(|node| nodes.push(node));
480 /// nodes.sort_unstable();
481 /// assert_eq!(nodes, [1, 2, 7]);
482 /// # Ok::<(), knotrel_core::GraphError>(())
483 /// ```
484 pub fn for_each_node(&self, visit: impl FnMut(NodeId)) {
485 match &self.backend {
486 Backend::Compact(graph) => graph.for_each_node(visit),
487 Backend::EulerTour(graph) => graph.ids.keys().copied().for_each(visit),
488 Backend::Hdt(graph) => graph.ids.keys().copied().for_each(visit),
489 Backend::ClusterForest(graph) => graph.for_each_node(visit),
490 }
491 }
492
493 /// Calls `visit(low, high)` once for every undirected edge, with
494 /// `low < high`, in unspecified order.
495 ///
496 /// **Experimental** (new in 1.3): a bulk read for snapshots and exports,
497 /// available on every engine. `O(V + E)` time. It may allocate one
498 /// temporary vector of the vertex IDs (at most 8 bytes per vertex, or
499 /// per internal forest node on `cluster-forest`), freed before it returns.
500 ///
501 /// ```rust
502 /// use knotrel_core::{ConnectivityGraph, EngineConfig};
503 ///
504 /// let mut graph = ConnectivityGraph::new(EngineConfig::EulerTour);
505 /// graph.link(9, 4)?;
506 /// graph.link(4, 5)?;
507 /// let mut edges = Vec::new();
508 /// graph.for_each_edge(|low, high| edges.push((low, high)));
509 /// edges.sort_unstable();
510 /// assert_eq!(edges, [(4, 5), (4, 9)]);
511 /// # Ok::<(), knotrel_core::GraphError>(())
512 /// ```
513 pub fn for_each_edge(&self, visit: impl FnMut(NodeId, NodeId)) {
514 match &self.backend {
515 Backend::Compact(graph) => graph.for_each_edge(visit),
516 // Both engines key their edges by dense index pairs.
517 Backend::EulerTour(graph) => crate::visit_index_edges(
518 graph.ids.iter().map(|(&node, &index)| (node, index)),
519 graph.non_tree.len(),
520 graph.edges.keys().copied(),
521 visit,
522 ),
523 Backend::Hdt(graph) => crate::visit_index_edges(
524 graph.ids.iter().map(|(&node, &index)| (node, index)),
525 graph.ids.len(),
526 graph.edges.keys().copied(),
527 visit,
528 ),
529 Backend::ClusterForest(graph) => graph.for_each_edge(visit),
530 }
531 }
532}
533
534#[cfg(test)]
535mod tests {
536 use super::*;
537
538 /// Releasing storage is a no-op for a vertex with edges, for an absent
539 /// node and for engines other than `compact-bfs`, which report no
540 /// adjacency capacity.
541 #[test]
542 fn release_isolated_storage_is_a_no_op_outside_isolated_compact_vertices() {
543 let mut compact = ConnectivityGraph::new(EngineConfig::CompactBfs);
544 for leaf in 1..=8 {
545 compact.link(0, leaf).unwrap();
546 }
547 let before = compact.adjacency_capacity(0).unwrap();
548 compact.release_isolated_storage(0);
549 assert_eq!(compact.adjacency_capacity(0), Some(before));
550 compact.release_isolated_storage(99);
551 assert_eq!(compact.adjacency_capacity(99), None);
552 assert!(compact.connected(0, 8).unwrap());
553
554 for engine in [
555 EngineConfig::EulerTour,
556 EngineConfig::Hdt,
557 EngineConfig::ClusterForest,
558 ] {
559 let mut other = ConnectivityGraph::new(engine);
560 other.add_node(5).unwrap();
561 other.release_isolated_storage(5);
562 assert_eq!(other.adjacency_capacity(5), None);
563 assert!(other.contains_node(5));
564 }
565 }
566}