alteryx Community

# 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.

## Challenge #424: Optimize the Energy of Your Playlist

Alteryx

Hi Maveryx,

A solution to last week’s challenge can be found here.

This challenge was submitted by @AkimasaKajitani . Thanks Aki for this great contribution!

You and your friends enjoy high-energy songs. Since your friends know you are skilled at using Alteryx, they have asked you to create a 60-minute playlist using the Optimization tool. This playlist should contain the most popular and energetic songs, each included only once.

Each record in the provided dataset contains the variable (song ID), song name, popularity, level of energy (ranging from 0 to 1, with 0 being less energetic and 1 being more energetic), and song duration. Additionally, you are given the formatted for the B anchor of the Optimization tool. This represents the maximum duration of 3600 seconds, or 60 minutes (rhs).

Your task is to create a maximum 60-minute playlist that maximizes song popularity from the top 100 high-energy songs. Each song should only be included once. Additionally, output the total popularity value of (Objective ).

Summary of Data:

You are provided with a file containing a song popularity dataset with energy values for each song and its duration. Additionally, you are given the formatted input for the B anchor or the Optimization tool.

Hints:

• Ensure you select Maximize Objective in the Optimization tool settings and spend most of your time structuring the data for the Specify the Model as Matrices option. You will not need to change any other settings in the tool (other than Maximize Objective).

• Field names matter! Check out this article, which features data format.

song_popularity = coefficient

lb and ub values are a binary datatype of 0,1

Need a refresher? Review these resources to gear up:

Source: The dataset was modified to align with the learning objectives of the challenge. https://www.kaggle.com/datasets/maharshipandya/-spotify-tracks-dataset

Good luck!

11 - Bolide
Spoiler

Getting a different answer considering maximization of popularity as the objective.

11 - Bolide

Fun!

Spoiler
12 - Quasar

Getting a slightly different outcome to the expected solution. Will check tomorrow if others are having a similar issue.

Otherwise a good refresher on the optimization tool.

Spoiler
17 - Castor

My solution. My result is also a bit different.

Spoiler

result

Spoiler

16 - Nebula
Spoiler
my take...

7 - Meteor
Spoiler
The "each song can only appear once" was sneaky.
7 - Meteor

@ahsanaali
Run a unique tool at the start to get the same result as the original post.

There are song's with the same name/popularity/energy/duration that have different IDs

16 - Nebula
Spoiler
15 - Aurora

I got a different (more optimised) answer than the ones given

Spoiler
I noticed that despite the ID, there's definitely duplication of songs in the data set

So I first Deduped the data by grouping by everything except ID