Important Community update: The process for changing your account details was updated on June 25th. Learn how this impacts your Community experience and the actions we suggest you take to secure your account here.

Weekly Challenges

Solve the challenge, share your solution and summit the ranks of our Community!

Also available in | Français | Português | Español | 日本語
IDEAS WANTED

Want to get involved? We're always looking for ideas and content for Weekly Challenges.

SUBMIT YOUR IDEA

Challenge #52: Solving the Knapsack Problem

Erin
9 - Comet

I had to watch several tutorials but.....

I got the Optimization Tool to work!!!! 😎 

Spoiler

Trying to get this tool down, so did it the manual input and dense matrix, variables in rows input. Also put it in a batch macro and presented the output differently in a way. Hope this helps someone! I also really appreciate this training on Prescriptive Optimization from Inspire 2022

challenge_52 workflow.png
Challenge_52 Results.png

 

 

danbostrom
8 - Asteroid

 

 

Raj
15 - Aurora

Solved !

JoshuaM
8 - Asteroid

Used the optimization tools for this problem. Challenge 2 consisted of a batch macro for each interval of boxes.

 

Challenge 1

Solution:

Spoiler
Snip.PNG

Explanation:

Spoiler
O anchor - Variable column represents each unique box. The coefficient field displays each box's unique $ value. The bounds are set between 0 and 1 since a maximum of 1 box and be used. The type represents integer because each box has to represent a whole unit.

A anchor - Each constraint is set up as rows where the variables are represented in columns. The first record represents the kg associated to each box. The preceding records correspond to each box, the 0s and 1s help map record to column.

B anchor -  The direction is set up within this anchor. Each record represents the corresponding record from the A anchor. The direction field for each record should be less than or equal to a value. The value is represented in right hand side rhs column. This column displays the max kg to remain under and how many boxes can be used.
 

Challenge 2

Solution:

Spoiler
Snip 2.PNG

Macro:

Spoiler
Snip 2_m.PNG

Explanation:

Spoiler
A batch macro was used to achieve the desired output here. The control parameter represents the number of boxes from 1 to 4. This value can be dynamic as the user can update the text field. For the macro to be successful, the A and B anchor were updated. The A anchor is configured with variables as rows. The records correspond to the boxes where each column represents kg and qty, respectively. The B anchor is revised to only include kg and qty as rows. The value for rhs dud not change for kg yet qty represents the value from the control parameter. As the macro runs through each batch, the value is changed from 1 to 4.
Jon-Knepper
8 - Asteroid

This one took me awhile to knock out.  I haven't done anything with optimization before.

 

Spoiler
Untitled.png
vizwithdan
8 - Asteroid

Solution Attached :)

mshishido
8 - Asteroid

here