Skip to main content

Module convert

Module convert 

Source
Available on crate feature convert only.
Expand description

Conversions to/from hyperedge lists/dicts, bipartite edgelists, bipartite petgraph graphs, the 1-skeleton graph, and order-cutting. (XGI 1.0 dropped its hypergraph dict; so did this module.)

Ported from xgi/convert/. Operates on the default Hypergraph (serde_json::Value attrs). The pandas slice is NOT ported (spec §4.4); HIF, encapsulation-DAG, line-graph, simplex, and incidence conversions are deferred (see the Phase-6 plan open questions).

Structs§

BipartiteNode
A vertex of a bipartite representation: an id plus a layer marker.

Enums§

ConvertError
Errors raised by conversion functions.

Functions§

cut_to_order
A copy of the hypergraph keeping only edges of order ≤ order.
from_bipartite_edgelist
Build a hypergraph from a bipartite edgelist of (node, edge) pairs.
from_bipartite_graph
Reconstruct a hypergraph from a bipartite petgraph graph.
from_hyperedge_dict
Build a hypergraph from an id→members dict (preserving ids).
from_hyperedge_list
Build a hypergraph from a list of hyperedges (auto-generated ids).
to_bipartite_edgelist
Extract a bipartite edgelist of (node, edge) pairs (edge order, then member order).
to_bipartite_graph
Build a bipartite petgraph graph: node-layer + edge-layer vertices, one arc per membership (node -> hyperedge).
to_graph
The unweighted 1-skeleton (graph projection) of the hypergraph.
to_hyperedge_dict
Extract the id→members dict (edge insertion order).
to_hyperedge_list
Extract the hyperedge list (members per edge, edge insertion order).