pub struct SimdBetweenness;Expand description
SIMD-accelerated operations for betweenness centrality computation.
Accelerates the dependency accumulation phase of Brandes’ algorithm, which is the most compute-intensive part of betweenness centrality.
Implementations§
Source§impl SimdBetweenness
impl SimdBetweenness
Sourcepub fn accumulate_dependencies(
delta: &mut [f64],
sigma: &[f64],
predecessors: &[Vec<usize>],
order: &[usize],
)
pub fn accumulate_dependencies( delta: &mut [f64], sigma: &[f64], predecessors: &[Vec<usize>], order: &[usize], )
SIMD-accelerated dependency accumulation for Brandes’ algorithm.
Updates the dependency values: delta[v] += (sigma[v] / sigma[w]) * (1 + delta[w])
for all predecessors v of w in the shortest-path DAG.
§Arguments
delta- Dependency accumulator vector (modified in place)sigma- Number of shortest paths through each nodepredecessors- For each node w, list of predecessor node indicesorder- Nodes in reverse BFS order (for back-propagation)
Sourcepub fn batch_update_centrality(
centrality: &mut [f64],
delta: &[f64],
source: usize,
)
pub fn batch_update_centrality( centrality: &mut [f64], delta: &[f64], source: usize, )
Batch update betweenness scores from a single-source dependency vector.
Adds the dependency values to the centrality scores using SIMD.
§Arguments
centrality- Running betweenness centrality scores (modified in place)delta- Dependency values from a single-source computationsource- Index of the source node (excluded from update)
Sourcepub fn normalize(centrality: &mut [f64], n: usize, directed: bool)
pub fn normalize(centrality: &mut [f64], n: usize, directed: bool)
Normalize betweenness centrality scores.
For undirected graphs, divide by (n-1)(n-2). For directed graphs, divide by (n-1)(n-2) as well (Brandes’ convention).
§Arguments
centrality- Betweenness scores to normalize (modified in place)n- Number of nodes in the graphdirected- Whether the graph is directed
Auto Trait Implementations§
impl Freeze for SimdBetweenness
impl RefUnwindSafe for SimdBetweenness
impl Send for SimdBetweenness
impl Sync for SimdBetweenness
impl Unpin for SimdBetweenness
impl UnsafeUnpin for SimdBetweenness
impl UnwindSafe for SimdBetweenness
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more