# \[AMPL 25038\] Which is more computationally efficient??

**URL:** <https://discuss.ampl.com/t/ampl-25038-which-is-more-computationally-efficient/1080>\
**Category:** Google Group Mirror\
**Created:** [April 30, 2024, 10:17am UTC](https://discuss.ampl.com/t/ampl-25038-which-is-more-computationally-efficient/1080 "2024-04-30T10:17:59Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![4er](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.ampl.com/4er/32/530_2.png) [@4er](https://discuss.ampl.com/u/4er)\
**Post date:** [May 1, 2024, 12:47pm UTC](https://discuss.ampl.com/t/ampl-25038-which-is-more-computationally-efficient/1080/2 "2024-05-01T12:47:23Z")

</div>

Usually it is preferred to write

```auto
var A = B + C;

```

because then the expression “B + C” is substituted for A; the solver does not see the variable A or the constraint “A = B + C”. However, there can be exceptions where the number of “defined variables” like A is very large. So if you are finding that AMPL is taking an especially long time to generate the problem, you may want to try the alternative,

```auto
var A;
subject to Adefn: A = B + C;

```

to see whether it is faster.

---

_[View the full topic](https://discuss.ampl.com/t/ampl-25038-which-is-more-computationally-efficient/1080)._
