You are on page 1of 1

We are using Graph to simulate the train network.

We have created the graph class


that has list of vertices and edges. Each vertice represents a Station. An edge is
something that connects two vertices. Each Edge represents a route from one station
to the other which falls on some train line and also stores the time taken for
travel between the 2 vertices.

We use BFS searching algorithm to traverse through the graph as it gives the
complexity of O(n) where n represents the number of vertices into the number of
edges.

You might also like