In computer science, a graph is an abstract data type that is meant to implement the undirected graph and directed graph concepts from the field of graph theory within mathematics.
A graph data structure consists of a finite (and possibly mutable) set of vertices (also called nodes or points), together with a set of unordered pairs of these vertices for an undirected graph or a set of ordered pairs for a directed graph. These pairs are known as edges (also called links or lines), and for a directed graph are also known as edges but also sometimes arrows or arcs. The vertices may be part of the graph structure, or may be external entities represented by integer indices or references.
In a Graph, we have a set of nodes (a.k.a vertices) and these nodes are connected with each other with the help of some edges. The nodes or vertices are used to store data and this data can be used further.
- A graph is a type of non-linear data structure that is used to store data in the form of nodes and edges.
The main difference between directed and undirected graph is that a directed graph contains an ordered pair of vertices whereas an undirected graph contains an unordered pair of vertices.
Acyclic and cyclic compounds are the two main groups of compounds that are categorized based on the basic structure of the molecule. The key difference between acyclic and cyclic organic compounds is that acyclic compounds are linear compounds, whereas cyclic compounds are non-linear compounds.
Graphs are extremely popular when it comes to it’s uses. Here are just a few examples of graphs in use:
- GPS and Mapping
- Driving Directions
- Social Networks
- Airline Traffic
- Netflix uses graphs for suggestions of products


