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.
-
Find an example of a start-up incubator or accelerator at the college or university you are attending or in the town you live in or a nearby city. Describe the program. Which one of the Austin,...
-
Let be a positive number. A differential equation of the form dy/dt = ky1+c where is a positive constant, is called a doomsday equation because the exponent in the expression ky1+c is larger than...
-
Elite Mobile Homes reported the following in its financial statements for the year ended December 31, 2007 (adapted, in millions): .Determine the following for Elite Mobile Homes during 2007: a....
-
China is a signatory country to the Madrid Protocol on the international registration of trademarks. Starbucks opened its first cafe in China in 1999 and has added outlets in numerous locations...
-
Interest deductibility provides a strong incentive for debt financing. However, increasing the proportion of debt may lead to larger bankruptcy cost. Explain fully.
-
A firm sells five types of womens parkas. Some data follow. Parka Price Cost Salvage NV Q NV EP A $220 167.2 132 1,100 300 1,176 $47,949 B 205 155.8 127.1 2,000 800 2,269 74,992 C 190 144.4 121.6...
-
Suppose a 0.28 M aqueous solution of oxalic acid (HCO4) is prepared. Calculate the equilibrium molarity of CO4. You'll find information on the properties 2 of oxalic acid in the ALEKS Data resource....
-
In building business relationships, there are many ways that you can record the interactions you have. What type of information should you keep record of? How does your personal appearance affect the...
-
Carryless Arithmetic is basic arithmetic but with the carry from each column ignored. For example, using carryless multiplication, 4 * 4 = 6 but 3* 3 still equates to 9. Below is an example using...
-
discuss the ethical issues surrounding performance appraisal and provide Examples
-
1. What makes up a teacher's unique teaching philosophy, and why is it essential for educators to define their own? How does a teacher's distinct teaching philosophy enrich the overall educational...
-
Qasim started a business on January 1, 2023. During the month, the following financial transactions happened (for each transaction 4 marks, a total of 52): Note: Please write a heading and use the...
-
b. Suppose the particle passes through a small hole in the plane of charge (i.e., the particle does not collide with the plane, but passes straight through it). Sketch the path of the particle after...
-
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...
-
Solve Chapter Problem 13.21, assuming the force is narrowband with a power spectral density given by \(S_{F}(\omega)=\frac{3 \times 10^{-3}}{2+5 \omega^{2}}\). Data From Chapter Problem 13.21: A SDOF...
-
Solve Chapter Problem 13.21, assuming the power spectral density is band limited with \(\omega_{1}=50 \mathrm{rad} / \mathrm{s}\) and \(\omega_{2}=200 \mathrm{rad} / \mathrm{s}\). Data From Chapter...
-
Fine Leather Ltd has provided the following production and sales information for each pair of its dress shoes. The fixed costs for the period are \($1\) 125 000. Required (a) Calculate the...
Study smarter with the SolutionInn App