0% found this document useful (0 votes)
8 views12 pages

CPGA Module 1 Complete Solutions

The document covers fundamental concepts of graph theory, including definitions of graphs, types of vertices, edges, and various graph representations such as adjacency and incidence matrices. It also discusses properties of graphs, such as isomorphism, bipartition, and complements, along with the handshaking lemma and degree of vertices. Additionally, it includes exercises and questions related to graph theory applications and properties.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views12 pages

CPGA Module 1 Complete Solutions

The document covers fundamental concepts of graph theory, including definitions of graphs, types of vertices, edges, and various graph representations such as adjacency and incidence matrices. It also discusses properties of graphs, such as isomorphism, bipartition, and complements, along with the handshaking lemma and degree of vertices. Additionally, it includes exercises and questions related to graph theory applications and properties.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 12

Competitive Programming using GRAPH THEORY

Module 1

Fundamental Concepts of Graph


Theory

PART - A (SHORT ANSWER QUESTIONS)

1. Define Graph.
A. A Graph is a non-linear data structure consisting of vertices and
edges. The vertices are sometimes also referred to as nodes and the
edges are lines or arcs that connect any two nodes in the graph. More
formally a Graph is composed of a set of vertices( V ) and a set of
edges( E ). The graph is denoted by G(E, V)

2. Define the order and size of a graph.


A.The order of a graph is its number of vertices |V|. The size of a graph
is its number of edges |E|. However, in some contexts, such as for
expressing the computational complexity of algorithms, the size is |V| +
|E| (otherwise, a non-empty graph could have size 0).

3. Give the condition for the adjacency of (i) two vertices (ii)
two edges.

A.A simple graph is a graph that does not have more than
one edge between any two vertices and no edge starts and
ends at the same vertex. In other words a simple graph is a
graph without loops and multiple edges. Two vertices are
said to be adjacent if there is an edge (arc) connecting
them.

● Adjacent Vertices
Two vertices are said to be adjacent if there is an edge (arc)
connecting them.
● Adjacent Edges
Adjacent edges are edges that share a common vertex.

4. Draw all simple graphs of one, two, three, and four vertices.

A.
5. Define a null graph. Draw a null graph of order 4.

A.Null Graph

A null graph is a graph in which there are no edges


between its vertices. A null graph is also called
empty graph.

6. Define pendant vertex, isolated vertex.


A.Pendent Vertex
By using degree of a vertex, we have a two special types of vertices. A vertex
with degree one is called a pendent vertex.
Example

Here, in this example, vertex 'a' and vertex 'b' have a connected edge 'ab'. So
with respect to the vertex 'a', there is only one edge towards vertex 'b' and
similarly with respect to the vertex 'b', there is only one edge towards vertex 'a'.
Finally, vertex 'a' and vertex 'b' has degree as one which are also called as the
pendent vertex.

Isolated Vertex
A vertex with degree zero is called an isolated vertex.

Example

Here, the vertex 'a' and vertex 'b' has a no connectivity between each other and
also to any other vertices. So the degree of both the vertices 'a' and 'b' are zero.
These are also called as isolated vertices.

7. Define self loop, multiple edges.


A.
A self-loop or loop is an edge between a vertex and itself. An undirected
graph without loops or multiple edges is known as a simple graph. In this
class we will assume graphs to be simple unless otherwise stated.

Multiple edges are two or more edges connecting the same two vertices
within a multigraph. Multiple edges of degree between vertex and
vertex correspond to an integer as the entry of the incidence matrix of
the multigraph. A diagonal entry corresponds to a single or multiple
loop.

8. Define pseudo graph, simple graph.

a. Pseudograph

A pseudograph is a non-simple graph in which both graph loops and multiple


edges are permitted

Simple Graph

A simple graph is a graph that does not have more than one
edge between any two vertices and no edge starts and ends
at the same vertex. In other words a simple graph is a graph
without loops and multiple edges. Adjacent Vertices. Two
vertices are said to be adjacent if there is an edge (arc)
connecting them.
9. What is a finite graph?

A.Afinite graph is a graph in which the vertex set and the


edge set are finite sets. Otherwise, it is called an infinite
graph. Most commonly in graph theory it is implied that the
graphs discussed are finite. If the graphs are infinite, that is
usually specifically stated.

10. Define the adjacency matrix of a graph.


A.
An adjacency matrix is a way of representing a graph as a matrix of
booleans (0's and 1's). A finite graph can be represented in the form of a
square matrix on a computer, where the boolean value of the matrix
indicates if there is a direct path between two vertices.

11. Define the incidence matrix of a graph


A.

The incidence matrix of a graph G is a |V| ×|E| matrix. The element aij=
the number of times that vertex viis incident with the edge ej.

12. Define complete graph and give a diagrammatic representation


of a complete graph of order 5.

A.A graph consisting of vertices and line segments such that every line
segment joins two vertices and every pair of vertices is
connected by a line segment.
13. Define Kn and Cn
A.Definitions.• Kn: the complete graph on n vertices. • Cn:
the cycle on n vertices. • Km,n the complete bipartite
graph on m and n vertices. • Qn: the hypercube on 2n
vertices.

14. Define degree of a vertex. What is meant by regular graph?


A.The degree of a graph vertex of a graph is the number of graph edges
which touch. . The vertex degrees are illustrated above for a random
graph. The vertex degree is also called the local degree or valency. The
ordered list of vertex degrees in a given graph is called its degree
sequence.

In graph theory, a regular graph is a graph where each


