# How to eliminate a variable from a JuMP model?

**URL:** https://discourse.julialang.org/t/how-to-eliminate-a-variable-from-a-jump-model/113557
**Category:** Optimization (Mathematical)
**Tags:** question, package, jump
**Created:** [April 27, 2024, 9:39am UTC](https://discourse.julialang.org/t/how-to-eliminate-a-variable-from-a-jump-model/113557 "2024-04-27T09:39:20Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![WuSiren](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/wusiren/32/42529_2.png) [@WuSiren](https://discourse.julialang.org/u/WuSiren)
#### Post date: [April 27, 2024, 9:39am UTC](https://discourse.julialang.org/t/how-to-eliminate-a-variable-from-a-jump-model/113557/1 "2024-04-27T09:39:20Z")

</div>

For example, with the help of `Polyhedra.jl` one can eliminate variable `y` from model `m` (or project `m` onto `x` space) and obtain a polyhedron `P` with respect to `x`:

```julia
using JuMP, Polyhedra, CDDLib
m = Model()
@variable(m, x)
@variable(m, 0 <= y <= 1)
@constraint(m, x == y + 1)
all_variables(m) # To check the dimension names.
p = polyhedron(m, CDDLib.Library(:exact))
P = eliminate(p, 2)

```

My question is can I perform elimination or projection without using `Polyhedra` and get a `JuMP` model w.r.t. `x`?

---

<div class="post-metadata">

### Author: ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)
#### Post date: [April 27, 2024, 10:30pm UTC](https://discourse.julialang.org/t/how-to-eliminate-a-variable-from-a-jump-model/113557/2 "2024-04-27T22:30:01Z")

</div>

> My question is can I perform elimination or projection without using `Polyhedra` and get a `JuMP` model w.r.t. `x` ?

No. JuMP does not contain any built-in functionality for presolve or simplification routines that would project out a subset of the decision variables.
