[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 problem

**From**: |
glpk xypron |

**Subject**: |
Re: [Help-glpk] C API: Setting up a least-absolute-deviation problem |

**Date**: |
Sat, 01 Sep 2012 09:18:23 +0200 |

Hello Jared,
take a look at glpk-4.47/examples/sample.c
Best regards
Xypron
-------- Original-Nachricht --------
>* Datum: Fri, 31 Aug 2012 15:52:11 -0700*
>* Betreff: [Help-glpk] C API: Setting up a least-absolute-deviation problem*
>* *
>* I have an absolute value objective function, minimizing the sum of abs(*
>* s[i] - x[i] ) for two vectors s and x, with the constraints given by Ax = b*
>* where A is a large but very sparse matrix.*
>* *
>* So I'm using a dummy vector "u" in a MathProg model:*
>* *
>* minimize least_abs_dev: sum {i in I} (u[i]); *
>* s.t. constr1{i in I} : b[i] = sum{j in I} (A[i,j] * x[j]); *
>* s.t. constr2{i in I} : u[i] >= (s[i] - x[i]);*
>* s.t. constr3{i in I} : u[i] >= -(s[i] - x[i]);*
>* *
>* I also eventually want to incorporate weights into the objective:*
>* *
>* minimize least_abs_dev: sum {i in I} (u[i] * w[i]);*
>* *
>* I've got this type of model working using MathProg and glpsol, but now I'm*
>* trying to figure out how to translate it to the strict form required by*
>* the C API. Has anyone done this? What's the best way to go about it? I'm*
>* going to need high performance on some large problems.*
>* *
>* I am fairly new to optimization and GLPK. Any help would be much*
>* appreciated.*
>* *
>* - JM *

[Prev in Thread] |
**Current Thread** |
[Next in Thread] |

**Re: [Help-glpk] C API: Setting up a least-absolute-deviation problem**,
*glpk xypron* **<=**