nx_parallel.interface#
Classes#
A wrapper class for networkx.Graph, networkx.DiGraph, networkx.MultiGraph, |
|
BackendInterface class for parallel algorithms. |
Module Contents#
- class nx_parallel.interface.ParallelGraph(graph_object=None)[source]#
A wrapper class for networkx.Graph, networkx.DiGraph, networkx.MultiGraph, and networkx.MultiDiGraph.
- class nx_parallel.interface.BackendInterface[source]#
BackendInterface class for parallel algorithms.
- static convert_from_nx(graph, *args, **kwargs)[source]#
Convert a networkx.Graph, networkx.DiGraph, networkx.MultiGraph, or networkx.MultiDiGraph to a ParallelGraph.
- static convert_to_nx(result, *, name=None)[source]#
Convert a ParallelGraph to a networkx.Graph, networkx.DiGraph, networkx.MultiGraph, or networkx.MultiDiGraph.
- classmethod should_run(name, args, kwargs)[source]#
Determine whether this backend should run the specified algorithm with the given arguments.
Parameters#
- clstype
BackendInterface class
- namestr
Name of the target algorithm
- argstuple
Positional arguments passed to the algorithm’s should_run.
- kwargsdict
Keyword arguments passed to the algorithm’s should_run.
Returns#
- bool or str
If the algorithm should run, returns True. Otherwise, returns a string explaining why parallel execution is skipped.