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
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,506
  • 3
  • 26
  • 44
5
votes
1 answer

approximate sorting Algorithm

Does anyone know an Algorithm that sorts k-approximately an array? We were asked to find and Algorithm for k-approximate sorting, and it should run in O(n log(n/k)). but I can't seem to find any. K-approx. sorting means that an array and any 1 <= i…
5
votes
1 answer

How to obtain tilde or approx symbol in gnuplot legend?

I want to use either tilde (~) or approximate symbol (in latex \approx) in the legend of my gnuplot. I am using epscairo terminal. I tried seting either: set encoding iso_8859_1 or set encoding utf8 and using different commands, for example \176 as…
nevermind
  • 129
  • 1
  • 7
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,631
  • 15
  • 20
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,716
  • 6
  • 43
  • 72
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
  • 307
  • 1
  • 5
  • 14
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
  • 43
  • 1
  • 4
4
votes
2 answers

Approximating cosine on [0,pi] using only single precision floating point

i'm currently working on an approximation of the cosine. Since the final target device is a self-developement working with 32 bit floating point ALU / LU and there is a specialized compiler for C, I am not able to use the c library math functions…
4
votes
5 answers

Sum of decimal number in java

I have a problem for the managemente of decimal number in java (JDK 1.4). I have two double numbers first and second (as output of formatted String). I do a sum between fist and second and I receive a number with more decimal digits! final double…
alepuzio
  • 1,382
  • 2
  • 28
  • 38
4
votes
1 answer

Find the maximum number of flags that can be set on mountain peaks

I worked with a Codility problem provided below, A non-empty array A consisting of N integers is given. A peak is an array element which is larger than its neighbours. More precisely, it is an index P such that 0 < P < N − 1 and A[P − 1] < A[P] >…
Arefe
  • 11,321
  • 18
  • 114
  • 168
4
votes
3 answers

Division by a constant using shifts and adds/subtracts

Hi all I'm trying to divide by an unsigned constant using only shifts and adds/subtracts - I have no problem with this if it were multiplication, but I'm a bit stumped by the division. For example, lets say the constant divisor is 192 and lets…
trican
  • 1,157
  • 4
  • 15
  • 24
4
votes
1 answer

A 2-approximation algorithm for Vertex-Cover problem using "Spanning Tree"

I have seen a question on 2-approximation algorithm for Vertex-Cover problem(VC, known Np-Complete problem), and i don't know the answer. The problem is the following : Find a 2-approximation algorithm for Vertex Cover problem using "Spanning Tree".…
4
votes
2 answers

Traveling salesman library using approximation algorithm

I'm currently doing a project that requires some fast TSP solving (about 50-100 nodes in 2 seconds). There are a lots of approximation algorithms out there, but I don't have time nor will to analyze them and code them myself. Are there any free…
bezmax
  • 25,562
  • 10
  • 53
  • 84
4
votes
1 answer

Choose function for On-Policy prediction with approximation

I am currently reading Sutton's introduction about reinforcement learning. After arriving in chapter 10 (On-Policy prediction with approximation), I am now wondering how to choose the form of the function q for which the optimal weights w shall be…
zimmerrol
  • 4,872
  • 3
  • 22
  • 41