Cyclops Tensor Framework
parallel arithmetic on multidimensional arrays
|
betweenness centrality computation More...
Namespaces | |
CTF | |
Functions | |
void | btwn_cnt_fast (Matrix< int > A, int b, Vector< double > &v, int nbatches=0, bool sp_B=true, bool sp_C=true) |
fast algorithm for betweenness centrality using Bellman Ford More... | |
void | btwn_cnt_naive (Matrix< int > &A, Vector< double > &v) |
naive algorithm for betweenness centrality using 3D tensor of counts More... | |
int | btwn_cnt (int n, World &dw, double sp=.20, int bsize=2, int nbatches=1, int test=0, bool sp_B=1, bool sp_C=1) |
char * | getCmdOption (char **begin, char **end, const std::string &option) |
int | main (int argc, char **argv) |
betweenness centrality computation
int btwn_cnt | ( | int | n, |
World & | dw, | ||
double | sp = .20 , |
||
int | bsize = 2 , |
||
int | nbatches = 1 , |
||
int | test = 0 , |
||
bool | sp_B = 1 , |
||
bool | sp_C = 1 |
||
) |
Definition at line 210 of file btwn_central.cxx.
References ctf.core::a, ctf.core::b, CTF::Timer_epoch::begin(), btwn_cnt_fast(), btwn_cnt_naive(), CTF::Timer_epoch::end(), CTF::Tensor< dtype >::norm2(), CTF::World::np, CTF::World::rank, and SP.
Referenced by main().
void btwn_cnt_fast | ( | Matrix< int > | A, |
int | b, | ||
Vector< double > & | v, | ||
int | nbatches = 0 , |
||
bool | sp_B = true , |
||
bool | sp_C = true |
||
) |
fast algorithm for betweenness centrality using Bellman Ford
[in] | A | matrix on the tropical semiring containing edge weights |
[in] | b | number of source vertices for which to compute Bellman Ford at a time |
[out] | v | vector that will contain centrality scores for each vertex |
[in] | nbatches | number of batches (sets of nodes of size b) to compute on (0 means all) |
[in] | sp_B | whether to store second operand as sparse |
[in] | sp_C | whether to store output as sparse |
Definition at line 35 of file btwn_central.cxx.
References ctf.core::a, ctf.core::b, cpath::c, get_Bellman_kernel(), get_Brandes_kernel(), get_cpath_monoid(), get_mpath_semiring(), CTF::Scalar< dtype >::get_val(), CTF_int::tensor::nnz_tot, CTF::Matrix< dtype >::nrow, CTF::World::rank, CTF_int::tensor::set_zero(), CTF::Tensor< dtype >::slice(), SP, CTF::Tensor< dtype >::sparsify(), speye(), CTF::Timer::start(), CTF::Timer::stop(), mpath::w, cpath::w, ctf.core::w, and CTF_int::tensor::wrld.
Referenced by btwn_cnt().
naive algorithm for betweenness centrality using 3D tensor of counts
[in] | A | matrix on the tropical semiring containing edge weights |
[out] | v | vector that will contain centrality scores for each vertex |
Definition at line 163 of file btwn_central.cxx.
References ctf.core::a, ctf.core::b, get_cpath_monoid(), get_mpath_semiring(), CTF::Matrix< dtype >::nrow, ctf.core::w, and CTF_int::tensor::wrld.
Referenced by btwn_cnt().
char* getCmdOption | ( | char ** | begin, |
char ** | end, | ||
const std::string & | option | ||
) |
Definition at line 306 of file btwn_central.cxx.
Referenced by main().
int main | ( | int | argc, |
char ** | argv | ||
) |
Definition at line 317 of file btwn_central.cxx.
References btwn_cnt(), getCmdOption(), ctf.core::np(), and ctf.core::rank().