Skip to content

Commit acbcaec

Browse files
authoredDec 13, 2022
Update Writeup.md
1 parent 6821db8 commit acbcaec

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed
 

‎Writeup.md

+5
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ Niketh Lakshmanan, Wyatt Wethington, Arnav Sheth, Nathan Parekh
66

77
At the start of our project, we identified the first goal of our project, using Python to pull data from Spotify's API. We began by researching the Spotify API and familiarizing ourselves with the different endpoints and the data they provided. We then identified the specific data we wanted to collect and the exact endpoints that contained that data. Next, we set up our development environment using Python and the Spotify API library. We then used the library to authenticate our application and obtain an access token. We used this access token to make requests to the Spotify API and retrieve the data we needed. Upon retrieval of the data, we had functions to parse the larged jumbled data into readable data, with “;” separating the songs and the corresponding data members of each song. This program is also easily customizable; the hyperlink in the “getURL” function of the Python needs to be swapped with the hyperlink of another Spotify playlist.
88

9+
Runtime efficiencies - for one out of three algorithms (dijkstra’s and BFS), the target time complexity O(V), where V is number of vertices, was (mostly) met. Best case for dijkstra’s is O(V). For betweenness centrality, however, this runtime was not matched; in the best case, betweenness centrality is O(V^2) because it has to run dijkstra’s algorithm more than V times. Not sure if there’s a way to run betweenness centrality in O(V) time.
10+
11+
Space complexities for the algorithms were all met - O(n), where n is number of nodes.
12+
13+
914
We worked on creating a graph class using an adjacency matrix in C++ to store data we pulled from Spotify. We began by creating a class for the graph itself, as well as functions to manage the data stored in the matrix. We used a two-dimensional array to store the data, with each row representing a node and each column representing an edge. In order to make sure the data was properly stored, we implemented a number of checks and balances, including validating the input data, ensuring the data was consistent, and automatically resizing the matrix when necessary. Once the data was properly stored, we wrote several functions to help us traverse the graph. We wrote functions in the Graph class that allowed us to add nodes and add weights between 2 nodes, using an algorithm and formula that we devised which arbitrarily calculates the similarity between two songs given only the name, artists, and genres. We measured the validity of this class by running the member functions on multiple different datasets (which were different playlists from Spotify).
1015

1116
In the Graph class, we had an addNode and addWeight function which would take in the song we wished to input and add it into the graph. The addWeight function determines the weight, which is the mean popularity between the two given input songs, and it sets the weight to this value in the adjacency matrix.

0 commit comments

Comments
 (0)
Please sign in to comment.