Skip to content

Leiden and Louvain Sequential Algorithms - #417

Draft
GomezGab wants to merge 13 commits into
v1.3.xfrom
gg/leiden
Draft

Leiden and Louvain Sequential Algorithms#417
GomezGab wants to merge 13 commits into
v1.3.xfrom
gg/leiden

Conversation

@GomezGab

Copy link
Copy Markdown
Collaborator

These algorithms are not very parrallel, but they use GraphBLAS where possible, and are a good starting point for possible future implementations of these.

Comment on lines +58 to +60
GrB_Vector k = NULL, com_deg = NULL;
GrB_Matrix B = NULL;
GrB_Matrix BS = NULL;
GrB_Matrix S_BS = NULL;
GrB_Matrix Diag = NULL;
GrB_Matrix mask = NULL;
GrB_Matrix S_t = NULL;

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add comments to for GraphBLAS objects

GRB_TRY(GrB_Matrix_new(&BS, GrB_FP64, n, n));
GRB_TRY(GrB_Matrix_new(&S_BS, GrB_FP64, n, n));
GRB_TRY(GrB_Matrix_new(&Diag, GrB_FP64, n, n));
GxB_print(A, 2);

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove print statements

Comment on lines +99 to +100
// sum all of the products
// this computed \sum_{i,j} (k_{i}k_{j}\delta(\sigma_i\sigma_j))

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// sum all of the products
// this computed \sum_{i,j} (k_{i}k_{j}\delta(\sigma_i\sigma_j))
// sum the squares of the total wieght in each community

Comment on lines +30 to +42
#if LG_LEIDEN_TIMING
#define LG_LEIDEN_TIC(t) double t = LAGraph_WallClockTime ( )
#define LG_LEIDEN_ELAPSED(t) (LAGraph_WallClockTime ( ) - (t))
#define LG_LEIDEN_PRINTF(...) printf (__VA_ARGS__)
#define LG_LEIDEN_BURBLE_ON GRB_TRY (LG_SET_BURBLE (false))
#define LG_LEIDEN_BURBLE_OFF GRB_TRY (LG_SET_BURBLE (false))
#else
#define LG_LEIDEN_TIC(t)
#define LG_LEIDEN_ELAPSED(t) (0.0)
#define LG_LEIDEN_PRINTF(...)
#define LG_LEIDEN_BURBLE_ON
#define LG_LEIDEN_BURBLE_OFF
#endif

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

simplify timing (don't add arguments to the helper functions)

Comment on lines +133 to +135
uint64_t *nodes_popped_handle, // queue pops in this phase
uint64_t *nodes_evaluated_handle, // non-singleton nodes evaluated
uint64_t *nodes_moved_handle, // nodes moved to a new community

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove timing variables

Comment on lines +541 to +543
GrB_Matrix *S, // sub-communities to agregate
GrB_Matrix *C, // communities to preserve
GrB_Matrix *A, // adjacency matrix

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seperate inputs and outputs like in Louvain

GrB_Info LAGraph_louvain
(
GrB_Vector *com, // output communities
LAGraph_Graph G, // graph adjacency matrix

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
LAGraph_Graph G, // graph adjacency matrix
const LAGraph_Graph G, // graph adjacency matrix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants