Description:What we need to solve is determining if a path exists between two stations. We can do this using breadth first search and an adjacency list. But an adjacency list will not be as practical as we move on to other problems like determining the shortest route between two stations. Therefore, your task is to determine if a route exists between two stations using breadth first search and an adjacency matrix. At a minimum, the following public functions need to be implemented: Graph ( int routes, int stations ) Initialize total number of routes and stationsvoid addRoute( int from, int to, int weight ) Add route to adjacency matrix with appropriate weightbool isRoute( int from, int to ) Return bool value indicating existence of route. You may need to add more private/public functions in order to accomplish your task.For simplicity you are allowed to statically allocate an adjacency matrix of size 100 i.e. adjMatric[100][100]. This assumes there will never be more than 100 stations in your file. Remember; always know what type of graph you are using. Your program should be built to handle a weighted, directed graph.Finally, your program will need to read data from a file formatted as follows: 10 20 1 102 9 1… The first line of the file will contain two integers indicating the number of stations and routes. Following this first line will be n (n being equal to the total number of routes) lines representing different routes and their associated weights.For example, line 2 of the above example indicates that there is a route from station 0 to station 1 with a weight of 10. The data from this file should be used to initialize and populate your graph. Due: April 22nd, 2016 11:59 PM ET(New York Time)The code should be written in C++ and the solution myst compile and must be submitted by due time. Here’s an example with the data provided in the main function..#include
Use the order calculator below and get started! Contact our live support team for any assistance or inquiry.
[order_calculator]