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

463 questions
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
  • 12,624
  • 19
  • 75
  • 107
6
votes
4 answers

SVG: Convert Arcs to Cubic Bezier

I'm trying to do something that i though would be pretty simple: Replacing all Arcs in an SVG path with Cubic Bezier Curves. This: http://www.w3.org/TR/SVG11/implnote.html#ArcImplementationNotes doesn't really help me as it doesn't really say…
Vogel Vogel
  • 271
  • 1
  • 4
  • 11
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
  • 519
  • 4
  • 12
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,100
  • 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
  • 5,950
  • 3
  • 33
  • 60
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,316
  • 5
  • 35
  • 67
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
  • 29,408
  • 13
  • 94
  • 178
5
votes
1 answer

How to Create an approximation of a 2-d Arc with line segments?

I have a poly-line-contour consisting of line segments and arcs of circles which i want to extrude to prisms. As my extrusion functions only support straight-edge polygons, i need to approximate the arcs using line segments. The arcs are defined…
sum1stolemyname
  • 4,258
  • 2
  • 23
  • 44
5
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…
5
votes
2 answers

How does software that calculates winning probability of a Texas Hold'em or Omaha hand against 8 random opponent hands work?

So there are Texas Hold'em computer games where you play up to 8 opponents and supposedly some of these computer games tell you your probability of winning assuming your opponents hands are all random. In case someone doesn't know, in Hold'em each…
user2566092
  • 4,473
  • 12
  • 19
5
votes
3 answers

Interpolation advice (linear, cubic?)

I need to find good approximations of the points where an undefined function intersect a threshold value. I'm stepping through my space and whenever I find that two subsequent steps are on different sides of the threshold, I add a point somewhere in…
David Rutten
  • 4,531
  • 5
  • 39
  • 67
5
votes
1 answer

Bezier curve approximation for large amount of points

I have about hundred points, that I want to approximate with Bezier curve, but if there are more than 25 points (or something like that), factorial counting in number of combination causes number overflow. Is there a way of approximating such amount…
loginpassword
  • 290
  • 4
  • 13
4
votes
1 answer

Two Dimensional Curve Approximation

here is what I want to do (preferably with Matlab): Basically I have several traces of cars driving on an intersection. Each one is noisy, so I want to take the mean over all measurements to get a better approximation of the real route. In other…
ILikeCars
  • 41
  • 1
4
votes
1 answer

Fast inverse square root using fixed point instead of floating point

I am trying to implement Fast Inverse Square Root for a fixed point number, but I'm not getting anywhere. I am trying to follow exactly the same principle as the article, except instead of writing the number in the floating point format x = (-1) ^ s…
vicente cesar
  • 41
  • 1
  • 3
1 2
3
30 31