www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Solving optimization problems with D

reply Ogi <ogion.art gmail.com> writes:
I’ve read this [series if 
articles](https://www.gamedeveloper.com/design/decision-modeling-and-optimization-in-game-design-
art-1-introduction) about using Excel Solver for all kinds of optimization
problems. This is very neat, but of course, I would prefer to write models with
code instead, preferably in D. I glanced at mir-optim but it requires knowledge
of advanced math. Is there something more approachable for a layperson?
Jan 01 2023
next sibling parent reply max haughton <maxhaton gmail.com> writes:
On Sunday, 1 January 2023 at 21:11:06 UTC, Ogi wrote:
 I’ve read this [series if 
 articles](https://www.gamedeveloper.com/design/decision-modeling-and-optimization-in-game-design-
art-1-introduction) about using Excel Solver for all kinds of optimization
problems. This is very neat, but of course, I would prefer to write models with
code instead, preferably in D. I glanced at mir-optim but it requires knowledge
of advanced math. Is there something more approachable for a layperson?
What do you want to optimize? Optimization in general requires reasonably advanced mathematics, whereas a single problem can be simplified.
Jan 01 2023
parent jmh530 <john.michael.hall gmail.com> writes:
On Sunday, 1 January 2023 at 22:00:29 UTC, max haughton wrote:
 On Sunday, 1 January 2023 at 21:11:06 UTC, Ogi wrote:
 I’ve read this [series if 
 articles](https://www.gamedeveloper.com/design/decision-modeling-and-optimization-in-game-design-
art-1-introduction) about using Excel Solver for all kinds of optimization
problems. This is very neat, but of course, I would prefer to write models with
code instead, preferably in D. I glanced at mir-optim but it requires knowledge
of advanced math. Is there something more approachable for a layperson?
What do you want to optimize? Optimization in general requires reasonably advanced mathematics, whereas a single problem can be simplified.
There are a lot of C libraries too that you can call from D for optimization too, but like Max says knowing what you want to optimize helps a lot. Excel’s optimizer works for small problems but chokes if the dimension increases too much.It is probably some sort of nonlinear gradient free solver.
Jan 03 2023
prev sibling parent reply Sergey <kornburn yandex.ru> writes:
On Sunday, 1 January 2023 at 21:11:06 UTC, Ogi wrote:
 I’ve read this [series if 
 articles](https://www.gamedeveloper.com/design/decision-modeling-and-optimization-in-game-design-
art-1-introduction) about using Excel Solver for all kinds of optimization
problems. This is very neat, but of course, I would prefer to write models with
code instead, preferably in D. I glanced at mir-optim but it requires knowledge
of advanced math. Is there something more approachable for a layperson?
Maybe mir-optim and dopt are the only options. You can check JuMP (Julia package and resources). Maybe port some of them to D will be the start of new optim solver package. But in general behind the optimisation problems always lying math..
Jan 03 2023
parent bachmeier <no spam.net> writes:
On Tuesday, 3 January 2023 at 21:13:55 UTC, Sergey wrote:
 On Sunday, 1 January 2023 at 21:11:06 UTC, Ogi wrote:
 I’ve read this [series if 
 articles](https://www.gamedeveloper.com/design/decision-modeling-and-optimization-in-game-design-
art-1-introduction) about using Excel Solver for all kinds of optimization
problems. This is very neat, but of course, I would prefer to write models with
code instead, preferably in D. I glanced at mir-optim but it requires knowledge
of advanced math. Is there something more approachable for a layperson?
Maybe mir-optim and dopt are the only options. You can check JuMP (Julia package and resources). Maybe port some of them to D will be the start of new optim solver package. But in general behind the optimisation problems always lying math..
I have a wrapper for the R optimization libraries somewhere. It lets you call the same C libraries underlying R's optim, with the option to choose the algorithm. Haven't used it in a while, but as I recall it was pretty easy to use. I probably also wrapped some of the third-party R optimization libraries at some point.
Jan 03 2023