Question: Task Description Construct a data input file containing the representation of the graph pictured below a DIGRAPH. The DIGRAPH vertices labels are the integer in
Task Description
Construct a data input file containing the representation of the graph pictured below a "DIGRAPH". The "DIGRAPH" vertices labels are the integer in each node circle. Arrows indicate edge directions. Edges without arrowheads are bidirectional and exist as two directed edges.
Your program is to accept a single command line argument when invoked being the data file name. Your program will then read the file contents into memory using your designed dynamic memorybased data storage structure It would be unwise to code your data structure based on the assumption that the graph size is limited to what is pictured below. The testdemo graph may be larger have extra nodes
Once the program reads the file data, close it you may not read from it again. Your program will then prompt the user for three source vertices and destinations. Sample interaction:
Provide sources:
Destination I?:
Shortest Path I from vertex "Number":
Shortest Path from vertex "Number":
Shortest Path from vertex "Number":
Destination :
Shortest Path I from vertex "Number":
Shortest Path from vertex "Number":
Shortest Path from vertex "Number":
Destination :
Shortest Path I from vertex "Number":
Shortest Path from vertex "Number":
Shortest Path from vertex "Number":
Program termination
Upon a negative value user input the program will terminate, to do so it must:
Write a properly formatted log file of all interaction from invocation to termination
For each Shortest path in the log it should also present running time of the calculation in nanoseconds
Deallocate all dynamically allocated memory
Record the overall runtime in seconds
Record the date and time of the run
Display a termination message on the screen
Code Implementation Constraints:
Assume all libraries are blacklisted, exceptions are listed below, you may use all or a subset of the exceptions list contents.
fstream
iomanip
iostream
cstdlib
cassert
cstring
chrono and the chrono namespace
Please note that the exceptions list libraries contain some algorithms these are also blacklisted. Every action performed by your solution must a result of code you designed and implemented.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
