Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Truck planning optimization

ayadav8
8 - Asteroid

Hello,

 

I am new to optimization with Alteryx. I have a basic truck planning problem which is grouped by Date, Start and End locations. The objective is to determine which combination of weights to go together to minimize the number of trucks. We cannot combine weights from other groups. The max capacity of a truck is 44,000

Also attaching an example file. Any help is appreciated.

 

Thanks!

5 REPLIES 5
AmeliaG
Alteryx
Alteryx

Hi @ayadav8,

 

Thanks for your question! An iterative macro will allow you to do this planning. (You may need to wrap in a batch macro in order to take each group individually). 

 

Here is a great knowledgebase article describing Iterative Macros. 

Here is an on-demand training video for Iterative macros. 

 

Hope this helps!

 

Amelia

ayadav8
8 - Asteroid

@AmeliaG thanks for the suggestion but when I tried connecting it to my problem, it is confusing me. I tried looking at other community posts but I am still unclear. 

jdunkerley79
ACE Emeritus
ACE Emeritus

That's a really interesting (and computationally complicated) problem.

 

2018-10-18_21-09-01.png

 

2018-10-18_21-06-42.png

 

As @AmeliaG said I think the best approach is a combination of batch and iterative macros. We run an allocation for each day, start and end (using a batch macro to pick each set).

 

2018-10-18_21-09-22.png

 

The allocation engine I have put together works off an idea from @Claje:

- Working from largest item down to smallest

- Assign to an existing truck if there is space otherwise add a new truck and assign there

 

This is built as an iterative macro. 

 

2018-10-18_21-13-35.png

The first block picks the next item to allocate

The block at the bottom decides which truck to assign the item to or adds to new one

Finally, we record the allocation and then see if anything else left to iterate over

 

I think this approach will give a reasonable answer. I can imagine there could be edge cases where it does not produce the optimal answer however though.

 

Hope it helps you get started

 

 

ayadav8
8 - Asteroid

This is really great. Thanks so much @jdunkerley79

Nadim_Hajjar
5 - Atom

Hi, how do we change the max truck size?

Labels