pub struct EigenvectorCentrality;Expand description
Eigenvector Centrality algorithm implementation.
Eigenvector centrality assigns importance scores to nodes based on connections to important nodes. The algorithm uses the power iteration method to compute the dominant eigenvector of the adjacency matrix.
Implementations§
Source§impl EigenvectorCentrality
impl EigenvectorCentrality
Sourcepub fn compute<T: Transaction>(
tx: &T,
config: &EigenvectorCentralityConfig,
) -> GraphResult<EigenvectorCentralityResult>
pub fn compute<T: Transaction>( tx: &T, config: &EigenvectorCentralityConfig, ) -> GraphResult<EigenvectorCentralityResult>
Compute eigenvector centrality for all nodes in the graph.
§Arguments
tx- The transaction to use for graph accessconfig- Configuration parameters for the algorithm
§Returns
An EigenvectorCentralityResult containing scores for all nodes.
§Algorithm
Uses the power iteration method:
- Initialize all nodes with score 1/√n
- Iteratively update scores: x(k+1) = A * x(k)
- Normalize after each iteration
- Check for convergence
Sourcepub fn compute_for_nodes<T: Transaction>(
tx: &T,
nodes: &[EntityId],
config: &EigenvectorCentralityConfig,
) -> GraphResult<EigenvectorCentralityResult>
pub fn compute_for_nodes<T: Transaction>( tx: &T, nodes: &[EntityId], config: &EigenvectorCentralityConfig, ) -> GraphResult<EigenvectorCentralityResult>
Compute eigenvector centrality for a subset of nodes.
Only considers edges within the specified subgraph.
§Arguments
tx- The transaction to use for graph accessnodes- The nodes to include in the computationconfig- Configuration parameters for the algorithm
Auto Trait Implementations§
impl Freeze for EigenvectorCentrality
impl RefUnwindSafe for EigenvectorCentrality
impl Send for EigenvectorCentrality
impl Sync for EigenvectorCentrality
impl Unpin for EigenvectorCentrality
impl UnsafeUnpin for EigenvectorCentrality
impl UnwindSafe for EigenvectorCentrality
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