
The first step in approaching any graph problem is understanding the types of graphs you are working with. In this blog, we have discussed the definitions, properties, and applications of various graph types, such as directed and undirected graphs, dense and sparse graphs, weighted and unweighted graphs, cyclic and acyclic graphs, connected and disconnected graphs, and more.

Just like other data structures, we can represent graphs using two sequential representations: the Adjacency List and the Adjacency Matrix. Both of these representations can be applied to model directed and undirected graphs. We prefer an adjacency list when the graph is sparse and an adjacency matrix when the graph is dense.

A* search algorithm is a popular technique for finding the shortest path in a graph from a given initial node to a destination node. For example, in video games, pathfinding can be used to move objects from their initial place to their destination via shortest route. So implementation of a star algorithm is popular in tile or map-based games.