Zog.Property (Zog v0.1.0)

View Source

Native graph properties backed by Zog (Zig) via Zigler.

Summary

Functions

Finds all maximal cliques using native Bron-Kerbosch.

Computes graph coloring using the DSatur heuristic natively. Returns {chromatic_number, %{node_label => color}}.

Computes exact graph coloring natively using backtracking with pruning.

Finds the maximum clique using native Bron-Kerbosch.

Functions

all_maximal_cliques(builder)

@spec all_maximal_cliques(Zog.SoA.t()) :: [MapSet.t(Zog.SoA.label())]

Finds all maximal cliques using native Bron-Kerbosch.

all_maximal_cliques(arg1, arg2, arg3, arg4)

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

coloring_dsatur(builder)

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

Computes graph coloring using the DSatur heuristic natively. Returns {chromatic_number, %{node_label => color}}.

coloring_exact(builder, timeout_ms \\ 5000)

@spec coloring_exact(Zog.SoA.t(), non_neg_integer()) ::
  {:ok, non_neg_integer(), %{required(Zog.SoA.label()) => non_neg_integer()}}
  | {:timeout,
     {non_neg_integer(), %{required(Zog.SoA.label()) => non_neg_integer()}}}

Computes exact graph coloring natively using backtracking with pruning.

max_clique(builder)

@spec max_clique(Zog.SoA.t()) :: MapSet.t(Zog.SoA.label())

Finds the maximum clique using native Bron-Kerbosch.

nif_dsatur(arg1, arg2, arg3, arg4)

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

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

@spec nif_exact_coloring(
  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
) :: term()