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
2
votes
2 answers

Python Sympy Arbitrary Approximation to Arbitrary Sympy Expression?

I find myself wanting to use approxmations provided as part of the mpmath package, but getting confused on exactly what they are supposed to be doing: http://docs.sympy.org/dev/modules/mpmath/calculus/approximation.html What exactly is the…
D A
  • 3,130
  • 4
  • 25
  • 41
2
votes
1 answer

How can the sum of values be approximated for infinite intervals in java

I am trying to write a piece of code in java that needs to calculate the sum of values in following manner for the range [-∞, +∞] K= +∞ ∑ [ f( (2K+1)*x ) - f( (2K-1)*x ) ] K= -∞ There are two confusions that I am facing with the calculation to…
A. Sinha
  • 2,666
  • 3
  • 26
  • 45
2
votes
2 answers

Stuck in infinite loop in ocaml while calculating Pi approximation using Viete's formula

I have problem when calculating Pi approximation with given precision. I've concluded that the infinite loop problem is caused by my loop exit condition however I don't know what the exact problem is. In my opinion the exit condition should be…
Patryk
  • 35
  • 8
2
votes
1 answer

Implementation of the Riemann Siegel Formula in Java, curious about improving the remainder term

I wrote a basic program which calculates the Riemann-Siegel Z(t) function. I was curious if there is a better way to approximate the remainder term. The method I have now uses the awful table approximations from Haselgrove. Further information about…
Axion004
  • 943
  • 1
  • 11
  • 37
2
votes
4 answers

Approximate Estimation of Distance Matrices

I have a set of N objects, and I'd like to compute a NxN distance matrix. Sometimes my set of N objects is very large, and I'd like to compute an approximation to the NxN distance matrix by only computing a subset of the distance comparisons. Can…
James Thompson
  • 46,512
  • 18
  • 65
  • 82
2
votes
2 answers

How to make a polynomial approximation in Scilab?

I've a set of measures, which I want to approximate. I know I can do that with a 4th degree polynomial, but I don't know how to find it's five coefficients using Scilab. For now, I must use the user-friendly functions of Open office calc... So, to…
Spirine
  • 1,837
  • 1
  • 16
  • 28
2
votes
1 answer

Show that 2 times optimal approximation algorithm for traveling salesman (TSP) does not compute an optimal solution

I have a review for the final exam and this question has been particularly confusing for me. I need an example on 3 vertices that the 2 times optimal approximation algorithm for traveling salesman problem (TSP) does not compute a 2 times optimal…
Kumar
  • 33
  • 3
2
votes
1 answer

python, turtles, pi and monte carlo

I'm trying to approximate pi using a monte carlo with turtles in python. The code is running well but I've got a problem, my "approximations" are all terribly wrong. I' always get values smaller than 1 so??? My code is here below import…
pokemonfan
  • 209
  • 1
  • 2
  • 9
2
votes
1 answer

Linear Programming - deriving the Dual of the Primal

I've the following linear programming problem: This is the LP representation of the uncapacitated facility location problem. This is the dual representation of this problem: My question is how to derive the dual representation from the primal in…
Hawk89
  • 233
  • 1
  • 2
  • 12
2
votes
4 answers

float strange imprecision error in c

today happened to me a strange thing, when I try to compile and execute the output of this code isn't what I expected. Here is the code that simply add floating values to an array of float and then print it out. The simple code: int main(){ …
user2543740
  • 172
  • 1
  • 10
2
votes
0 answers

Find two vectors whose sum is close to query vector

Basically, this question is some sort of research question. I post it here to gain more hints from you. Suppose you have a set S of n d-dimension vectors. Given a d-dimension query vector, I want to find two vectors from S whose sum is close to the…
Xing Shi
  • 2,152
  • 3
  • 21
  • 32
2
votes
2 answers

Scipy.optimization linear function approximation

I've looked at for function approximation methods in scipy.optimize and after reading description for functions figured out(maybe wrong) that they approximate non-linear functions only. For instance if I've sample output after zip() function for x…
im_infamous
  • 972
  • 1
  • 17
  • 29
2
votes
2 answers

AVR/embedded: Normalizing vectors in a fast manner?

I have wasted quite some days fighting with my 16mhz 8bit AVR (mega 2560). The goal is to normalize value I am receiving (accelerometer, magnetometer etc). The values are 16 bit signed (int16) and after I want a float from 0.0f-1.0f I am using…
John
  • 7,507
  • 3
  • 52
  • 52
2
votes
2 answers

Turtle graphics in Python 2.7: Drawing an arc

In Exercise 4.1(c) in Section 4.12 (Chapter 4) of Python for Software Design it is claimed that the following version of function arc(), def arc(t, r, angle): """Draws an arc with the given radius and angle. t: Turtle r: radius …
2
votes
2 answers

Subset sum Algorithm with modification

Given an array of positive integers and an upper limit MAX, i have to find the sub-sequence with sum <= MAX. There can be many sub-sequences whose sum is <= MAX . We have to find that one with max sum possible. I am not looking for the…
Dhruv Chandhok
  • 780
  • 7
  • 18