Expand description
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.
Structs§
- Bcsr
Element Incidences - Iterator yielding incidence IDs for one vertex’s incidences.
- Bcsr
Hyperedge Id - Local hyperedge ID for
BcsrHypergraph. - Bcsr
Hypergraph - Borrowed bipartite compressed-sparse-row hypergraph view.
- Bcsr
Participant Id - Local participant (incidence) ID for
BcsrHypergraph. - Bcsr
Participant Slice - Iterator yielding incidence IDs for a contiguous incidence range.
- Bcsr
Sections - Borrowed input slices for a bipartite-CSR hypergraph view.
- Bcsr
Vertex Id - Local vertex ID for
BcsrHypergraph.
Enums§
- Bcsr
Error - Bipartite-CSR validation error.
- Bcsr
Role - Side of a directed hyperedge an incidence belongs to.
- Bcsr
Role Side - Side of the bipartite index that produced a cross-direction mismatch.
- Bcsr
Section - Names a single bipartite-CSR section for error reporting.
- Bcsr
Snapshot Error - Error returned when a snapshot cannot be opened as a bipartite-CSR hypergraph view.
- Bcsr
Validation - Validation depth applied at view open time.
Constants§
- SNAPSHOT_
KIND_ BCSR_ HEAD_ OFFSETS_ U16 - Hyperedge-major head offsets,
u16little-endian. - SNAPSHOT_
KIND_ BCSR_ HEAD_ OFFSETS_ U32 - Hyperedge-major head offsets,
u32little-endian. - SNAPSHOT_
KIND_ BCSR_ HEAD_ OFFSETS_ U64 - Hyperedge-major head offsets,
u64little-endian. - SNAPSHOT_
KIND_ BCSR_ HEAD_ PARTICIPANTS_ U16 - Hyperedge-major head participants,
u16little-endian. - SNAPSHOT_
KIND_ BCSR_ HEAD_ PARTICIPANTS_ U32 - Hyperedge-major head participants,
u32little-endian. - SNAPSHOT_
KIND_ BCSR_ HEAD_ PARTICIPANTS_ U64 - Hyperedge-major head participants,
u64little-endian. - SNAPSHOT_
KIND_ BCSR_ TAIL_ OFFSETS_ U16 - Hyperedge-major tail offsets,
u16little-endian. - SNAPSHOT_
KIND_ BCSR_ TAIL_ OFFSETS_ U32 - Hyperedge-major tail offsets,
u32little-endian. - SNAPSHOT_
KIND_ BCSR_ TAIL_ OFFSETS_ U64 - Hyperedge-major tail offsets,
u64little-endian. - SNAPSHOT_
KIND_ BCSR_ TAIL_ PARTICIPANTS_ U16 - Hyperedge-major tail participants,
u16little-endian. - SNAPSHOT_
KIND_ BCSR_ TAIL_ PARTICIPANTS_ U32 - Hyperedge-major tail participants,
u32little-endian. - SNAPSHOT_
KIND_ BCSR_ TAIL_ PARTICIPANTS_ U64 - Hyperedge-major tail participants,
u64little-endian. - SNAPSHOT_
KIND_ BCSR_ VERTEX_ INCOMING_ HYPEREDGES_ U16 - Vertex-major incoming hyperedge IDs,
u16little-endian. - SNAPSHOT_
KIND_ BCSR_ VERTEX_ INCOMING_ HYPEREDGES_ U32 - Vertex-major incoming hyperedge IDs,
u32little-endian. - SNAPSHOT_
KIND_ BCSR_ VERTEX_ INCOMING_ HYPEREDGES_ U64 - Vertex-major incoming hyperedge IDs,
u64little-endian. - SNAPSHOT_
KIND_ BCSR_ VERTEX_ INCOMING_ OFFSETS_ U16 - Vertex-major incoming offsets,
u16little-endian. - SNAPSHOT_
KIND_ BCSR_ VERTEX_ INCOMING_ OFFSETS_ U32 - Vertex-major incoming offsets,
u32little-endian. - SNAPSHOT_
KIND_ BCSR_ VERTEX_ INCOMING_ OFFSETS_ U64 - Vertex-major incoming offsets,
u64little-endian. - SNAPSHOT_
KIND_ BCSR_ VERTEX_ OUTGOING_ HYPEREDGES_ U16 - Vertex-major outgoing hyperedge IDs,
u16little-endian. - SNAPSHOT_
KIND_ BCSR_ VERTEX_ OUTGOING_ HYPEREDGES_ U32 - Vertex-major outgoing hyperedge IDs,
u32little-endian. - SNAPSHOT_
KIND_ BCSR_ VERTEX_ OUTGOING_ HYPEREDGES_ U64 - Vertex-major outgoing hyperedge IDs,
u64little-endian. - SNAPSHOT_
KIND_ BCSR_ VERTEX_ OUTGOING_ OFFSETS_ U16 - Vertex-major outgoing offsets,
u16little-endian. - SNAPSHOT_
KIND_ BCSR_ VERTEX_ OUTGOING_ OFFSETS_ U32 - Vertex-major outgoing offsets,
u32little-endian. - SNAPSHOT_
KIND_ BCSR_ VERTEX_ OUTGOING_ OFFSETS_ U64 - Vertex-major outgoing offsets,
u64little-endian.
Traits§
- Bcsr
Index - Unsigned native index type usable in bipartite-CSR memory views.
- Bcsr
Snapshot Index - Portable index width usable for persisted BCSR snapshot payloads.
- Bcsr
Snapshot Word - Little-endian zerocopy word usable when opening BCSR data from a snapshot.
- Bcsr
Word - Integer word usable in borrowed bipartite-CSR sections.
Type Aliases§
- Bcsr
Chained Hyperedges - Chained hyperedge iterator yielding outgoing then incoming hyperedges.
- Bcsr
Chained Participants - Chained vertex iterator yielding head participants then tail participants.
- Bcsr
Chained Relation Incidences - Chained participant-ID iterator yielding head incidences then tail incidences for a single hyperedge.
- Bcsr
Hyperedge Slice - Iterator over a borrowed slice of hyperedge words.
- Bcsr
Native Hypergraph - Native borrowed BCSR hypergraph alias.
- Bcsr
Predecessor Vertices - Iterator over predecessor vertices of a directed-hypergraph vertex.
- Bcsr
Snapshot Hypergraph - Snapshot-backed BCSR hypergraph alias.
- Bcsr
Successor Vertices - Iterator over successor vertices of a directed-hypergraph vertex.
- Bcsr
Vertex Slice - Iterator over a borrowed slice of vertex words.