diff --git a/lib/dynamic_programming_in_elixir.ex b/lib/dynamic_programming_in_elixir.ex index 2b4916c..e8e0a95 100644 --- a/lib/dynamic_programming_in_elixir.ex +++ b/lib/dynamic_programming_in_elixir.ex @@ -56,7 +56,7 @@ defmodule DynamicProgrammingInElixir do else in_edges |> ParallelStream.map(fn edge -> calculate_current_path(g, source, edge) end) - |> ParallelStream.filter(fn x -> elem(x, 0) != :error end) + |> ParallelStream.filter(fn x -> elem(x, 0) == :ok end) |> Enum.to_list() |> my_min() end