Algorithms Final Lab


    This is my final lab for my Algorithms class. This lab was about implementing Dijkstra Algorithm with two types of data structures for the priority queue, a linked list and a min-Heap. For this, I had to modify our existing graph class we were using from previous that handle graphs to handle weight edges. I have already had a Node class that represents each node in the graph and all I had to do was add a property of distance and set this to infinity until it is assigned a distance when creating the graphs. To create graphs, you create a txt file with the name of the starting node, the node that the first one points to, and a double of its distance with tabs between all of them. The Program scans this txt file in a creates the structure to represent the graph. The program then test both implementations of the priority queue by using a R script embedded in the program to test the two structures with varying number of nodes and edges (2500 to 100000 for nodes, 125000 to 1000000 for edges) and plots it runtime to compare. The results of the tests where that the min-Heap holds stronger than the list implementation and both structures are somewhat consistent with their theoretical running times. See my report below for more information.