nxbench.backends package¶
Submodules¶
nxbench.backends.core module¶
- class nxbench.backends.core.BackendManager[source]¶
Bases:
object
A registry for dynamically registering and configuring networkx backends.
- The registry maps:
- backend_name (str) ->
(import_name, conversion_func, teardown_func)
- where:
import_name (str) is the actual module name to import
conversion_func(nx_graph, num_threads) -> typed backend graph
teardown_func() -> None (optional)
- configure_backend(name, original_graph, num_threads)[source]¶
Convert the given networkx.Graph to the backend-specific representation.
- get_version(name)[source]¶
Retrieve the version for the given backend by its import_name. If not installed, returns “unknown”.
- register_backend(name, import_name, conversion_func, teardown_func=None)[source]¶
Register a new backend with a given name, import_name, conversion function, and optional teardown function.
- Example:
- register_backend(
name=”networkx”, import_name=”networkx”, conversion_func=convert_networkx, teardown_func=teardown_networkx
)