Packages

Fork of tmbb/dantzig tweaked for Advent of Code 2025

Current section

Files

Jump to
Raw

lib/dantzig.ex

defmodule Dantzig do
@moduledoc """
Documentation for `Dantzig`.
"""
alias Dantzig.HiGHS
alias Dantzig.Problem
def solve(%Problem{} = problem) do
HiGHS.solve(problem)
end
def solve!(%Problem{} = problem) do
{:ok, solution} = HiGHS.solve(problem)
solution
end
def dump_problem_to_file(%Problem{} = problem, path) do
iodata = HiGHS.to_lp_iodata(problem)
File.write!(path, iodata)
end
end