So I have been trying to find a good place to learn how to implement a graph, but I have been unable to find one.
I have to create a program that reads in the data about airports and the airports that they are connected to. And the goal of the program is to find the least expense way to go from point A to point B. My question is, how do I put in the data from a file and make a graph out of it? Below is my code to read in the file.
Thanks a bunch for looking over this. I just don't really understand how to input data into a graph and be able to get information from it. Thanks again
Code:while (!textFile.eof()) { textFile >> startAirport >> endAirport >> milege >> cost; cout << startAirport << " " << endAirport << " " << milege << " $" << cost << endl; }
Bookmarks