Helios Network Native C API
Native core reference
The C API is the native surface behind the WASM and Python bindings. Functions are grouped by lifecycle, topology, attributes, selectors, serialization, and measurements.
Network Lifecycle
Allocation, destruction, version, and graph-wide metadata helpers.
Topology
Node, edge, neighbor, compaction, and topology mutation APIs.
Attributes
Attribute definition, lookup, categorization, and multi-category APIs.
Buffers And Versions
Direct buffer access and version counters used by high-performance integrations.
Selectors
Node and edge selector containers used for filtering and set operations.
Queries
Query parser and selector APIs.
Serialization
Readers and writers for BXNet, ZXNet, XNet, GML, and node-link JSON.
function
CXNetworkReadBXNet
Reads an uncompressed BXNet file from disk.
function
CXNetworkReadGML
Reads a graph from a GML file. Accepts standard GML and a looser dialect that tolerates quoted keys and unquoted scalar strings. @param path Path to the `.gml` file on disk. @return Newly allocated network when successful, otherwise NULL.
function
CXNetworkReadGT
Reads a graph-tool `.gt` binary graph file. Supports the v1 graph-tool wire format, including endian-aware topology loading and the scalar/vector property-map types that map cleanly to Helios attributes. Unsupported or lossy property maps are skipped and reported via `CXNetworkSerializationLastWarningMessage()`. @param path Path to the `.gt` file on disk. @return Newly allocated network when successful, otherwise NULL.
function
CXNetworkReadXNet
Reads a graph from an `.xnet` (XNET 1.0.0 or legacy) container. @param path Path to the XNET file on disk. @return Newly allocated network when successful, otherwise NULL.
function
CXNetworkReadZXNet
Reads a BGZF-compressed ZXNet file from disk.
function
CXNetworkSerializationLastWarningMessage
Returns the last non-fatal serialization warning emitted by a save/load helper.
function
CXNetworkSerializationWarningAppend
Appends a formatted message to the shared serialization warning buffer.
function
CXNetworkSerializationWarningClear
Clears the shared serialization warning buffer.
function
CXNetworkWriteActiveEdgeNodeAttributes
Writes `componentsPerNode` values for each endpoint of active edges from the provided node attribute buffer into a caller-managed destination. Values are copied verbatim; the caller controls element width (`componentSizeBytes`) and must ensure the typed views line up with the provided byte offsets. Returns the number of edges that would be written; when `dstCapacityEdges` is too small, the required count is returned and no writes occur.
function
CXNetworkWriteActiveEdges
Writes active edge indices into caller-provided storage. When `capacity` is insufficient the required size is returned and no writes occur.
function
CXNetworkWriteActiveEdgeSegments
Writes two position vectors per active edge directly into the provided buffer. `componentsPerNode` describes how many floats to copy per endpoint (commonly 4 for vec4 data). Returns the number of edges that would be written; when `dstCapacityEdges` is too small, the required count is returned and no writes occur.
function
CXNetworkWriteActiveNodes
Writes active node indices into caller-provided storage. When `capacity` is insufficient the required size is returned and no writes occur.
function
CXNetworkWriteBXNet
Writes an uncompressed binary BXNet file to disk.
function
CXNetworkWriteBXNetFiltered
Writes a BXNet file while allowing or ignoring selected attributes by scope.
function
CXNetworkWriteGML
Serializes a network as GML. Lossy cases (for example unsupported attribute payloads or renamed keys) are reported via `CXNetworkSerializationLastWarningMessage()`. @param network Network to serialize. @param path Output path for the `.gml` file. @return CXTrue on success, CXFalse on failure.
function
CXNetworkWriteGT
Serializes a network as a graph-tool `.gt` binary graph file. `.gt` is an interoperability format. Helios-specific state and unsupported attributes may be skipped or converted, with warnings reported via `CXNetworkSerializationLastWarningMessage()`. @param network Network to serialize. @param path Output path for the `.gt` file. @return CXTrue on success, CXFalse on failure.
function
CXNetworkWriteNodeLinkJSON
Serializes a network as node-link JSON compatible with common D3/NetworkX style payloads. Lossy cases are reported via `CXNetworkSerializationLastWarningMessage()`. @param network Network to serialize. @param path Output path for the `.json` file. @return CXTrue on success, CXFalse on failure.
function
CXNetworkWriteXNet
Serializes a network using the XNET 1.0.0 human-readable container. Performs compaction to ensure contiguous node and edge indices before writing. Adds the `_original_ids_` vertex attribute to preserve the original node identifiers. @param network Network to serialize. @param path Output path for the `.xnet` file. @return CXTrue on success, CXFalse on failure.
function
CXNetworkWriteXNetFiltered
Serializes an XNET file while allowing or ignoring selected attributes. Attribute filters are split by node, edge, and graph/network scope. @param network Network to serialize. @param path Output path for the `.xnet` file. @return CXTrue on success, CXFalse on failure.
function
CXNetworkWriteZXNet
Writes a BGZF-compressed ZXNet file to disk.
function
CXNetworkWriteZXNetFiltered
Writes a ZXNet file while allowing or ignoring selected attributes by scope.
Measurements
One-shot graph measurements such as degree, strength, clustering, dimension, and centrality.
function
CXNetworkLeidenModularity
Runs Leiden community detection optimizing (weighted) modularity. - For undirected graphs, uses the standard modularity objective. - For directed graphs, uses the directed modularity formulation. - `resolution` corresponds to the modularity resolution parameter (gamma). - When `edgeWeightAttribute` is NULL/empty, every edge has weight 1. Writes the resulting community id into a node attribute (created when missing) of type `CXUnsignedIntegerAttributeType` and dimension 1. Returns the number of detected communities, or 0 on failure.
function
CXNetworkMeasureBetweennessCentrality
Runs Brandes betweenness centrality (weighted when an edge weight attribute is provided, unweighted otherwise). - `sourceNodes` can restrict the set of source nodes used by the algorithm. When NULL/empty, all active nodes are used. - Set `accumulate` to CXTrue to add into `inOutNodeBetweenness` instead of clearing it first (useful for chunked stepping). - Output buffer length must be at least `CXNetworkNodeCapacity(network)`. Returns the number of source nodes actually processed.
function
CXNetworkMeasureConnectedComponents
Measures connected components. - Weak mode treats directed edges as undirected (weakly-connected components). - Strong mode computes strongly-connected components on directed graphs. Undirected graphs behave like weak mode. Component ids are written into `outNodeComponent` (length must be at least `CXNetworkNodeCapacity(network)`). Inactive nodes receive id `0`. Returns the number of detected components.
function
CXNetworkMeasureCoreness
Measures node coreness (k-core index) for all node capacity indices. - Uses iterative peeling over the chosen degree policy (`direction`). - For directed graphs: - `Out` uses outgoing degree. - `In` uses incoming degree. - `Both` uses incoming + outgoing degree. - For undirected graphs, direction is normalized to undirected degree. Output buffer length must be at least `CXNetworkNodeCapacity(network)`. Inactive nodes receive coreness 0.
function
CXNetworkMeasureDegree
Measures node degree for every node index (inactive nodes receive 0). Output buffer length must be at least `CXNetworkNodeCapacity(network)`.
function
CXNetworkMeasureDimension
Computes global multiscale dimension statistics over a node set. - If `nodes` is NULL or `nodeCount` is 0, all active nodes are used. - Invalid/inactive node ids in `nodes` are ignored. - Output buffers, when non-null, must each have length `maxLevel + 1`. Returns the number of nodes actually measured.
function
CXNetworkMeasureEigenvectorCentrality
Runs power-iteration eigenvector centrality. - `initialNodeCentrality`, when non-null, must have one value per node capacity index and is used as the initial vector. - `outNodeCentrality` must have one value per node capacity index. - `executionMode` allows callers to force single-thread or parallel mode.
function
CXNetworkMeasureLocalClusteringCoefficient
Measures local clustering coefficients for all node indices. - `variant` selects the unweighted or weighted formulation. - Weighted variants read `edgeWeightAttribute` (unit weights when omitted). Output buffer length must be at least `CXNetworkNodeCapacity(network)`.
function
CXNetworkMeasureNodeDimension
Computes local multiscale capacity and dimension for a single node. - `maxLevel` controls the largest geodesic radius r evaluated. - `method` and `order` select the derivative estimator (FW/BK/CE/LS). - `outCapacity` and `outDimension`, when non-null, must point to buffers of length `maxLevel + 1`. Returns CXFalse when the node is invalid/inactive or on allocation failure.
function
CXNetworkMeasureStrength
Measures node strength from an edge weight attribute (or unit weights when `edgeWeightAttribute` is NULL/empty). Output buffer length must be at least `CXNetworkNodeCapacity(network)`.
Measurement Sessions
Steppable native measurement sessions for long-running algorithms.
Coverage Notes
The extractor reads CX_EXTERN declarations and the nearest preceding Doxygen-style block comment. Internal bundled headers and uthash/utarray compatibility headers are intentionally excluded. For more precise grouping later, add a section annotation to the Doxygen block and wire it into scripts/generate_api_reference.py.
- No missing C comment summaries detected for extracted declarations.