N/APosted on - 03/02/2015
Hello! I just studied a data structure named graphs. I want to know what are some of the uses of this data structure in real life. Where do we need to implement this structure and how is it used and implemented? I have heard it is used in search engines and social networking sites but the question is how?
Important uses of the data strucutre ‘Graph’
A vertex referred to as a node is a fundamental part of a graph. An edge referred to as an arc connecting two vertices to show that a relationship exists between them. Edges may be weighted to indicate the presence of cost to move from one vertex to another. A path in a graph can be defined as a sequence of vertices joined by edges. A cycle in a directed graph represents a path that begins and ends at one (same) vertex.
G = (V, E)
The two mostly used representations of the graph are adjacency matrix and adjacency list.
A network of roads can be modeled into a directed graph, with one directional streets represented by an arrow between the endpoints in the corresponding direction and two way road is represented by a pair of parallel edges running in both directions between the end points.