[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-glpk] C API: Setting up a least-absolute-deviation

From: Robbie Morrison
Subject: Re: [Help-glpk] C API: Setting up a least-absolute-deviation
Date: Thu, 6 Sep 2012 09:58:36 +1200
User-agent: SquirrelMail/1.4.22

Hello Jared

To:           GLPK help <address@hidden>
Subject:      Re: [Help-glpk] C API: Setting up a least-absolute-deviation
Message-ID:  <address@hidden>
From:         Jared Miller <address@hidden>
Date:         Tue, 4 Sep 2012 17:39:54 -0700

> Thanks for the reply. To clarify, I'm not asking for
> help with the basics of the C API (it looks pretty
> straightforward if your problem is in the right form);
> rather I'm asking how to translate my high-level
> formulation (which includes the dummy u[i]'s) into the
> low-level formulation (with only auxiliary and
> structural variables, objective only in terms of the
> structural, and all the bounds constant).

I don't exactly understand the particulars of your
problem, but I have, as noted earlier, been down a
similar track.  In many respect, you need to think like
model translator.

I often used SOS2 formulations for piecewise linear
characterizations, so I wrote a dedicated abstraction
for this.  Other tasks were less general and required
case-by-case coding.

You might also find Smith and Ta&#351;k&#305;n (2008) useful
(available as a preprint PDF, see below).

> I'll try loading/translating my MathProg file into a
> "glp_prob" struct and examining the internal
> translation. Eventually I need to work on abstracting a
> way of getting problems of this type into the GLPK
> low-level form.

You welcome to a copy of my C++ class which
interrogates a GLPK problem object, spits out a nicely
formatted W3C-compliant HTML file, and, optionally,
opens the file in a web browser.  I can also send some
sample HTML and a screen shot.  Its GPLv3 code.  It
certainly kept me sane during this process.  Firefox
chokes on tables exceeding 200x200, but at that point,
there is already too much detail to comprehend.

I thought long and hard about creating some higher
level abstractions in relation to my problem domain.
In the end, I didn't take this theme as high as
I might have.

In fact, your welcome to my entire codebase as a
tarball if you want to examine my design.

As also previously mentioned, getting the solver calls
correct was exacting work.  But it did all work in the

> On Sep 1, 2012, at 11:25 AM, Robbie Morrison wrote:

[snip: remainder of thread]


  Smith, J Cole and Z. Caner Ta&#351;k&#305;n.  2008, A tutorial
      guide to mixed-integer programming models and
      solution techniques.  In: Gino J Lim and Eva K
      Lee (editors).  Optimization in medicine and
      biology.  January 2008.  Auerbach Publications.
      ISBN: 978-0849305634.

HTH, Robbie
Robbie Morrison
PhD student -- policy-oriented energy system simulation
Technical University of Berlin (TU-Berlin), Germany
University email (redirected) : address@hidden
Webmail (preferred)           : address@hidden
[from Webmail client]

reply via email to

[Prev in Thread] Current Thread [Next in Thread]