Questions tagged [metrics]

3 questions
4
votes
1 answer

Approximation ratio on (1, 2)-metric Travelling Salesman Problem (TSP)

I encountered a problem, where I am given a (fully-connected) graph within a metric space, where each edge weight is either 1 or 2. My task is to prove that the following greedy algorithm gives a $\frac{3}{2}$-approximation for finding a TSP path:…
NiRvanA
  • 159
  • 6
4
votes
1 answer

Which maintainability metric has the strongest empirical evidence?

There are lots of code metrics that claim to measure maintainability, e.g. CK and Li & Henry metric suits. However, it seems elusive to me to find a meta-study that compares different metrics to decide their current empirical status. In contrast,…
Olle Härstedt
  • 375
  • 1
  • 10
-1
votes
1 answer

Compute sum of moduli for a stream of integer numbers

We receive a stream of $n$ integer numbers: $x_1, x_2,\dots, x_n$. Assume that each $x_i$ is a constant and can be stored with $O(1)$ bits. Whenever a new number $x_i, i \geq 2$ is inputted, we need to evaluate and output the sum: $$ S_i :=…
reservoir
  • 11
  • 3