CSCI 151 Lab 3
Here you will find extra requirements for Lab 3.
Extra Requirements
These requirements extend from the original requirements on Prof. Stapletons Graph Lab
Sample input/output
- Here is a sample input file and sample output file to test your programs with. To test your program you can run your program with the sample input and make sure your outputs match my sample output. The command to run your program with my sample input will be:
- PrimProg < inputfile > newoutputfile
Turn-in
- Please place only your .cpp and .h files into your turn-in directory. Also include a Makefile for me to compile your project with. Please do not include object files or executables. I will be compiling your project with the make command. Here is a makefile that you can use if you are unfamiliar with creating makefiles. Filenames for this Makefile are:
- PrimMain.cpp - For your Main function
- Network.cpp - For your Network Class
- Network.h - For your Network Class header
- PrimProg - Executable name
Output Messages
You will first print out the full graph after you reach the blank line on the input file. Then you will print out the Minimum Spanning tree graph after you have created it. Lastley you will print the cost of your Minimum Spanning tree. Please print out Graphs in this fashion:
- For each Node within your graph you will print out the Node number followed by all the other node it shares an edge with followed by the weight of that edge. You will print out the Node then a comma and then the weight. These edges will be printed out in the order with respect to the node number. Between each entry you will you will print out an arrow in this fashion "->". As an example if node 0 shares and edge with node 1 with weight 45 and also shares an edge with node 2 with weight 35 then you would print:
0 -> 1,45 -> 2,35
For each graph you will print out the edges for every node within your graph. Please use the sample output file as an example of how to print out the graph.
- "Full Graph:" - You will print this label before your print the non spanning tree graph.
- "Minimum Spanning Tree:" - You will print this label before you print the minimum spanning tree graph.
- "Minimum Spanning Cost: VALUE" - you will print this after you have found the minimum spanning tree. For example if your spanning tree has the minimum cost of 32 then you will print:
Minimum Spanning Cost: 32