Questions tagged [approximation]

Approximation algorithms are algorithms used to find approximate solutions to optimization problems.

Approximation algorithms are algorithms which generate feasible solutions to optimizazion algorithms. Although permitted to generate solution which are not optimal, there is an algorithm-dependent bound for the ratio of the objective of an optimum and the objective of the generated solution; this ratio is termed the approximation ratio.


Useful links


Related tags

523 questions
6
votes
3 answers

Distribute points on mesh according to density

Given a (possibly open) mesh with a density texture and a number of points I need to distribute these points according to the density on the mesh. So far I have made up several solutions some of which worked and others did not. One of the algorithms…
6
votes
3 answers

Why does the integer representation of a floating point number offer a piecewise linear approximation to the logarithm?

If you were reading news about developments in graphics in the 1990s, you might have followed Jim Blinn's column in IEEE Computer Graphics & Applications, "Jim Blinn's corner." In the summer of 1997 you would have opened your issue to a column…
Adam Hyland
  • 878
  • 1
  • 9
  • 21
6
votes
2 answers

Function approximation Tensorflow

I am trying to create a neural network in Tensorflow that approximates a sine function. I have found some examples of universal function approximators but I am not fully understanding the code and, since I am quite new with Tensorflow, I would like…
6
votes
3 answers

SSE normalization slower than simple approximation?

I am trying to normalize a 4d vector. My first approch was to use SSE intrinsics - something that provided a 2 times speed boost to my vector arithmetic. Here is the basic code: (v.v4 is the input) (using GCC) (all of this is inlined) //find…
Pubby
  • 51,882
  • 13
  • 139
  • 180
6
votes
6 answers

float to double assignment

Consider the following code snippet float num = 281.583f; int amount = (int) Math.round(num*100f); float rounded = amount/100.0f; double dblPrecision = rounded; double dblPrecision2 = num; System.out.println("num : " + num + " amount: " + amount + "…
Prabhu R
  • 13,836
  • 21
  • 78
  • 112
6
votes
2 answers

Continued Fractions Python

I am new to Python and was asked to create a program that would take an input as a non-negative integer n and then compute an approximation for the value of e using the first n + 1 terms of the continued fraction: I have attempted to decipher the…
6
votes
1 answer

Approximating log2(float) by separating significand and exponent

Problem I am trying to implement a fast float = log2(float). I wrote a simple C program to compare my results with log2 and I get a small error that I can't find a source for. Background I am taking the approach of identifying the floating point…
n-west
  • 118
  • 5
6
votes
2 answers

Gnuplot: Use fit in log scale

I need to make a linear approximation. However it needs to be in a log scale. Here is my gnuplot script: f(x)= a*x+b fit f(x) "d0.dat" via a,b set logscale x set logscale y plot "d0.dat" with points lt rgb "#ff0000" title "Points", \ f(x) with lines…
Rafael Castro
  • 579
  • 5
  • 14
6
votes
2 answers

Contour approximation containing undesired points

Hi there i have a polygon problem. I don't know what to look for so i decided to ask here. The image below shows a simple shape. The contours are detected with OpenCV's findContours() and aproximated by the CV_CHAIN_APPROX_TC89_KCOS (for those who…
Arndt Bieberstein
  • 1,128
  • 1
  • 14
  • 28
6
votes
3 answers

What is the difference between a 'combinatorial algorithm' and a 'linear algorithm'?

Or rather, what is the definition of a combinatorial algorithm and a linear algorithm, resp.? To make it clear because obviously the first responders misunderstood the question: I am not looking for a definition of an algorithm running in linear…
Tobias
  • 6,388
  • 4
  • 39
  • 64
5
votes
2 answers

Single precision argument reduction for trigonometric functions in C

I have implemented some approximations for trigonometric functions (sin,cos,arctan) computed with single precision (32 bit floating point) in C. They are accurate to about +/- 2 ulp. My target device does not support any or methods.…
5
votes
1 answer

Converting Arrays of Data into an Approximated Contour Line Map (Python)

I have 3 arrays formed from 3 lists: x = np.array(xlist) y = np.array(ylist) z = np.array(zlist) where each list represents the x coords, y coords, and the weight for each specified coord. There are around 3000 values in each list (corresponding…
5
votes
3 answers

Trilateration with limits?

I'm in need of help solving an issue, the problem came up doing one of my small robot experiments, the basic idea, is that each little robot has the ability to approximate the distance, from themselves to an object, however the approximate I'm…
Skeen
  • 4,614
  • 5
  • 41
  • 67
5
votes
3 answers

Fast, approximate solution to linear equations?

I need to solve a system of N linear equations as an intermediate step in a numerical optimizer. AFAIK reasonably simple algorithms for doing so exactly are O(N^3) (though I saw a horibly complicated one in some math paper that could do it in…
dsimcha
  • 67,514
  • 53
  • 213
  • 334
5
votes
1 answer

Reliable integration test for code using HyperLogLog?

We are using Twitter's implementation of HyperLogLog in Algebird. Given a number N and a check in our system that uses HyperLogLog to estimate the current size of a gradually-growing collection and test if it is more or less than N, how can we write…
Robin Green
  • 32,079
  • 16
  • 104
  • 187
1 2
3
34 35