Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

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

CapriceW
8 - Asteroid

Here goes!

ipeng
8 - Asteroid

This is a very difficult one. I will certainly revisit this one later. It is certainly a good learning opportunity for optimization

CaraI
Alteryx
Alteryx

I was stuck on this one for a while ... insisting I must use the Optimization tool ... finally, success and I can get back to working through the Challenges in order!

 

Spoiler
52 workflow.jpg
KeithTroutt
8 - Asteroid

Spent time learning the optimization tool. To answer the different scenarios, I converted this workflow to an app. I can see many use cases for the optimization tool!

Spoiler
Challenge 52 Spoiler.PNG
RolandSchubert
16 - Nebula
16 - Nebula

Finally managed to solve the problem using the Optimization tool ... I had to learn a lot about the specific settings and restrictions

RichoBsJ
11 - Bolide

Hi! Here my solution :)

JoshuaGostick
11 - Bolide

My solution :)

Spoiler
challenge_52_macro.PNG
Spoiler
cplewis90
13 - Pulsar
13 - Pulsar

This was a bit tricky at first I misunderstood how to prioritize different items, but once I fixed that I was good to go!

Spoiler
Challenge 52.PNG
KMiller
8 - Asteroid

Solution attached

Spoiler
12-03-2019 17-19-17.png
JonathanAllenby
8 - Asteroid

I used this as an opportunity to work on building macros. 

Spoiler
In short, I built a macro that works out which combination of items, for however many items you have and however many items you're allowed to pick, will give you the best value for the lowest weight. It also lets you specify the maximum weight that you're allowed. My main macro has a batch macro tucked inside which goes through and calculates all the weights and totals for each combination of items. This was also a great exercise in optimisation as originally my inner macro took 25 minutes to run but I managed to cut this down to under a minute by modifying the input.
Lower level macro that calculates the total weight & value for each valid combination.Lower level macro that calculates the total weight & value for each valid combination.Top level macro that takes in the item details and max weight.Top level macro that takes in the item details and max weight.Main flow displaying the output.Main flow displaying the output.