1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
//! Borrowed bipartite compressed-sparse-row hypergraph views.
//!
//! `oxgraph-hyper-bcsr` provides the first concrete hypergraph layout for the
//! substrate. A [`BcsrHypergraph`] borrows eight validated CSR slices — one
//! offset/value pair per direction per role — and implements the
//! storage-agnostic hypergraph traits from `oxgraph-hyper`.
//!
//! Bipartite CSR keeps both directions dense: head and tail participants are
//! stored under a hyperedge-major index, while outgoing and incoming
//! incidences are stored under a vertex-major index. This trades roughly four
//! times the participant storage for `O(degree)` traversal in either
//! direction, which is the only access pattern that scales for read-heavy
//! workloads.
//!
//! # Layout summary
//!
//! Eight sections compose the snapshot bytes consumed by [`BcsrHypergraph`]:
//!
//! | Section kind | Logical content |
//! | --------------------------------------- | -------------------------------------------------------------------------- |
//! Snapshot section kinds are width-specific. Vertex participant sections use
//! the selected vertex width, relation sections use the selected relation
//! width, and all offset sections use the selected incidence width.
//!
//! # Validation
//!
//! Section payloads are validated at open time. [`BcsrValidation::Layout`]
//! covers length, offset monotonicity, in-range IDs, and per-range
//! sorted-and-unique vertex / hyperedge sequences. [`BcsrValidation::Strict`]
//! additionally checks cross-CSR consistency — that hyperedge-major and
//! vertex-major arrays describe the same incidence set. `Layout` is the
//! default for trusted producers; `Strict` is required for end-to-end
//! semantic guarantees on untrusted inputs.
//!
//! # Optional builder
//!
//! The `build` feature enables the append-only [`build::HypergraphBuilder`]
//! and [`build::WeightedHypergraphBuilder`] types plus snapshot export
//! helpers in the [`build`] submodule. The additional `build-property-arrow`
//! feature enables property-snapshot export via `oxgraph-property`.
extern crate alloc;
extern crate kani;
pub use crate::;
/// Native borrowed BCSR hypergraph alias.
///
/// # Performance
///
/// `perf: unspecified`; this alias carries no runtime cost.
pub type BcsrNativeHypergraph<'view, VertexIndex, RelationIndex, IncidenceIndex> =
;
/// Snapshot-backed BCSR hypergraph alias.
///
/// # Performance
///
/// `perf: unspecified`; this alias carries no runtime cost.
pub type BcsrSnapshotHypergraph<'view, VertexIndex, RelationIndex, IncidenceIndex> =
;