Skip to main content

SimdBetweenness

Struct SimdBetweenness 

Source
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

Source

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 node
  • predecessors - For each node w, list of predecessor node indices
  • order - Nodes in reverse BFS order (for back-propagation)
Source

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 computation
  • source - Index of the source node (excluded from update)
Source

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 graph
  • directed - Whether the graph is directed

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V