I wanted to simulate a railway network where there would be stations, trains and routes connecting each station. So how do you think I should attempt to model this? I thought of using graphs taking station as vertex and edges as routes. Also since there will be tens of trains and stations and hence hundreds of routes so should I model the database as a graph in mysql or should I write create a php program containing the graph which retrieves info from the database?
I am a relatively beginner programmer and be glad with some help as I am very confused at this moment. Any other better idea is also welcome.
You’re going to want to use Dijkstra’s algorithm for this. I know there are stored procedures online (to create the database of stations) somewhere I just can’t find them right now. Should help you get started though.