Zog.Community (Zog v0.1.0)

View Source

Native community detection algorithms backed by Zog (Zig) via Zigler.

Summary

Functions

label_propagation(builder, opts \\ [])

@spec label_propagation(
  Zog.SoA.t(),
  keyword()
) :: %{required(Zog.SoA.label()) => non_neg_integer()}

Detects communities using the Label Propagation Algorithm (LPA).

label_propagation(arg1, arg2, arg3, arg4, arg5, arg6)

@spec label_propagation(
  0..18_446_744_073_709_551_615,
  [0..4_294_967_295] | <<_::_*32>>,
  [0..4_294_967_295] | <<_::_*32>>,
  [float()] | <<_::_*64>>,
  0..18_446_744_073_709_551_615,
  0..18_446_744_073_709_551_615
) :: [0..18_446_744_073_709_551_615]

leiden(builder, opts \\ [])

@spec leiden(
  Zog.SoA.t(),
  keyword()
) :: %{required(Zog.SoA.label()) => non_neg_integer()}

Detects communities using the Leiden algorithm.

leiden(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8)

@spec leiden(
  0..18_446_744_073_709_551_615,
  [0..4_294_967_295] | <<_::_*32>>,
  [0..4_294_967_295] | <<_::_*32>>,
  [float()] | <<_::_*64>>,
  float(),
  0..18_446_744_073_709_551_615,
  0..18_446_744_073_709_551_615,
  float()
) :: [0..18_446_744_073_709_551_615]

leiden_hierarchical(builder, opts \\ [])

@spec leiden_hierarchical(
  Zog.SoA.t(),
  keyword()
) :: Zog.Community.Dendrogram.t()

Full hierarchical Leiden detection returning a Dendrogram.

leiden_hierarchical(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8)

@spec leiden_hierarchical(
  0..18_446_744_073_709_551_615,
  [0..4_294_967_295] | <<_::_*32>>,
  [0..4_294_967_295] | <<_::_*32>>,
  [float()] | <<_::_*64>>,
  float(),
  0..18_446_744_073_709_551_615,
  0..18_446_744_073_709_551_615,
  float()
) :: [[0..18_446_744_073_709_551_615]]

louvain(builder, opts \\ [])

@spec louvain(
  Zog.SoA.t(),
  keyword()
) :: %{required(Zog.SoA.label()) => non_neg_integer()}

Detects communities using the Louvain algorithm.

louvain(arg1, arg2, arg3, arg4, arg5, arg6, arg7)

@spec louvain(
  0..18_446_744_073_709_551_615,
  [0..4_294_967_295] | <<_::_*32>>,
  [0..4_294_967_295] | <<_::_*32>>,
  [float()] | <<_::_*64>>,
  float(),
  0..18_446_744_073_709_551_615,
  0..18_446_744_073_709_551_615
) :: [0..18_446_744_073_709_551_615]

modularity(builder, community_map)

@spec modularity(Zog.SoA.t(), %{required(Zog.SoA.label()) => non_neg_integer()}) ::
  float()

Computes the modularity of a given community partition.

modularity_f64(arg1, arg2, arg3, arg4, arg5)

@spec modularity_f64(
  0..18_446_744_073_709_551_615,
  [0..4_294_967_295] | <<_::_*32>>,
  [0..4_294_967_295] | <<_::_*32>>,
  [float()] | <<_::_*64>>,
  [0..18_446_744_073_709_551_615] | <<_::_*64>>
) :: float()