A graph is a data structure you can use to solve routing problems, such as "Are these two components connected?" and "What is the shortest path from point a to point b?"
If you have an undirected edge from a to b, there is also a way from b to a.
If you have a directed edge from a to b, there is not necessarily a way from b to a (as this would require a separate directed edge from b to a, which may not exist).
Example: a graph that has as nodes the capitals of the Nordic countries, and as (undirected) edges the driving distance to the cities connected by a direct road.
<ahref='https://github.com/freecodecamp/guides/tree/master/src/pages/algorithms/graph-algorithms/breadth-first-search/index.md'target='_blank'rel='nofollow'>Breadth First Search (BFS)</a>
<ahref='https://github.com/freecodecamp/guides/tree/master/src/pages/algorithms/graph-algorithms/depth-first-search/index.md'target='_blank'rel='nofollow'>Depth First Search (DFS)</a>