Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

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 #424: Optimize the Energy of Your Playlist

AYXAcademy
Alteryx
Alteryx

Maveryx_WC_Banner.png

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!

 

AYX-Maveryx_Micro Identity-Maveryx Academy_wordmark.png

ahsanaali
11 - Bolide
Spoiler
424.png

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

 

mmontgomery
11 - Bolide
11 - Bolide

Fun!

Spoiler
c424.png
ed_hayter
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
image.png
AkimasaKajitani
17 - Castor
17 - Castor

My solution. My result is also a bit different.

 

Spoiler
スクリーンショット 2024-04-30 013513.png

result

Spoiler
スクリーンショット 2024-04-30 014358.png

スクリーンショット 2024-04-30 014340.png

スクリーンショット 2024-04-30 014347.png

 

Kenda
16 - Nebula
16 - Nebula
Spoiler
my take... 

image.png
sfarnham1
7 - Meteor
Spoiler
The "each song can only appear once" was sneaky.
sfarnham1
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

RolandSchubert
16 - Nebula
16 - Nebula
Spoiler
424.jpg
OllieClarke
15 - Aurora
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

image.png

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

image.png