Current section

Files

Jump to
yog src yog@dag@algorithms.erl
Raw

src/yog@dag@algorithms.erl

-module(yog@dag@algorithms).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]).
-define(FILEPATH, "src/yog/dag/algorithms.gleam").
-export([topological_sort/1, longest_path/1, transitive_closure/2, transitive_reduction/2, shortest_path/3, count_reachability/2, lowest_common_ancestors/3]).
-if(?OTP_RELEASE >= 27).
-define(MODULEDOC(Str), -moduledoc(Str)).
-define(DOC(Str), -doc(Str)).
-else.
-define(MODULEDOC(Str), -compile([])).
-define(DOC(Str), -compile([])).
-endif.
?MODULEDOC(
" # ⚠️ Deprecated Module\n"
"\n"
" This module has been renamed to `yog/dag/algorithm` (singular).\n"
" Please update your imports to use `yog/dag/algorithm` instead.\n"
"\n"
" This module will be removed in a future version.\n"
).
-file("src/yog/dag/algorithms.gleam", 30).
?DOC(
" Returns a topological ordering of all nodes in the DAG.\n"
"\n"
" @deprecated Use `yog/dag/algorithm.topological_sort` instead\n"
).
-spec topological_sort(yog@dag@model:dag(any(), any())) -> list(integer()).
topological_sort(Dag) ->
yog@dag@algorithm:topological_sort(Dag).
-file("src/yog/dag/algorithms.gleam", 38).
?DOC(
" Finds the longest path (critical path) in a weighted DAG.\n"
"\n"
" @deprecated Use `yog/dag/algorithm.longest_path` instead\n"
).
-spec longest_path(yog@dag@model:dag(any(), integer())) -> list(integer()).
longest_path(Dag) ->
yog@dag@algorithm:longest_path(Dag).
-file("src/yog/dag/algorithms.gleam", 46).
?DOC(
" Computes the transitive closure of a DAG.\n"
"\n"
" @deprecated Use `yog/dag/algorithm.transitive_closure` instead\n"
).
-spec transitive_closure(yog@dag@model:dag(QEH, QEI), fun((QEI, QEI) -> QEI)) -> yog@dag@model:dag(QEH, QEI).
transitive_closure(Dag, Merge_fn) ->
yog@dag@algorithm:transitive_closure(Dag, Merge_fn).
-file("src/yog/dag/algorithms.gleam", 57).
?DOC(
" Computes the transitive reduction of a DAG.\n"
"\n"
" @deprecated Use `yog/dag/algorithm.transitive_reduction` instead\n"
).
-spec transitive_reduction(yog@dag@model:dag(QEN, QEO), fun((QEO, QEO) -> QEO)) -> yog@dag@model:dag(QEN, QEO).
transitive_reduction(Dag, Merge_fn) ->
yog@dag@algorithm:transitive_reduction(Dag, Merge_fn).
-file("src/yog/dag/algorithms.gleam", 68).
?DOC(
" Finds the shortest path between two specific nodes in a weighted DAG.\n"
"\n"
" @deprecated Use `yog/dag/algorithm.shortest_path` instead\n"
).
-spec shortest_path(yog@dag@model:dag(any(), integer()), integer(), integer()) -> gleam@option:option(yog@pathfinding@utils:path(integer())).
shortest_path(Dag, Start, Goal) ->
yog@dag@algorithm:shortest_path(Dag, Start, Goal).
-file("src/yog/dag/algorithms.gleam", 80).
?DOC(
" Counts the number of ancestors or descendants for every node.\n"
"\n"
" @deprecated Use `yog/dag/algorithm.count_reachability` instead\n"
).
-spec count_reachability(
yog@dag@model:dag(any(), any()),
yog@dag@algorithm:direction()
) -> gleam@dict:dict(integer(), integer()).
count_reachability(Dag, Direction) ->
yog@dag@algorithm:count_reachability(Dag, Direction).
-file("src/yog/dag/algorithms.gleam", 91).
?DOC(
" Finds the lowest common ancestors (LCAs) of two nodes.\n"
"\n"
" @deprecated Use `yog/dag/algorithm.lowest_common_ancestors` instead\n"
).
-spec lowest_common_ancestors(
yog@dag@model:dag(any(), any()),
integer(),
integer()
) -> list(integer()).
lowest_common_ancestors(Dag, Node_a, Node_b) ->
yog@dag@algorithm:lowest_common_ancestors(Dag, Node_a, Node_b).