Graph Question Bank

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 8

UNIT IV –GRAPHS

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).

2. Define adjacent nodes.

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

the edge x connects the nodes u and v.

3. What is a directed graph?

A graph in which every edge is directed is called a directed graph.

4. What is an undirected graph?

A graph in which every edge is undirected is called a directed graph.

5. What is a self loop in graph?

An edge of a graph which connects to itself is called a self loop.

6. What is a Complete Graph?


An undirected graph, in which every vertex has an edge to all other vertices, is called a complete
graph. A complete graph with N vertices has (N (N-1))/2 edges.

7. What is a Weighted Graph?

A weighted graph is a graph in which edges are assigned some


value. For example, an edge may represent a highway link between two cities.
The weight will denote the distance between connected cities using highway.
Weight of an edge is also called its cost.

8. What is a Cycle in a graph?

A cycle is a simple path that begins and ends at the same


vertex. An example is shown below:
9. What is a Connected Graph?

A graph is said to be connected if there exists a path


between every pair of vertices Vi and Vj.

10. What is a Subgraph?


A subgraph of G is a graph G1 such that V (G1) is a subset of V (G) and E (G1) is a subset of E
(G).

11. What is a Degree of a Vertex?

The total number of edges linked to a vertex is called its


degree.

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.

Isolated: When the degree of a vertex is zero, it is an isolated vertex.

12. What is a Multigraph?


A graph with multiple occurrences of the same edge is known as a multigraph.

13. What is a path in a graph?

A path from a vertex Vi to vertex Vj in an undirected graph G is a sequence of vertices Vi,


Vj1,Vj2,…,V1k,Vj such that (Vi, Vj1)( Vj1,Vj2),…,( V1k,Vj) are edges in G. If G is directed
then the path from Vi to Vj more specially known as directed path consists of <Vi,
Vj1><Vj1,Vj2>,…,<V1k,Vj>.

14. When two graphs are said to be isomorphic?

Two graphs are said to be isomorphic, if

1. They have the same number of vertices


2. They have the same number of edges
3. They have an equal number of vertices with a given degree

15. What is an Euler Graph?


 The following graph is an example of an Euler graph-
 Here,
 This graph is a connected graph and all its vertices are of even degree.
 Therefore, it is an Euler graph.

16. What is an Euler walk?

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.

17. List the various representations of graph.

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

19. List the applications of graph.


1. Determination of shortest path (Single source shortest path problem)
2. Extraction of minimum cost spanning trees

20. What is Hamiltonian circuit?

A Hamiltonian circuit in a connected graph is defined as a closed walk that traverses


every vertex of G exactly once, except of course the starting vertex at which the walk terminates.

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.

6. Explain the following with a suitable example for each.


a. Complete graph
b. Multi graph
c. Connected graph
d. Eulerian walk in a graph
e. Hamiltonian circuit
f. Cyclic graph
g. Weighted graph
h. Isomorphic graph

You might also like