164 views
1 1 vote

Which of the following properties is/are TRUE for a Simple Undirected Graph $G$ with $n$ vertices and $k$ connected components?

  1. DIJKSTRA'S ALGORITHM CAN BE USED TO FIND THE SHORTEST PATH EVEN IF EDGES HAVE NEGATIVE WEIGHTS.
     
  2. THE MINIMUM NUMBER OF EDGES IS $n-k$.
     
  3. THE GRAPH MUST CONTAIN A CYCLE IF THE NUMBER OF EDGES IS $n$.
     
  4. THE MAXIMUM NUMBER OF EDGES IS $\frac{(n-k)(n-k+1)}{2}$.

1 Answer

0 0 votes

A. DIJKSTRA'S ALGORITHM CAN BE USED...: INCORRECT.
Dijkstra's algorithm fails with negative edge weights because it cannot "correct" the distance to a node once it has been processed. Bellman-Ford or Floyd-Warshall would be required instead.

B. THE MINIMUM NUMBER OF EDGES IS $n-k$ : CORRECT. To minimize edges, each component must be a tree. Since a tree with $v$ vertices has $v-1$ edges, the sum for $k$ components is $\sum\left(v_i-1\right)=\left(\sum v_i\right)-k=n-k$.

C. THE GRAPH MUST CONTAIN A CYCLE IF THE NUMBER OF EDGES IS $n$ : CORRECT.

For a graph with $n$ vertices, the maximum number of edges it can have without a cycle (i.e., being a forest) is $n-1$. If the number of edges reaches $n$, at least one cycle is mathematically guaranteed

D. THE MAXIMUM NUMBER OF EDGES IS $\frac{(n-k)(n-k+1)}{2}$ : CORRECT. To maximize edges in a graph with $k$ components, you minimize the vertices in $k-1$ components ( 1 vertex each) and put all remaining $n-(k-1)$ vertices into one component. This component is a complete graph $\left(K_{n-k+1}\right)$. The number of edges is $\binom{n-k+1}{2}=\frac{(n-k+1)(n-k)}{2}$.

Answer:
Position:
Show:

Related questions

0 0 votes
1 1 answer
220
220 views
GO Classes asked Feb 25
220 views
Consider a simple, weighted, directed graph $G=(V, E)$ with $n$ vertices and $m$ edges. Let $w(u, v)$ be the weight of the edge from $u$ to $v$. Which of the following st...
2 2 votes
1 1 answer
175
175 views
GO Classes asked Feb 25
175 views
Consider a Binary Search Tree (BST) where the post-order traversal is $2,4,3,7,9,8,5$. What is the pre-order traversal of this tree?$5,3,2,4,8,7,9$ $2,3,4,5,7,8,9$ $5,8,9...
1 1 vote
1 1 answer
169
169 views
GO Classes asked Feb 25
169 views
What is the worst-case time complexity of the QuickSort algorithm when the pivot is always chosen as the middle element and the input array is already sorted in ascending...
1 1 vote
1 1 answer
190
190 views
GO Classes asked Feb 25
190 views
In Python, consider a list $\verb|L|$ being used to implement a stack. If we perform $n$ $\verb|append()|$ operations starting from an empty list, what is the amortized t...