GraphBLAS / LAGraph

This is a library plus a test harness for collecting algorithms that use the GraphBLAS. For test coverage reports, see https://graphblas.org/LAGraph/ . Documentation: https://lagraph.readthedocs.org
Other
230 stars 61 forks source link

Listing LAGraph algorithms function signatures #84

Closed swilly22 closed 4 years ago

swilly22 commented 4 years ago

Source files sharing the same signature are grouped.

LAGraphX_bc_batch.c LAGraphX_bc_batch2.c

GrB_Info LAGraphX_bc_batch // betweeness centrality, batch algorithm
(
    GrB_Vector *centrality,    // centrality(i) is the betweeness centrality of node i
    const GrB_Matrix A_matrix, // input graph, treated as if boolean in semiring
    const GrB_Index *sources,  // source vertices from which to compute shortest paths
    int32_t num_sources        // number of source vertices (length of s)
)

LAGraphX_bc_batch3.c

GrB_Info LAGraphX_bc_batch3 // betweeness centrality, batch algorithm
(
    GrB_Vector *centrality,    // centrality(i): betweeness centrality of node i
    const GrB_Matrix A_matrix, // input graph
    const GrB_Matrix AT_matrix, // A'
    const GrB_Index *sources,  // source vertices for shortest paths
    int32_t num_sources,                 // number of source vertices (length of s)
    double timing [3]
)

LAGraph_BF_basic.c

GrB_Info LAGraph_BF_basic
(
    GrB_Vector *pd_output,      //the pointer to the vector of distance
    const GrB_Matrix A,         //matrix for the graph
    const GrB_Index s           //given index of the source
)

LAGraph_BF_basic_pushpull.c

GrB_Info LAGraph_BF_basic_pushpull
(
    GrB_Vector *pd_output,      //the pointer to the vector of distance
    const GrB_Matrix A,         //matrix for the graph
    const GrB_Matrix AT,        //transpose of A (optional)
    const GrB_Index s           //given index of the source
)

LAGraph_BF_full.c LAGraph_BF_full1a.c

GrB_Info LAGraph_BF_full
(
    GrB_Vector *pd_output,      //the pointer to the vector of distance
    GrB_Vector *ppi_output,     //the pointer to the vector of parent
    GrB_Vector *ph_output,       //the pointer to the vector of hops
    const GrB_Matrix A,         //matrix for the graph
    const GrB_Index s           //given index of the source
)

LAGraph_BF_pure_c.c

GrB_Info LAGraph_BF_pure_c
(
    int32_t **pd,     // pointer to distance vector d, d(k) = shorstest distance
                     // between s and k if k is reachable from s
    int64_t **ppi,   // pointer to parent index vector pi, pi(k) = parent of
                     // node k in the shortest path tree
    const int64_t s, // given source node index
    const int64_t n, // number of nodes
    const int64_t nz,// number of edges
    const int64_t *I,// row index vector
    const int64_t *J,// column index vector
    const int32_t  *W // weight vector, W(i) = weight of edge (I(i),J(i))
)

LAGraph_allktruss.c

GrB_Info LAGraph_allktruss      // compute all k-trusses of a graph
(
    GrB_Matrix *Cset,           // size n, output k-truss subgraphs (optional)
    GrB_Matrix A,               // input adjacency matrix, A, not modified
    // output statistics
    int64_t *kmax,              // smallest k where k-truss is empty
    int64_t *ntris,             // size n, ntris [k] is #triangles in k-truss
    int64_t *nedges,            // size n, nedges [k] is #edges in k-truss
    int64_t *nstepss            // size n, nstepss [k] is #steps for k-truss
)

LAGraph_bc.c LAGraph_bc2.c

GrB_Info LAGraph_bc     // betweeness centrality
(
    GrB_Vector *centrality, // centrality(i) is the betweeness centrality of node i
    GrB_Matrix A_matrix,    // input graph, treated as if boolean in semiring
    GrB_Index source        // source vertex from which to compute shortest paths
)

LAGraph_bc_batch.c

GrB_Info LAGraph_bc_batch // betweeness centrality, batch algorithm
(
    GrB_Vector *centrality,    // centrality(i) is the betweeness centrality of node i
    const GrB_Matrix A_matrix, // input graph, treated as if boolean in semiring
    const GrB_Index *sources,  // source vertices from which to compute shortest paths
    int32_t num_sources        // number of source vertices (length of s)
)

LAGraph_bc_batch3.c LAGraph_bc_batch4.c

GrB_Info LAGraph_bc_batch3 // betweeness centrality, batch algorithm
(
    GrB_Vector *centrality,    // centrality(i) is the betweeness centrality of node i
    const GrB_Matrix A_matrix, // input graph, treated as if boolean in semiring
    const GrB_Matrix AT_matrix, // A'
    const GrB_Index *sources,  // source vertices from which to compute shortest paths
    int32_t num_sources        // number of source vertices (length of s)
)

