creates a graphs from routes and stops