

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Instructions for assignment 4 in the cop 4531 algorithms course, where students are required to implement programs to find the minimum spanning tree of a connected graph using prim's and kruskal's algorithms. Details on the input and output file formats, sample files, and submission instructions.
Typology: Assignments
1 / 2
This page cannot be seen from the preview
Don't miss anything!


Spring 2007
Assignment 4
Due: 19 Apr 2007
Problem: In this assignment, you will implement programs to find the minimum spanning tree in two different ways.
Sorting methods: You should create programs that will find the minimum spanning tree of a connected graph using the following algorithms.
Running the program: Your program will be run as follows: <executable-name> <input-file-name> <output-file-name>
Input and output files: The input and output files will have the following format.
Input Output n v1 s 11 w 11 s 12 w 12 ... s (^1) k 1 w (^1) k 1 . . vn sn1 wn1 sn2 wn1 ... sn (^) kn wn (^) k n
n v1 r 11 r 12 ... r (^1) l 1 . . vn rn1 r (^) n2 ... rn (^) l n
Here, n is the number of vertices, vi are strings containing the names of vertices, sij is a string giving the name of the j th neighbor of vertex i in the original graph, wij is a float number giving the weight of the corresponding edge, ki is the degree of vertex vi in the original graph, rij is a string giving the name of the j th neighbor of vertex i in the minimum spanning tree found, and l (^) i is its degree in this tree.
Sample input file Sample output file 4 ab cd 4.2 e 1.0 f 1. cd ab 4.2 e 3. e ab 1.0 cd 3.2 f 2. f ab 1.0 e 2.
ab e f cd e e ab f ab
Files: You should create a directory called COP4531/hw4 on linprog. This directory should contain the following files, implementing the algorithm indicated by the file name.
Sample application: Please run your code on a graph that arises from some real world application, using real world data, and report the results you get, in one or two pages. Your report you should mention the application you considered, identify what the vertices, edges, and edge weights represent (for example, vertices are cities, edges are roads between cities, and weights are driving distances), give the size of the data in terms of the number of edges and number of vertices, cite the source of your data, and summarize your findings.
Turning in your assignment: The code is due by midnight of the due date. Turn in instructions will be provided later. A hardcopy of the report is due by 5 pm on 20 April 2007.
Grading: You will be graded on the following (i) correctness of your codes, (ii) performance of your codes, and (iii) the quality of your report.