Starting from:

$29.99

Project 6: network broadcasting

Project description
You are in the planning stages of setting up the distribution network for a internet-based
television system. There is an existing network of computers which are at different cities, which
are the endpoints for your network. These computers have connections to each other with
varying delay times.
For a network configuration, you need to also designate one computer as the primary source for
the television content. This computer will send the content over the network to all other
computers. This source computer must be chosen in such a way that it minimizes the total
transmission time to all the other computers in the network.
Network layout
We will represent the network as a set of computers connected by network links. Each computer
will be named after the city it is in. Every name will be made up of only lowercase letters and
underscores.
Each network link will connect two computers, in a particular direction, and will have an
associated delay time. Note that just because there is a network link from computer A to
computer B doesn't mean that there is one from B to A. Even if there is, they may have different
delays.
Input
Your input will consist of a description of the existing network. You will get as input the number
of network connections, followed by a list of the connections with the delay of each connection.
Delay times will always be non-negative integers (representing milliseconds).
Not all computers may be the server. Only a computer that has the string "_server" at the very
end of its name may be a server. Be careful how you check for this suffix; it can be a source of
difficulty.
Output
You should print out the name of the computer that has the shortest total delay time to all other
computers in the network, as well as the total delay time. If there are multiple computers that
have equivalent delay times, print them all, sorted in alphabetic order.
It may be that some networks do not have a server that can reach every other computer. If this
is the case, print an appropriate error message.
Sample input and output• input 1
• input 2
• input 3
• input 4
Provided code
You must use the .h files provided here.
• ArrayHeap:
• arrayheap-prof-proj6.h
• arrayheap-student-proj6.h
• Graph:
• graph-proj6.h
You will use the ArrayHeap code you wrote for project 5, with a modification that allows you to
change the value on the heap. This is necessary to implement Dijkstra's algorithm.
Remember that when using templates, all of the code you write goes in the (student's) .h file.
You will submit these files: arrayheap-student-proj6.h, graph-proj6.cpp, and driver-proj6.cpp.
In your driver, you may find the STL map useful for converting the strings given on the input to
integers which are used in the Graph class as vertex indexes. We will talk about this in class.
Please feel free to use the following STL cheatsheets to learn more about some of the STL
types used in this project:
• cheatsheet 1
• cheatsheet 2
Here is a complete and authoritative reference for the STL from Silicon Graphics.
Structuring the project
Since this is a large project, it helps to have a plan of attack. The following milestones should be
turned in via the upload site by noon on the due date.
Step Finish by Milestone
1 Friday,
November 17
WRITE and TEST the required changes to the ArrayHeap class. Do
not underestimate the difficulty of these modifications!
2 Monday,
November 20
WRITE and TEST the dijkstra method in the Graph class.
3 Friday,
December 1
WRITE and TEST the driver and finish the project.Writing a test driver for a data structure means writing a small, self-contained program that tests
the different methods of the data structure and verifies that they are correct. For each milestone
you should develop and turn in a driver that illustrates testing your code.
Sample executables
Here are sample executables for you. When you design test cases, you can judge your output
against the output from my correct solution. Here are my compiled solutions:
• DOS executable
• Linux executable
• OSX executable
As in previous projects, if you give a command-line argument to these executables, they will
print extra information about how they are running

More products