Your task for this project is to build a graph representing a network that spans cross...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Your task for this project is to build a graph representing a network that spans cross Canada: Each major Canadian city (Vancouver, Edmonton, Calgary, Saskatoon, Regina, Winnipeg, ThunderBay, Sudbury, Kitchener, Hamilton, Toronto, Barrie, Oshawa, Peterborough, Kingston, Ottawa, Montreal, Sherbrook, Quebec, SaintJohn, Moncton, Halifax, CapeBreton) hosts one router labeled with the name of the city. We will simply use the distance between routers/cities as the weight on the edge connecting their corresponding vertices (you can use maps.google.ca to find the distance between cities). Edges connecting routers will also have a certain bandwidth. You need to compute the best path between two routers that can support a certain amount of bandwidth and while minimizing the total time taken for a data packet sent from a source router to reach its destination router. The shortest time path with enough bandwidth minimizes the sum of the weights of the links along the path. Oshawa Whitby 9 2 Oshawa Toronto 61 12 Oshawa Kingston 205 21 b) Update the graph to reflect changes to the network, including: 1. Changing the weight and bandwidth on an edge 2. Removing one edge from the graph 3. Removing one node from the graph c) Find and display the shortest path from a vertex to all other vertices in the graph based on its current state This should compute the path with a certain bandwidth from one router to all destination routers using Bellman- Ford algorithm for the current state of the graph. The required bandwidth is provided by the user. For the display, it doesn't have to be sophisticated. Even if it is text based, it should be ok. For this final project, your task is to write a computer program to: a) Build the initial graph of the network from an input file The initial state of the graph should be read from a file called network.txt (use only names of the cities that are listed above). The format of the file is quite simple: Each link representing an edge is listed on a line, and is specified by the names of its two vertices followed by the weight on the edge connecting the two vertices and the available bandwidth on that edge. Vertices are simply strings (cities names with no spaces) and the weights and bandwidth are integer numbers. For the above example, the file will look like: d) Compute and display the minimum spanning tree of the graph Use Kruskal's algorithm to find and display the minimum spanning tree of the graph for a specified bandwidth. The user will provide that bandwidth. All edges on the resulting spanning tree should have more bandwidth that the one provided by the user. For the display, it doesn't have to be sophisticated. Even if it is text based, it should be ok. e) Quit Simply cause the program to exit. Ottawa Montreal 199 4 Ottawa Kingston 196 7 Your task for this project is to build a graph representing a network that spans cross Canada: Each major Canadian city (Vancouver, Edmonton, Calgary, Saskatoon, Regina, Winnipeg, ThunderBay, Sudbury, Kitchener, Hamilton, Toronto, Barrie, Oshawa, Peterborough, Kingston, Ottawa, Montreal, Sherbrook, Quebec, SaintJohn, Moncton, Halifax, CapeBreton) hosts one router labeled with the name of the city. We will simply use the distance between routers/cities as the weight on the edge connecting their corresponding vertices (you can use maps.google.ca to find the distance between cities). Edges connecting routers will also have a certain bandwidth. You need to compute the best path between two routers that can support a certain amount of bandwidth and while minimizing the total time taken for a data packet sent from a source router to reach its destination router. The shortest time path with enough bandwidth minimizes the sum of the weights of the links along the path. Oshawa Whitby 9 2 Oshawa Toronto 61 12 Oshawa Kingston 205 21 b) Update the graph to reflect changes to the network, including: 1. Changing the weight and bandwidth on an edge 2. Removing one edge from the graph 3. Removing one node from the graph c) Find and display the shortest path from a vertex to all other vertices in the graph based on its current state This should compute the path with a certain bandwidth from one router to all destination routers using Bellman- Ford algorithm for the current state of the graph. The required bandwidth is provided by the user. For the display, it doesn't have to be sophisticated. Even if it is text based, it should be ok. For this final project, your task is to write a computer program to: a) Build the initial graph of the network from an input file The initial state of the graph should be read from a file called network.txt (use only names of the cities that are listed above). The format of the file is quite simple: Each link representing an edge is listed on a line, and is specified by the names of its two vertices followed by the weight on the edge connecting the two vertices and the available bandwidth on that edge. Vertices are simply strings (cities names with no spaces) and the weights and bandwidth are integer numbers. For the above example, the file will look like: d) Compute and display the minimum spanning tree of the graph Use Kruskal's algorithm to find and display the minimum spanning tree of the graph for a specified bandwidth. The user will provide that bandwidth. All edges on the resulting spanning tree should have more bandwidth that the one provided by the user. For the display, it doesn't have to be sophisticated. Even if it is text based, it should be ok. e) Quit Simply cause the program to exit. Ottawa Montreal 199 4 Ottawa Kingston 196 7
Expert Answer:
Answer rating: 100% (QA)
Sol a import networkx as nx import csv Data opentestestcsv r encodingutf8 read csvreaderData GraphtypenxGraph use netGraph for undirected graph G nxre... View the full answer
Related Book For
Posted Date:
Students also viewed these algorithms questions
-
2. If (x + 4)(x + 1)(x - 2) = Ax + Bx + Cx + D, find the values of A, B, C and D.
-
Your job in this project is to write JAVA program that behaves like the windows shell. It must show a prompt showing the current directory and prompt the user to type the command that need to be...
-
This project is to evaluate the nutrition content of a fast food meal. Select any fast food restaurant for this project. You may go there in person or you can use on-line information. You can Google...
-
If a= <1,0,1>, b= <2,1,-1>, and c= <0,1,3>, show that aX(bXc) is not equal (aXb)Xc.
-
Exercises 24 and 36 describe an experiment investigating the effectiveness of exercise in combating insomnia. Researchers randomly assigned half of the 40 volunteers to an exercise program. a) Why...
-
What is the difference between tactical and strategic decisions?
-
Consider the model of a voluntary environmental agreement, in which there is a firm, a regulator, and a legislature. Benefits of abatement (in terms of reduced damage from pollution) are given by...
-
Uniform internal heat generation at q = 5 X 107 W/m3 is occurring in a cylindrical nuclear reactor fuel rod of 50-mm diameter, and under steady-state conditions the temperature distribution is of the...
-
2. Inspired by the magnificent cats owned by your professor, you and your friends decide to open a kitten shelter for rescued cats. Since optimization is your absolute favorite course, you and your...
-
1.Identify the three countries with the most favorable collection experience as measured by their receivables turnover ratios. RTR US = RTR Saudi Arabia = RTR UK = 2. Which country appears to have...
-
Amber transfers property worth $300,000 (basis of $290,000) to X Corporation for 80% of the stock in X Corporation (FMV of $280,000). X also executes a long-term note (FMV of $20,000) made payable to...
-
Two masses m = 2.1 kg and m = 12.7 kg are attached to each other by a string passing through a massless pulley of radius R = 140 cm. m is also attached to vertical spring of stiffness constant k = 12...
-
d 2 dz w = 7ze Find dw W 2 dz for the given function.
-
"What constitutes Recruitment and Selection, and what significance does the process of selection hold within the realm of human resource management?"
-
: What does the supportability engineering focus center on during the conceptual design stage? (a) Design characteristics (b) Interoperability issues (c) In-service sustainment (d) Development of...
-
How does the temperature affect the performance and reliability of electronic components?
-
the consumption function C = a + bYD , the value of a is determined in part by: A. Disposable income. B. The level of imports. C. Consumer confidence. D. All of the above.
-
How do the principles of (a) Physical controls and (b) Documentation controls apply to cash disbursements?
-
The Grady Tire Company recaps tires. The weekly fixed cost is $2,500, and the variable cost per tire is $9. Price is related to demand, according to the following linear equation: v = 200 - 4.75p...
-
A national catalog and Internet retailer has three warehouses and three major distribution centers located around the country. Normally, items are shipped directly from the warehouses to the...
-
Kroeger supermarket sells its own brand of canned peas as well as several national brands. The store makes a profit of $0.28 per can for its own peas and a profit of $0.19 for any of the national...
-
Credit card fraud is considered almost incidental to the potentially more damaging and costly problem of identity theft. Check the Internet for recent statistics on the number of consumers affected,...
-
Visit the Consumer Financial Protection Bureau Web site (www.consumerfinance.gov). Based on the public information available, describe what role the bureau plays in providing consumer education,...
-
Are the initial rates lower on a fixed-rate loan or a variable-rate loan? Why?
Study smarter with the SolutionInn App