non-connected graph consists of several connected components in figure -ba and are one connected componentand and are another for simplicitythe algorithms we'll be discussing in this are written to apply to connected graphsor to one connected component of non-connected graph if appropriatesmall modifications will usually enable them to work with non-connected graphs as well directed and weighted graphs the graphs in figures and are non-directed graphs that means that the edges don' have directionyou can go either way on them thus you can go from vertex to vertex bor from vertex to vertex awith equal ease (this models freeways appropriatelybecause you can usually go either way on freeway howevergraphs are often used to model situations in which you can go in only one direction along an edgefrom to but not from to aas on one-way street such graph is said to be directed the allowed direction is typically shown with an arrowhead at the end of the edge in some graphsedges are given weighta number that can represent the physical distance between two verticesor the time it takes to get from one vertex to anotheror how much it costs to travel from vertex to vertex (on airline routesfor examplesuch graphs are called weighted graphs we'll explore them in the next we're going to begin this by discussing simple undirectedunweighted graphslater we'll explore directed unweighted graphs we have by no means covered all the definitions that apply to graphswe'll introduce more as we go along figure onnected and nonconnected graphs historical note one of the first mathematicians to work with graphs was leonhard euler in the early th century he solved famous problem dealing with the bridges in the town of konigsbergpoland this town included an island and seven bridgesas shown in figure -