Zog.Community (Zog v0.4.0)

View Source

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

Summary

Functions

Detects communities using the Label Propagation Algorithm (LPA).

Detects communities using the Leiden algorithm.

Full hierarchical Leiden detection returning a Dendrogram.

Detects communities using the Louvain algorithm.

Computes the modularity of a given community partition.

Detects communities using the Walktrap algorithm (Pons & Latapy).

Full hierarchical Walktrap detection returning a Dendrogram.

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()

walktrap(input, opts \\ [])

@spec walktrap(
  Zog.SoA.t() | Yog.Graph.t(),
  keyword()
) :: Zog.Community.Result.t()

Detects communities using the Walktrap algorithm (Pons & Latapy).

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

@spec walktrap(
  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,
  boolean(),
  0..18_446_744_073_709_551_615
) :: [0..18_446_744_073_709_551_615]

walktrap_hierarchical(input, opts_or_length \\ [])

@spec walktrap_hierarchical(Zog.SoA.t() | Yog.Graph.t(), keyword() | integer()) ::
  Zog.Community.Dendrogram.t()

Full hierarchical Walktrap detection returning a Dendrogram.

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

@spec walktrap_hierarchical(
  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]]