vertex has the same number of neighbors; i.e. every vertex
has the same degree or valency. A regular directed graph
must also satisfy the stronger condition that the indegree
and outdegree of each vertex are equal to each other.
15. State handshaking lemma.
A.In graph theory, a branch of mathematics, the handshaking
lemma is the statement that, in every finite undirected graph,
the number of vertices that touch an odd number of edges is
even.

(The name arises from its application to the total number of


hands shaken when some members of a group of people
shake hands.) It follows from the simple observation that the
sum of the degrees of all the vertices of a graph is equal to
twice the number of edges.

16. State the relation between the number of edges and total degree
of a graph.
A.the sum of degrees is equal to twice the number of edges. This
fact is stated in the Handshaking Theorem. An undirected graph
has an even number of vertices of odd degree.
The degree of a vertex is the number of edges that are attached to it.
The degree sum formula says that if you add up the degree of all the
vertices in a (finite) graph, the result is twice the number of the edges in
the graph.
17. Define the terminology bipartition in a graph.
A. A bipartite graph is a graph in which a set of graph vertices can
be divided into two independent sets, and no two graph vertices
within the same set are adjacent. In other words, bipartite graphs
can be considered as equal to two colorable graphs.
18. What is Km,n?
A. The complete bipartite graph Km,n is defined by taking two
disjoint sets, V1 of size m and V2 of size n, and putting an edge
between u and v whenever u ∈ V1 and v ∈ V2.
19. Define labeling of a graph.
A.A graph labeling is an assignment of integers to the vertices or edges,
or both, subject to certain conditions. Graph labelings were first
introduced in the mid 1960s.
20. Define isomorphism of two graphs G1 and G2.
A.Two graphs which contain the same number of graph vertices
connected in the same way are said to be isomorphic. Formally, two
graphs and with graph vertices are said to be isomorphic if there is a
permutation of such that is in the set of graph edges iff is in the set of
graph edges .
21. Are the given graphs isomorphic?

Isomorphic Graphs
Two graphs G1 and G2 are said to be isomorphic if −

1. Their number of components (vertices and edges) are same.


2. Their edge connectivity is retained.

Note − In short, out of the two isomorphic graphs, one is a


tweaked version of the other. An unlabelled graph also can be
thought of as an isomorphic graph.

22. State the conditions that are required to check for isomorphism
of two graphs.

A.You can say given graphs are isomorphic if they have:


● Equal number of vertices.
● Equal number of edges.
● Same degree sequence.
● Same number of circuit of particular length.
23. Define the complement of a graph with a simple illustration.

A.The complement of a graph G is a graph G' on the same set of


vertices as of G such that there will be an edge between two vertices
(v, e) in G', if and only if there is no edge in between (v, e) in G.
Complement of graph G(v, e) is denoted by G'(v, e').

24. What is the complement of a complete graph?

A.The complement of a graph G is a graph G' on the same set of


vertices as of G such that there will be an edge between two
vertices (v, e) in G', if and only if there is no edge in between (v,
e) in G.
25. Comment on the complement of Km,n?
A.The complement of the disjoint union of Km and Kn is the
complete bipartite graph Km,n (by definition, m independent
vertices each of which is joined to every one of another set of n
independent vertices).
26. Define the union of two graphs G1 and G2, with a simple
illustration.
A.In graph theory, a branch of mathematics, the disjoint union of
graphs is an operation that combines two or more graphs to form
a larger graph.
27. Define the ring sum of two graphs G1 and G2, with a simple
illustration.
A.A graph is a ring graph if each block of which is not a bridge or
a vertex can be constructed from a cycle by successively adding
-paths of length at least 2 that meet graphs already constructed
in two adjacent vertices. Families of ring graphs include forests
and cycles.

28. What is meant by deletion of a vertex?


A.By the definition of vertex deletion, we must delete every
edge incident with v. Since Kk+1 is complete, v is adjacent to
every other vertex, so there are k edges incident with v, and
it is precisely these edges that we have deleted.
29. What is meant by deletion of an edge?
A.Definition: Edge Deletion. Start with a graph (or multigraph, with
or without loops) G with vertex set V and edge set E, and some
edge e∈E. If we delete the edge e from the graph G, the resulting
graph has vertex set V and edge set E∖{e}
30. Who is called as father of Graph Theory? Why he is
called so?
A.The father of graph theory was the great Swiss mathematician
Leonhard Euler, whose famous 1736 paper, "The Seven Bridges of
Konigsberg," was the first treatise on the subject.

PART - B (LONG ANSWER QUESTIONS)

1 Draw all six non isomorphic simple graphs with five vertices and five
edges

three utilities;(b) four houses and four utilities,(Use 𝐻𝑖 ′ 𝑠 for houses and 𝑈𝑖
2 Draw graphs representing problems of connecting (a) two houses and

′𝑠 for utilities)

3 Name 2 situations (games, activities, real-life problems, etc.) that can be


represented by means of graphs. Explain what the vertices and the edges
denote.

4 Justify that an infinite graph with a finite number of edges must have an
infinite number of isolated vertices.

5 Show that an infinite graph with a finite number of vertices will have at
least one pair of vertices or one vertex joined by an infinite number of
parallel edges.
6 Show that the maximum degree of any vertex in a simple graph with n
vertices is n – 1.
7 Show that the maximum number of edges in a simple graph with n
vertices is n (n – l)/2.

8 What is meant by the terms sub graph and induced sub graph of a graph.
Explain in detail with a graph of order 5 and size 8.

You might also like