Reference no: EM13925112
Implement a new class for graphs with weighted edges. Either you use the ordinary Graph class as a superclass for your implementation, or you start it from scratch by following the pattern used in the ordinary Graph class. The ordinary Graph class is implemented by Michael Main which can be downloaded from his website.
After implementing the new class, provide two extra methods to implement Dijkstra's shortest distance and shortest path algorithms as described on pages 732-743 of the third edition or pages 760-771 of the fourth edition. Please carefully read the algorithm explanation and examples in those pages so that you fully understand the whole algorithms.
The shortest path algorithms only differ from the base shortest distance algorithm in keeping a record of previous vertex for each vertex. It would be helpful to write a method for printing a path from the start vertex to a given vertex as a list of vertices on the path.
After you implement the weighted graph as requested above, write a program to help a traveler plan the shortest traveling path from one city to another. I expect your program should read a file of data containing information about a group of cities and create a graph for this group of data. The file takes the following format. In the first line of the file is the number of cities interested in the program. Then each line of the file contains three integers. The first two are the indices of cities and the third one is the distance between two cities indexed by indices (suppose that distances are integers). There is another file consisting of pairs of index (an integer) and city names (String). Doing so can make your program simpler in building graph objects. Your program needs to read in the second file too.
For example, the below may be the content of such as files:
distance.txt
5
0 3 215
1 3 731
2 4 337
4 0 280
1 2 823
Index.txt
0 town 1
1 town 2
2 town 3
3 town 4
4 town 5
Please produce your own distance and index files so that you must have at least twenty cities and specify at least 30 distances. You don't need to provide the actual distance between known cities.
Finally your program allows the user to enter queries of the form "City1, City2" and have the program print the shortest sequence of path to travel from City1 to City2.
Generally used in preparing a statement of cash flows
: One of Astro Company's activity cost pools is machine setups, with estimated overhead of $150,000. Astro produces sparklers (400 setups) and lighters (600 setups). How much of the machine setup cost pool should be assigned to sparklers?
|
What is a non-cyclical industry and give a few examples
: What is a non-cyclical industry? Give a few examples. What other industries would be impacted, either concurrently or shortly thereafter?
|
Wi-fi security in a wireless network
: Create a policy for 802.11 Wi-Fi security in a wireless network in a 500-employee company with a 47-access point WLAN. This is not a trivial task.
|
Effective compensation and benefit system
: How an effective compensation and benefit system contributes to organizational effectiveness. The principle components of your revised compensation and benefit system for a large-scale organization as well as a recommendation for each component.
|
New class for graphs with weighted edges
: Implement a new class for graphs with weighted edges. Either you use the ordinary Graph class as a superclass for your implementation, or you start it from scratch by following the pattern used in the ordinary Graph class. The ordinary Graph class..
|
Compute ending inventory
: Boyne Inc. had beginning inventory of $18,000 at cost and $20,900 at retail. Net purchases were $131,590 at cost and $181,700 at retail. Net markups were $11,100; net markdowns were $8,200;
|
Analyze the key reasons for the divergent performance
: Read a business newspaper or other business publications and identify four industries that are doing well currently and four industries that are under-performing. Analyze the key reasons for the divergent performance.
|
Analysis-companies does have strong strategic intent posture
: Conduct a thorough and well-argued analysis that provides evidence that one of your chosen companies does have a strong strategic-intent posture.
|
Successfully funding your business venture
: For Assignment 1, you imagined that you were going to start a company that offered an innovative product or service. In Assignment 1 you also determined the business structure you would use for that venture. For this assignment, you can use that s..
|