pathcensus.core package
Submodules
pathcensus.core.graph module
Simple JIT-compiled graph class for calculating path census.
- class pathcensus.core.graph.Graph(*args, **kwargs)[source]
Bases:
GraphGraph represented as an edgelist. The edgelist representation is efficient for edge-oriented algorithms such as path census.
- n_nodes
Number of nodes in the graph.
- E
Edgelist as 2D C-contiguous array of unsigned 64-bit integers. It has to be sorted by head indices.
- W
Optional 1D array of 64-bit floats storing edge weights.
- class_type = jitclass.Graph#729d63d16b90<E:array(uint64, 2d, C),D:array(uint64, 1d, C),W:OptionalType(array(float64, 1d, C)),S:OptionalType(array(float64, 1d, C)),_strides:array(uint64, 1d, C)>
pathcensus.core.parallel module
Internal routines for path/cycle counting.
- pathcensus.core.parallel.count_paths_parallel(graph: Graph, batch_size: int = 10, min_di: bool = True, shuffle: bool = True) Tuple[ndarray, ndarray][source]
Count paths and cycles using parallel algorithm.
- Parameters:
graph – Compiled
pathcensus.core.graph.Graphinstance.batch_size – Number of edges processed in one batch. Usually should not be very large, but also cannot be too small. The default value often works quite well.
min_di – Should di < dj rule for iterating over edges be used. See
pathcensus.PathCensus.count_paths()for details. Almost always should be set toTrue. The argument is used mostly for testing purposes.shuffle – Should rows of the edge array be first reshuffled randomly. This often improves performance by decreasing the likelihood of concurrent accesses to the same elements of the edge array by different threads.
pathcensus.core.random module
Numba random number generator utilities.
pathcensus.core.types module
Core types used by compiled code.