A Graph is a collection of Nodes and Edges, and it is a Non-Linear data structure. It is a mathematical concept in which every node shows a relation with another node through edges. It contains a finite number of vertices(nodes) and each node is connected with another node through an edge.