LAGraph_bfs_both.c

GrB_Info LAGraph_bfs_both       // push-pull BFS, or push-only if AT = NULL
(
    GrB_Vector *v_output,   // v(i) is the BFS level of node i in the graph
    GrB_Vector *pi_output,  // pi(i) = p+1 if p is the parent of node i.
                            // if NULL, the parent is not computed.
    GrB_Matrix A,           // input graph, treated as if boolean in semiring
    GrB_Matrix AT,          // transpose of A (optional; push-only if NULL)
    int64_t source,         // starting node of the BFS
    int64_t max_level,      // optional limit of # levels to search
    bool vsparse            // if true, v is expected to be very sparse
    , FILE * logfile
)

LAGraph_bfs_pushpull.c

GrB_Info LAGraph_bfs_pushpull   // push-pull BFS, or push-only if AT = NULL
(
    GrB_Vector *v_output,   // v(i) is the BFS level of node i in the graph
    GrB_Vector *pi_output,  // pi(i) = p+1 if p is the parent of node i.
                            // if NULL, the parent is not computed.
    GrB_Matrix A,           // input graph, treated as if boolean in semiring
    GrB_Matrix AT,          // transpose of A (optional; push-only if NULL)
    int64_t source,         // starting node of the BFS
    int64_t max_level,      // optional limit of # levels to search
    bool vsparse            // if true, v is expected to be very sparse
)

LAGraph_bfs_simple.c

GrB_Info LAGraph_bfs_simple     // push-only BFS
(
    GrB_Vector *v_output,   // v(i) is the BFS level of node i in the graph
    GrB_Matrix A,           // input graph, treated as if boolean in semiring
    GrB_Index source        // starting node of the BFS
)

LAGraph_cc_boruvka.c LAGraph_cc_fastsv.c LAGraph_cc_fastsv2.c LAGraph_cc_fastsv3.c LAGraph_cc_fastsv4.c LAGraph_cc_fastsv5.c LAGraph_cc_fastsv5a.c LAGraph_cc_fastsv5b.c LAGraph_cc_lacc.c

GrB_Info LAGraph_cc_boruvka
(
    GrB_Vector *result,     // output: array of component identifiers
    GrB_Matrix A,           // input matrix
    bool sanitize           // if true, ensure A is symmetric
)

LAGraph_cdlp.c

GrB_Info LAGraph_cdlp
(
    GrB_Vector *CDLP_handle, // output vector
    const GrB_Matrix A,      // input matrix
    bool symmetric,          // denote whether the matrix is symmetric
    bool sanitize,           // if true, ensure A is binary
    int itermax,             // max number of iterations,
    double *t                // t [0] = sanitize time, t [1] = cdlp time,
                             // in seconds
)

LAGraph_dnn.c

GrB_Info LAGraph_dnn    // returns GrB_SUCCESS if successful
(
    // output
    GrB_Matrix *Yhandle,    // Y, created on output
    // input: not modified
    GrB_Matrix *W,      // W [0..nlayers-1], each nneurons-by-nneurons
    GrB_Matrix *Bias,   // Bias [0..nlayers-1], diagonal nneurons-by-nneurons
    int nlayers,        // # of layers
    GrB_Matrix Y0       // input features: nfeatures-by-nneurons
)

LAGraph_ktruss.c

GrB_Info LAGraph_ktruss         // compute the k-truss of a graph
(
    GrB_Matrix *Chandle,        // output k-truss subgraph, C
    const GrB_Matrix A,         // input adjacency matrix, A, not modified
    const uint32_t k,           // find the k-truss, where k >= 3
    int32_t *p_nsteps           // # of steps taken (ignored if NULL)
)

LAGraph_lcc.c

GrB_Info LAGraph_lcc            // compute lcc for all nodes in A
(
    GrB_Vector *LCC_handle,     // output vector
    const GrB_Matrix A,         // input matrix
    bool symmetric,             // if true, the matrix is symmetric
    bool sanitize,              // if true, ensure A is binary
    double t [2]                // t [0] = sanitize time, t [1] = lcc time,
                                // in seconds
)

LAGraph_msf.c

GrB_Info LAGraph_msf
(
    GrB_Matrix *result,     // output: an unsymmetrical matrix, the spanning forest
    GrB_Matrix A,           // input matrix
    bool sanitize           // if true, ensure A is symmetric
)

LAGraph_pagerank.c

