graph algorithms an undirected graph is connected if there is path from every vertex to every other vertex directed graph with this property is called strongly connected if directed graph is not strongly connectedbut the underlying graph (without direction to the arcsis connectedthen the graph is said to be weakly connected complete graph is graph in which there is an edge between every pair of vertices an example of real-life situation that can be modeled by graph is the airport system each airport is vertexand two vertices are connected by an edge if there is nonstop flight from the airports that are represented by the vertices the edge could have weightrepresenting the timedistanceor cost of the flight it is reasonable to assume that such graph is directedsince it might take longer or cost more (depending on local taxesfor exampleto fly in different directions we would probably like to make sure that the airport system is strongly connectedso that it is always possible to fly from any airport to any other airport we might also like to quickly determine the best flight between any two airports "bestcould mean the path with the fewest number of edges or could be taken with respect to oneor allof the weight measures traffic flow can be modeled by graph each street intersection represents vertexand each street is an edge the edge costs could representamong other thingsa speed limit or capacity (number of laneswe could then ask for the shortest route or use this information to find the most likely location for bottlenecks in the remainder of this we will see several more applications of graphs many of these graphs can be quite largeso it is important that the algorithms we use be efficient representation of graphs we will consider directed graphs (undirected graphs are similarly representedsupposefor nowthat we can number the verticesstarting at the graph shown in figure represents vertices and edges figure directed graph