3

The problem:

We have a weighted graph $G=(V, E, W)$ with $|V| = n$, $|E| = n-1$ and $W$ is set of edge's weight. The graph $G$ includes one ring on $n_1 \geq 3$ nodes and $n_2$ isolated nodes, $n_1+ n_2 = n$.

We want to connect isolated nodes to the ring using an edge weight (euclidean distance between nodes and edges) as the feature for connection. The ring's weight must be minimal.

Algorithm

  1. select an edge $(u,v) \in E$
  2. match to the edge $(u,v)$ the minimum distance to isolated nodes (this is an edge's weight)
  3. repeat steps 1-2 for all edges
  4. find the edge $(u,v)_{\min}$ with the global minimum weight $\arg \min_{(u,v) \in E} W$
  5. connect the head $u$ and tail $v$ of specifited edge $(u,v)_{\min}$ with the corresponded isolated node $a$ by adding two edges $(u,a)$ and $(a,v)$
  6. delete the edge $(u,v)_{\min}$ from the triangle $\{(u,a), (a,v), (v,u)\} \subset E$
  7. repeat steps the 1-5 while the set of isolated nodes is not empty.

In the wortest case on step 4 we can have more one edges (some edges can have the same weight) and we can randomly select one of them. But we need to store weight of non-used edges for the possible back propogation on the next steps.

Problem. How to estimate the computation complexity of the proposed algorithm?

My attemp is:

  1. $n$ elementary operations
  2. $n_2$ elementary operations
  3. $n \cdot (n-1)$ elementary operations
  4. $n^2/2 - n$ elementary operations, if $W$ is simmetric matrix with zero diagonal and all elements are different on all steps (one choice)
  5. $2$ elementary operations
  6. $1$ elementary operation
  7. $n$ elementary operations

The complexity is $O(n^2)$.

Nick
  • 1,259

0 Answers0