Zog.Community.Result (Zog v0.1.0)

View Source

Result of community detection algorithms.

Summary

Functions

Backward compatibility: convert from legacy map format.

Creates a community result from an assignments map.

Creates a community result with explicit metadata and optional pre-computed values.

Convert to legacy map format.

Types

community_id()

@type community_id() :: any()

node_id()

@type node_id() :: any()

t()

@type t() :: %Zog.Community.Result{
  assignments: %{required(node_id()) => community_id()},
  metadata: map(),
  num_communities: non_neg_integer()
}

Functions

from_map(map)

@spec from_map(map()) :: t()

Backward compatibility: convert from legacy map format.

new(assignments)

@spec new(%{required(node_id()) => community_id()}) :: t()

Creates a community result from an assignments map.

new(assignments, metadata, opts \\ [])

@spec new(%{required(node_id()) => community_id()}, map(), keyword()) :: t()

Creates a community result with explicit metadata and optional pre-computed values.

to_map(result)

@spec to_map(t()) :: map()

Convert to legacy map format.