pub trait Level: Sync {
type Output;
type OutputSymm;
// Required methods
fn run(
graph: impl RandomAccessGraph + Sync,
transpose: impl RandomAccessGraph + Sync,
radial_vertices: Option<AtomicBitVec>,
thread_pool: &ThreadPool,
pl: &mut impl ConcurrentProgressLog,
) -> Self::Output;
fn run_symm(
graph: impl RandomAccessGraph + Sync,
thread_pool: &ThreadPool,
pl: &mut impl ConcurrentProgressLog,
) -> Self::OutputSymm;
}
Expand description
Trait used to run the ExactSumSweep algorithm.
This trait can be used to run the algorithm either providing a graph and its transpose or using a symmetric graph.
It is implemented by the following structs: All
, AllForward
,
RadiusDiameter
, Diameter
, and Radius
, which correspond to
different level of computation, with decreasing cost in term of memory and
execution time.
§Examples
See the module documentation.
Required Associated Types§
Sourcetype OutputSymm
type OutputSymm
The type of the result of run_symm
.
Required Methods§
Sourcefn run(
graph: impl RandomAccessGraph + Sync,
transpose: impl RandomAccessGraph + Sync,
radial_vertices: Option<AtomicBitVec>,
thread_pool: &ThreadPool,
pl: &mut impl ConcurrentProgressLog,
) -> Self::Output
fn run( graph: impl RandomAccessGraph + Sync, transpose: impl RandomAccessGraph + Sync, radial_vertices: Option<AtomicBitVec>, thread_pool: &ThreadPool, pl: &mut impl ConcurrentProgressLog, ) -> Self::Output
Runs the ExactSumSweep algorithm on the specified graph.
§Arguments
-
graph
: a graph. -
transpose
: the transpose ofgraph
. Note that you are responsible for providing a correct transpose. The result of the computation is undefined otherwise. -
radial_vertices
: anAtomicBitVec
wherev[i]
is true if nodei
is to be considered radial vertex. IfNone
the algorithm will use the biggest connected component. -
thread_pool
: The thread pool to use for parallel computations. -
pl
: a progress logger.
Sourcefn run_symm(
graph: impl RandomAccessGraph + Sync,
thread_pool: &ThreadPool,
pl: &mut impl ConcurrentProgressLog,
) -> Self::OutputSymm
fn run_symm( graph: impl RandomAccessGraph + Sync, thread_pool: &ThreadPool, pl: &mut impl ConcurrentProgressLog, ) -> Self::OutputSymm
Runs the ExactSumSweep algorithm on the specified symmetric graph.
§Arguments
-
graph
: a symmetric graph. Note that you are responsible for the graph being symmetric. The result of the computation is undefined otherwise. -
thread_pool
: The thread pool to use for parallel computations. -
pl
: a progress logger.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.