Graph Question Bank
Graph Question Bank
PART - A
1. Define Graph.
A graph G consist of a nonempty set V which is a set of nodes of the graph, a 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).
Any two nodes which are connected by an edge in a graph are called adjacent nodes. For
example, if an edge x ε E is associated with a pair of nodes (u,v) where u, v ε V, then we say that
Indegree: The indegree of a vertex is the total number of edges coming to that node.
Outdgree: The outdgree of a node is the total number of edged going out from that node.
Source: A vertex, which has only outgoing edges and no incoming edges, is called a source.
Sink: A vertex having only incoming edges and no outgoing edges is called sink.
Pendant: When indegree of a vertex is one and outdegree is zero then such a vertex is called
pendant vertex.
If there exists a walk in the connected graph that visits every edge of the graph exactly once
with or without repeating the vertices, then such a walk is called as an Euler walk.
1. Sequential representation
a. Adjacency matrix representation
b. Incidence matrix representation
c. Circuit matrix representation
d. Cut set matrix representation
e. Path matrix representation
2. Linked representation
18. List the various graph traversals.
The two graph traversals present in graph are as follows
1. Breadth First Traversal
2. Depth First Traversal
The above graph contains a cycle a-b-c-f-d-e-a that visits each vertex exactly once.
Therefore, the cycle is a hamiltonian circuit.
PART – B
1. Describe the various representations of a graph with a suitable example for each.
2. Give the Incidence matrix representation, cut set matrix representation, adjacency
matrix representation and adjacency list representation of the following graph.
3. Write an algorithm for breadth first traversal and trace the output for the graph given
below for the same.
4. Write an algorithm for depth first traversal and trace the output for the graph given
below for the same.
5. Write an algorithm for Dijkstra’s algorithm and find the shortest path from the source
node 0 for the graph given below.