Showing posts with label DS. Show all posts
Showing posts with label DS. Show all posts

07 August 2017

Graph Data Structure

Data structures are used to store and organize data.
Graph is a primary non-linear data structure,which can solve many real world problems of programming.
There are 2 main parts of graph.
1. Vertices where the data is stored 
2. Edges that connect the Vertices

Unlike Tree, graph has loops. Tree is used to represent hierarchical data.

Few practical applications are
  • Social network connectivity finder(User is the node and edge is the relationship between users)
  • Google maps
  •  Computer Networks 

  Different Types of graphs:

1          Directed Graph                                                                    Weighted graph

weightedgraph
directedGraph












   Undirected Graph

undirectedgraph
Once we model data into a graph, there are standard algorithms to solve different problems.