Skip to content

Commit

Permalink
plugin three
Browse files Browse the repository at this point in the history
  • Loading branch information
limingyao001 authored and tugraph committed Oct 10, 2023
1 parent a383e81 commit 1423c0b
Show file tree
Hide file tree
Showing 12 changed files with 1,446 additions and 0 deletions.
6 changes: 6 additions & 0 deletions procedures/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ add_standalone(mis)
add_standalone(trustrank)
add_standalone(slpa)
add_standalone(wlpa)
add_standalone(subgraph_isomorphism)
add_standalone(sybilrank)
add_standalone(leiden)

add_embed(bfs)
add_embed(pagerank)
Expand Down Expand Up @@ -102,6 +105,9 @@ add_embed(mis)
add_embed(trustrank)
add_embed(slpa)
add_embed(wlpa)
add_embed(subgraph_isomorphism)
add_embed(sybilrank)
add_embed(leiden)

add_embed2(khop_kth)
add_embed2(khop_within)
Expand Down
40 changes: 40 additions & 0 deletions procedures/algo_cpp/algo.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

#pragma once

#include <unordered_set>
#include "lgraph/olap_base.h"

using namespace lgraph_api;
Expand Down Expand Up @@ -110,6 +111,21 @@ void WCCCore(OlapBase<Empty>& graph, ParallelVector<size_t>& label);
*/
double LCCCore(OlapBase<Empty>& graph, ParallelVector<double>& score);

/**
* @brief Compute the leiden algorithm.
*
* @param[in] graph The graph to compute on.
* @param[in,out] label The community of vertex.
* @param[in] random_seed The number of random seed for leiden algorithm.
* @param[in] theta Determine the degree of randomness in the selection
* of a community and within a range of roughly [0.0005, 0.1]
* @param[in] gamma The resolution parameter.
* Higher resolutions lead to more communities
* @param[in] threshold Terminate when active_vertices < num_vertices / threshold
*/
void LeidenCore(OlapBase<double>& graph, ParallelVector<size_t>& label, unsigned random_seed,
double theta, double gamma, size_t threshold);

/**
* @brief Compute the number of rings of length k.
*
Expand Down Expand Up @@ -273,6 +289,30 @@ void MotifCore(OlapBase<Empty>& graph, ParallelVector<size_t>& motif_vertices, i
*/
void MSSPCore(OlapBase<double>& graph, std::vector<size_t> roots, ParallelVector<double>& distance);

/**
* @brief Compute the Subgraph Isomorphism Algorithm.
*
* @param[in] graph The graph to compute on.
* @param[in] query The outgoing adjacency list of subgraph.
* @param[in, out] counts The ParallelVector to store number of subgraph.
*
* @return return total number of subgraph.
*/
size_t SubgraphIsomorphismCore(OlapBase<Empty>& graph,
std::vector<std::unordered_set<size_t>>& query,
ParallelVector<size_t>& counts);

/**
* @brief Compute the Sybil Rank Algorithm.
*
* @param[in] graph The graph to compute on.
* @param[in] trust_seeds The ParallelVector for trusted nodes.
* @param[in, out] curr The ParallelVector to store sybil rank value.
*
*/
void SybilRankCore(OlapBase<Empty>& graph, ParallelVector<size_t>& trust_seeds,
ParallelVector<double>& curr);

/**
* @brief Compute the Triangle Counting algorithm.
*
Expand Down
Loading

0 comments on commit 1423c0b

Please sign in to comment.