Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
Alteryx is here to help you solve your biggest data challenges. Read about the new Virtual Solution Center here.

Optimization tool (network optimization distribution centers to stores)

Highlighted
6 - Meteoroid

Hi community,

 

I am stuck with the optimization tool getting "Solution is undefined".

 

The network optimization should minimize the cost subjected to:

- Cover the demand of my stores

- Considers the capacity at my distribution centers

 

This is a very simple exercise that I now how to tackle in Excel, but I am experimenting with Alteryx to use more than 200 variables at some point. 

 

My guess is the error is how I structured the inputs to the optimization tool, but open for feedback.

 

Thanks,

Rodrigo

Highlighted
Alteryx
Alteryx

It looks like you have formulated your problem incorrectly, but I will need more detail to know where. 

I see you have 12 decision variables that are binary, taking the value of zero or one. You then ask the solver to use these decision variables to minimize the cost subject to 8 constraints. 

 

Your Amb-S_9 constraint can be rewritten as the following:

1*Amb-S 9-DC03 + 1*Amb-S 9-DC05 >=1155

 

This constraint is not feasible since your decision variables take the value of 1 or 0. It is impossible for these to sum to 1155.

 

Also, the constraint rows in your B marix should be in the same order as the constraint columns in your A matrix. Your order appears to be slightly off. 

 

Hope this helps. Let me know if you have questions.

 

 

Highlighted
6 - Meteoroid

Hey Andrew,

 

Ok, now I got it.

 

So I changed to an integer variable instead of binary, and re-arranged the inputs as per your suggestion.

 

Now is running:

 

rperezmi_0-1576012734342.png

 

Thanks you so much!

Rodrigo

Highlighted
6 - Meteoroid

Hi Andrew,

 

Hope you are well.

 

I have a very similar model, but I keep getting this error:

error.png

 

I structured the same way as the example I posted here before, but I don't know where's the bug. Any ideas?

 

Best,

Rodrigo

Highlighted
Alteryx
Alteryx

Turning on the macro messages, it looks like you have an additional string variable in your A matrix:

AndrewKramer_3-1584650340588.png

 

AndrewKramer_0-1584650113099.png

 

This "right variable" field is redundant, since this info is contained in "variable". 

AndrewKramer_1-1584650181541.png

 

Drop this field and the workflow now executes. However, I'm getting no feasible solution:

AndrewKramer_2-1584650324520.png

 

 

Highlighted
6 - Meteoroid

Hi Andrew,

 

Thanks for catching up that mistake.

 

I added more capacity to my constraint to get an answer, and now I am getting the output but accompanied with this error:

Annotation 2020-03-19 171536.png

 

Any ideas what this is?

 

Best,

Rodrigo

Highlighted
Alteryx
Alteryx

This specific error can be safely ignored. R treats any return code from C++ that is not 0 as error. However, the model still executes and produces a result. This error message is commonly seen with larger data sets, although I'm not getting the error on my end.

AndrewKramer_0-1584710585626.png

 

Highlighted
6 - Meteoroid

Hi Andrew,

 

Ok, thank you so much!

 

Stay safe,

Rodrigo

Highlighted
6 - Meteoroid

Andrew,

 

One follow up question.

 

Is there a way to put add a constraint to cap that every customer should be single sourced? What is happening now is that I have some customers being sourced from multiple locations.

 

Any ideas?

 

Best,

Rodrigo

Highlighted
Alteryx
Alteryx

If I'm understanding your workflow properly with your A constraints matrix, Customer 1 should only be sourced by one of the DCs (24, 8, or 9)?

 

AndrewKramer_0-1585252091699.png

 

If so, you'll need to add an additional constraint column for each customer, You should have 1 for the specific customer and NULL (or zero) if not that customer). Each constraint should be "=1". This is the equivalent to saying that all of the demand for customer C-1 should be filled from one and only one distribution center.

AndrewKramer_1-1585252312861.png

 

Let me know if this makes sense.

Labels