nx_parallel.algorithms.approximation.connectivity#
Parallel implementations of fast approximation for node connectivity
Functions#
|
The parallel implementation first divides the a list of all permutation (in case |
Module Contents#
- nx_parallel.algorithms.approximation.connectivity.approximate_all_pairs_node_connectivity(G, nbunch=None, cutoff=None, get_chunks='chunks')[source]#
The parallel implementation first divides the a list of all permutation (in case of directed graphs) and combinations (in case of undirected graphs) of nbunch into chunks and then creates a generator to lazily compute the local node connectivities for each chunk, and then employs joblib’s Parallel function to execute these computations in parallel across n_jobs number of CPU cores. At the end, the results are aggregated into a single dictionary and returned.
Note, this function uses the name approximate_all_pairs_node_connectivity while dispatching to the backend in=mplementation. So, nxp.all_pairs_node_connectivity will run the parallel implementation of all_pairs_node_connectivity present in the connectivity/connectivity. Use nxp.approximate_all_pairs_node_connectivity instead.
networkx.all_pairs_node_connectivity : https://networkx.org/documentation/stable/reference/algorithms/generated/networkx.algorithms.approximation.connectivity.all_pairs_node_connectivity.html
Parameters#
- get_chunksstr, function (default = “chunks”)
A function that takes in list(iter_func(nbunch, 2)) as input and returns an iterable pairs_chunks, here iter_func is permutations in case of directed graphs and combinations in case of undirected graphs. The default is to create chunks by slicing the list into n_jobs chunks, such that size of each chunk is atmost 10, and at least 1.