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
0
votes
1 answer

jsPDF/jsPDF-autotable print dom elements into tables

I'm using jspdf and jspdf-autotable to export data based tables into PDF. Sometimes, my data could contain DOM elements, which aren't handled by the jspdf-autotable plugin. In the most cases, the DOM element is a span or a div element containing…
0
votes
2 answers

What does this sentence mean "It is NP-hard to approximate the Max-3-DM with bound 2 "?

It has been shown that: it is NP-hard to approximate the maximum 3-dimensional matching problem (Max-3-DM) to within 95/94, this result apply to instances with exactly two occurrences of each element. Does this mean that, the Max-3-DM with the bound…
Farah Mind
  • 143
  • 5
0
votes
1 answer

While loop error with Netwon-Raphson Method

I am trying to find use to Newton-Raphson method to find the roots. It does this by making a guess and then improving the guess after each iteration until you get one of the zeros. Because the Newton-Raphson method quickly finds the zeros, it gives…
0
votes
1 answer

Estimating pi with c++ for loop

I am trying to approximate pi using a for loop. The user inputs the number of iterations n, and the program is supposed to get an increasingly accruate value for pi with each additional iteration. I have a nested "if" control structure that checks…
ryan carter
  • 13
  • 1
  • 2
0
votes
1 answer

Bisection Method: Unable to use functions and how to handle multiple function inputs

I had a working bisection method but I need to implement it in a function that will take three arguments: f the function being used, xL the left side of the boundary, and xR the right side of the boundary. Furthermore it has to have the ability to…
0
votes
0 answers

BSpline Approximation Using MathDotNet

Does MathDotNet have any capability about data approximations by using b-splines? Unfortunately i couldn't find anything in the documentations!
Ehsan Mirsaeedi
  • 6,924
  • 1
  • 41
  • 46
0
votes
1 answer

R : approximation of probability

Let X and Y be two independent random variables with density functions f_x(x) = x*exp(0.5*x^2) where x>0 and f_y(y) = 0.5 with y in [-1,1] . I'm trying to approximate the probability P(Z>1) where Z =X+Y ; here is my R code : u <-runif(10000,…
aouakki
  • 310
  • 5
  • 16
0
votes
0 answers

StackOverFlowError while calculating cos(x) using recursive McLaurin series approximation

I have to write simple code to calculate cos(x) value with McLaurin series approximation. I have to do it recursively. Problem is that with too big angle (param in radians) or too high precision (loop has to stop while last term is smaller or equal…
JayL
  • 101
  • 1
  • 2
  • 13
0
votes
0 answers

Round fixed-point rational to narrower denominator

I've got a (let's say nonnegative) rational number expressed as the ratio of two integers a/b, where 0 <= a < 2^m and 0 < b < 2^n. I'd like to round that to a smaller representation with only p bits in the denominator; that is, find the largest…
Sneftel
  • 40,271
  • 12
  • 71
  • 104
0
votes
2 answers

Monte Carlo approximation of pi with a sphere

I'm trying to estimate pi by uniform random sampling of points (x,y) inside a circle of radius 1 and then computing the corresponding z value in a sphere. Actually it is only a quarter-circle to simplify the computation. Then I compute the average z…
Rafael Korbas
  • 2,213
  • 3
  • 19
  • 30
0
votes
1 answer

Approximation by sin waves using DFT on python. What's wrong?

I'm writing the prorgram on python that can approximate time series by sin waves. The program uses DFT to find sin waves, after that it chooses sin waves with biggest amplitudes. Here's my code: __author__ = 'FATVVS' import math # Wave -…
0
votes
1 answer

Stirling's approximation in c language

I'm trying to write a code in C to calculate the accurate of Stirling's approximation from 1 to 12. Here's my code: #define PI 3.1416 #define EULERNUM 2.71828 float stirling_approximation(int n) { int fact; float stirling, ans; fact =…
hollaholl
  • 93
  • 1
  • 2
  • 10
0
votes
1 answer

Approximate Euler's Number in script

I'm writing a script that calls a function get_fact to calculate Euler's number to 10 decimal places. My function is: function [ nfactorial ] = get_fact( n ) %input a non-negative integer %output is factorial of that integer for i=0:n …
rubisco_
  • 63
  • 1
  • 7
0
votes
0 answers

Algorithm for approximating the 2D Look-up table

What would be a good algorithm or analytical method to approximate a discrete 2D look-up-table (LUT) to a continuous function? That is, given z=LUT[x1][x2] and we wanna come up with a function such that z=f(x1, x2).
Jes
  • 2,614
  • 4
  • 25
  • 45
0
votes
3 answers

Temporary group membership tally - Any clever way to do it?

I'm building a website. It has groups that users can join. The difference between this and "normal" groups is that membership is temporary - when a user joins a group, he decides the length of membership: 5 days, a week, 2 weeks, etc (choices are…