The goals of this tutorial are:
For the following questions, assume that G is an undirected graph having n vertices. The vertices of G are numbered 0, 1, 2, ..., n-1. The graph H= G-v is the same as the graph G except that vertex v and all edges incident to v are deleted.
for (i= 0; i < n; i++)
{
for (j=i+1; j < n; j++)
{
for (k= j+1; k < n; k++)
{
Take an adjacency matrix for G and make
an adjacency matrix for H= G -i -j -k
(i, j, and k are vertices of G).
}
}
}
for (i= 0; i < n; i++)
{
for (j=i+1; j < n; j++)
{
for (k= j+1; k < n; k++)
{
Call a function compute_parameter(G) which has
time complexity O(f(n)) where n is the number of
vertices of G.
}
}
}
for (i= 0; i < n; i++)
{
for (j=i+1; j < n; j++)
{
for (k= j+1; k < n; k++)
{
Take an adjacency matrix for G and make
an adjacency matrix for H= G -i -j -k
(i, j, and k are vertices of G).
Call compute_parameter(H)
}
}
}
What is the time complexity of this code assuming that
the time for compute_parameter is in O(f(n))
for some function f(n)?