GrB_Info LAGraph_pagerank       // GrB_SUCCESS or error condition
(
    LAGraph_PageRank **Phandle, // output: array of LAGraph_PageRank structs
    GrB_Matrix A,               // binary input graph, not modified
    int itermax,                // max number of iterations
    double tol,                 // stop when norm (r-rnew,2) < tol
    int *iters                  // number of iterations taken
)

LAGraph_pagerank2.c

GrB_Info LAGraph_pagerank2 // alternative PageRank definition
(
    GrB_Vector *result,    // output: array of LAGraph_PageRank structs
    GrB_Matrix A,          // binary input graph, not modified
    double damping_factor, // damping factor
    unsigned long itermax  // number of iterations
)

LAGraph_pagerank3a.c LAGraph_pagerank3d.c LAGraph_pagerank3e.c LAGraph_pagerank3f.c

GrB_Info LAGraph_pagerank3a // PageRank definition
(
    GrB_Vector *result,     // output: array of LAGraph_PageRank structs
    GrB_Matrix A,           // binary input graph, not modified
    GrB_Vector d_out,       // outbound degree of all nodes
    float damping,          // damping factor (typically 0.85)
    int itermax,            // maximum number of iterations
    int *iters              // output: number of iterations taken
)

LAGraph_pagerank3b.c

GrB_Info LAGraph_pagerank3b // PageRank definition
(
    GrB_Vector *result,    // output: array of LAGraph_PageRank structs
    GrB_Matrix A_input,    // binary input graph, not modified
    float damping_factor, // damping factor
    unsigned long itermax, // maximum number of iterations
    int* iters             // output: number of iterations taken
 )

LAGraph_pagerank3c.c LAGraph_pagerankx4.c

GrB_Info LAGraph_pagerank3c // PageRank definition
(
    GrB_Vector *result,     // output: array of LAGraph_PageRank structs
    GrB_Matrix A,           // binary input graph, not modified
    const float *LA_RESTRICT d_out, // out degree of each node (GrB_FP32, size n)
    float damping,          // damping factor (typically 0.85)
    int itermax,            // maximum number of iterations
    int *iters              // output: number of iterations taken
)

LAGraph_scc.c

GrB_Info LAGraph_scc
(
    GrB_Vector *result,     // output: array of component identifiers
    GrB_Matrix A            // input matrix
)

LAGraph_sssp.c LAGraph_sssp1.c

GrB_Info LAGraph_sssp // single source shortest paths
(
    GrB_Vector *path_length,   // path_length(i) is the length of the shortest
                               // path from the source vertex to vertex i
    GrB_Matrix graph,          // input graph, treated as if boolean in semiring
    GrB_Index source,          // source vertex from which to compute shortest paths
    double delta               // delta value for delta stepping
)

LAGraph_sssp11.c LAGraph_sssp12.c LAGraph_sssp12c.c

GrB_Info LAGraph_sssp11         // single source shortest paths
(
    GrB_Vector *path_length,   // path_length(i) is the length of the shortest
                               // path from the source vertex to vertex i
    GrB_Matrix A,              // input graph, treated as if boolean in
                               // semiring (INT32)
    GrB_Index source,          // source vertex from which to compute
                               // shortest paths
    int32_t delta,             // delta value for delta stepping

    // TODO: make this an enum:
    //      case 0: A can have negative, zero, or positive entries
    //      case 1: A can have zero or positive entries
    //      case 2: A only has positive entries (see FIXME below)
    bool AIsAllPositive        // A boolean indicating whether the entries of
                               // matrix A are all positive
)

LAGraph_tricount.c

GrB_Info LAGraph_tricount   // count # of triangles
(
    int64_t *ntri,          // # of triangles
    const int method,       // 1 to 6, see above
    int sorting,            //  0: no sort
                            //  1: sort by degree, ascending order
                            // -1: sort by degree, descending order
                            //  2: auto selection: no sort if rule is not
                            // triggered.  Otherise: sort in ascending order
                            // for methods 3 and 5, descending ordering for
                            // methods 4 and 6.
    const int64_t *degree,  // degree of each node, may be NULL if sorting==0.
                            // of size n, unmodified. 
    const GrB_Matrix A_in   // input matrix, must be symmetric, no diag entries
)

bc_in_progress.c

GrB_Info LAGraph_bc_batch_wip // betweeness centrality, batch algorithm
(
    GrB_Vector *centrality,    // centrality(i) is the betweeness centrality of node i
    const GrB_Matrix A_matrix, // input graph, treated as if boolean in semiring
    const GrB_Index *sources,  // source vertices from which to compute shortest paths
    int32_t num_sources        // number of source vertices (length of s)
)
szarnyasg commented 4 years ago

Closing this as it's superseded by work in the https://github.com/GraphBLAS/LAGraph-Working-Group.