Re: Off-by-one error when solving integer linear program

Matthew Keeter <[email protected]>
Newsgroups gmane.comp.gnu.glpk
Message-ID <CAPhWwz9yW86N59L=nkp3uTUd+G8m0Acu9zJWMRFhNainhwCBeA@mail.gmail.com>
Ah, I just realized that you only see Part 2 if you're logged in and have
solved Part 1.

The goal of Part 2 is to maximize production of the FUEL element, starting
with 1 trillion
units of ORE; that's the problem that I'm solving in my LP file.

Since each reaction occurs an integer number of times (and both consumes and
produces an integer number of reagents / products), the answer should be an
integer.

-Matt


On Tue, Dec 17, 2019 at 11:40 PM Michael Hennebry <
[email protected]> wrote:

> On Tue, 17 Dec 2019, Matthew Keeter wrote:
>
> > I used GLPK to solve a problem in this year?s Advent of Code [1], and
> noticed
> > that it produces a very slightly wrong answer for one of the examples.
>
> As noted elsewhere, an upper bound of a trillion
> requires more precision than GLPK will normally require.
> I do not get an integer objective.
>
> I'm really confused about what problem is being solved.
> The given ILP does not resemble the problem of producing one unit of fuel.
> For the puzzle data I found, one would have 59 variables (columns),
> one for each reaction.
> I saw mention of more than one part,
> so I expect I am missing something.
>
> > It?s an integer linear programming problem, pasted below the fold in
> CPLEX LP format.
> >
> > The correct answer is 82892753, and I?m getting 82892752.
>
> The correct answer is 82,892,753.14  .
>
> --
> Michael   [email protected]
> "Sorry but your password must contain an uppercase letter, a number,
> a haiku, a gang sign, a heiroglyph, and the blood of a virgin."
>                                                               --
> someeecards
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.