# Graph Data Structure

Non-Linear Data Structure

What do you mean by a Graph in the non-linear data structure?
A graph G which consist of a nonempty set V which is a set of nodes and set E which is the set of edges of the graph, and a mapping from the set for edge E to a set of pairs of elements of V. It can also be represented as G=(V, E).

What do you mean by adjacent nodes in the non-linear data structure?
Any two nodes which are connected by an edge in a graph are called adjacent nodes. For Example, if an edge (x) is connected to a pair of nodes (u,v) then we say that the edge x connects the nodes u and v.

Name the different ways of representing a graph in the non-linear data structure?
1. Adjacency matrix representation
2. Adjacency list representation

What are the two traversal methods used in traversing a graph in non-linear data structure?
1. Breadth first search
2. Depth first search

What do you mean by an acyclic graph in the non-linear data structure?
A simple diagram which does not have any cycles is called an acyclic graph in the non-linear data structure.

What do you mean by topological sort?
A topological sort is an ordering of vertices in a directed acyclic graph, such that if there is a path from vi then vj appears after vi in the ordering.

What do you mean by single-source shortest path problem in the non-linear data structure?

If input a weighted graph, G=(V,E) and a distinguished vertex,'s' find the shortest weighted path from 's' to every other vertex in G.

Thanks
Mukesh Rajput Mukesh Rajput

I am a Computer Engineer, a small amount of the programming tips as it’s my hobby, I love to travel and meet people so little about travel, a fashion lover and love to eat food, I am investing a good time to keep the body fit so little about fitness also..