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).
0 commit comments