Graphs are represented by the edges between the nodes. The connecting edges can be considered directed or undirected. If the connecting edges in a graph are undirected, then the graph is called an undirected graph, and if the connecting edges in a graph are directed, then it is called a directed graph. An undirected graph simply represents edges as lines between the nodes. There is no additional information about the relationship between the nodes, other than the fact that they are connected. For example, in the following diagram, we demonstrate an undirected graph of four nodes, A, B, C, and D, which are connected using edges:
In a directed graph, the edges provide the information on the direction of connection between any two nodes in a graph. If an edge from node A to B is said to be directed, then the edge (A, B) would not be equal to the edge...