graphs learning objective in this we will discuss another non-linear data structure called graphs we will discuss the representation of graphs in the memory as well as the different operations that can be performed on them last but not the leastwe will discuss some of the real-world applications of graphs introduction graph is an abstract data structure that is used to implement the mathematical concept of graphs it is basically collection of vertices (also called nodesand edges that connect these vertices graph is often viewed as generalization of the tree structurewhere instead of having purely parent-to-child relationship between tree nodesany kind of complex relationship can exist why are graphs usefulgraphs are widely used to model any situation where entities or things are related to each other in pairs for examplethe following information can be represented by graphsfamily trees in which the member nodes have an edge from parent to each of their children transportation networks in which nodes are airportsintersectionsportsetc the edges can be airline flightsone-way roadsshipping routesetc figure undirected graph definition graph is defined as an ordered set (ve)where (grepresents the set of vertices and (grepresents the edges that connect these vertices figure shows graph with ( {abcd and eand ( {(ab)(bc)(ad)(bd)(de)(ce)note that there are five vertices or nodes and six edges in the graph