# Creating a tuple from combination of tuple and vectors

**URL:** <https://discourse.julialang.org/t/creating-a-tuple-from-combination-of-tuple-and-vectors/81705>\
**Category:** Optimization (Mathematical)\
**Tags:** question, jump, tuple, vector\
**Created:** [May 26, 2022, 9:22am UTC](https://discourse.julialang.org/t/creating-a-tuple-from-combination-of-tuple-and-vectors/81705 "2022-05-26T09:22:49Z")\
**Posts on this page:** 1\
**Showing post:** 4

<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:** [May 26, 2022, 7:48pm UTC](https://discourse.julialang.org/t/creating-a-tuple-from-combination-of-tuple-and-vectors/81705/4 "2022-05-26T19:48:37Z")

</div>

Is this question related to [Define variables on each elemnts of a vector of vectors](https://discourse.julialang.org/t/define-variables-on-each-elemnts-of-a-vector-of-vectors/81495)? It seems pretty similar.

```julia
A = [
    (1, 2), (1, 3), (2, 1), (2, 7), (2, 8), (2, 4), (3, 4), (3, 5), (4, 3), 
    (4, 2), (4, 6), (4, 9), (5, 6), (7, 8), (7, 10), (8, 9), (8, 10), (9, 10),
]
B = [2, 9]
C = [[1, 7, 3, 4], [4, 10, 1, 2, 6, 7]]
D = [12, 15]

using JuMP
model = Model()
sets = [(b, c, d) for (k, d) in enumerate(D) for b in B for c in C[k] if (b, c) in A]
@variable(model, x[sets])
x[(2, 7, 12)]

```

---

_[View the full topic](https://discourse.julialang.org/t/creating-a-tuple-from-combination-of-tuple-and-vectors/81705)._
