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

Approximation of an infinite sum in R

I'm calculating the probability mass function for a count variable and the normalization term is an infinite sum of the form ∑f(n), where the sum goes over all non-negative integers (0-infinity). I'm looking for a function in R that approximates…
gregorp
  • 255
  • 1
  • 3
  • 11
2
votes
0 answers

Centrality using networkx-python in short time

Is there any way to calculate the centrality measures(closeness, betweenness) in short time approximately. I've tried the inbuilt functions( nx.closeness_centrality(), nx.betweenness_centrality(F)), but it is taking forever to compute for a Directed…
2
votes
1 answer

Fitting data by least squares in MATLAB

Given the following datapoints I'm trying to find the best fitting model using the method of least squares. Two models are given. My approach was to rewrite the to equations into the following. where and where and I wrote…
bullbo
  • 131
  • 10
2
votes
1 answer

Approximate matching of regular expressions in java

i am looking something similar to commons-text -LevenshteinDetailedDistance but for regular expressions. e.g LevenshteinDetailedDistance d = new LevenshteinDetailedDistance(); LevenshteinResults levenshteinResults = d.apply("SomeText",…
Niraj Sonawane
  • 10,225
  • 10
  • 75
  • 104
2
votes
5 answers

No idea for limit the sin(x) formula loop

Making c/++ function to compute sin(x) Referancing by the formula; But i don't know where to stop infinity sum, and i don't want libraries for quick-answer. I want to make it. I made factorial function well. (fact() function) double sin(int x) { …
user8704018
2
votes
0 answers

great circle distance performance

in my c++ program at one point I need to calculate the distance between two spherical points (given in azimuth and elevation) on a sphere. This calculation needs to be done extremely often, but I don't require a high accuracy (1 degree should be…
user7431005
  • 3,899
  • 4
  • 22
  • 49
2
votes
1 answer

Finding 3 dimentional B-spline controll points from given array of points from spline solution?

Wa are talking about Non-uniform rational B-spline. We have some simple 3 dimentional array like {1,1,1} {1,2,3} {1,3,3} {2,4,5} {2,5,6} {4,4,4} Which are points from a plane created by some B-spline How to find controll points of spline that…
Rella
  • 65,003
  • 109
  • 363
  • 636
2
votes
2 answers

Stop Approximation in Complex Division in Python

I've been writing some code to list the Gaussian integer divisors of rational integers in Python. (Relating to Project Euler problem 153) I seem to have reached some trouble with certain numbers and I believe it's to do with Python approximating the…
2
votes
3 answers

Fast integer sqrt upper bound approximation

This is a question, regarding my homework, specifically on NASM. I am writing an algorithm to find the least whole factor of a number. (Greater than 1) In pseudo-code it can be summed up as: if(n%2==0) return 2; for(i=3; i <= n/2; i+=2) …
RuRo
  • 311
  • 4
  • 17
2
votes
2 answers

Find closest approximation of Pi for given range of denominators

I am looking for an algorithm (preferably in Go or C) to find the closest common fraction n/d to Pi out of an inclusive range of possible denominators (dmin,dmax with 1 <= dmin <= dmax <= 1e15). If there are multiple common fractions with the same…
2
votes
1 answer

Max 3 color algorithm

In this problem I'm given a Graph G = (V,E), the goal is to find a coloring of graph's vertices with 3 colors possible that maximize the quality function q(c) = the number of edges that their endpoints are colored differently. Give a probalistic…
MathAbuser
  • 21
  • 2
2
votes
1 answer

Newtonraphson code in R leads to different results

I need to approximate the parameters of a sample from Birnbaum-Saunders distr. here is my code: x =c(6.7508, 1.9345, 4.9612, 22.0232, 0.2665, 66.7933, 5.5582, 60.2324, 72.5214, 1.4188, 4.6318, 61.8093, 11.3845, 1.1587, 22.8475, 8.3223, 2.6085,…
2
votes
1 answer

Approximate a list of points with a short list of Bézier curves

I have a list of (x, y) points. I know how to make a list of Bézier curves which pass through all of those points and have a continuous first (and second, though less important) derivative. However, the list that I end up with is far too long. I…
Pi Fisher
  • 260
  • 1
  • 11
2
votes
1 answer

C++ Euler Approximation

Why does my code only go up to 2.4 for the x value as the output when I enter 0.1 as the step size? If I enter a value like .01 or .001 it goes up to 2.5. #include #include using namespace std; int main() { double step; …
2
votes
1 answer

What is the ε (epsilon) parameter in Locality Sensitive Hashing (LSH)?

I've read the original paper about Locality Sensitive Hashing. The complexity is in function of the parameter ε, but I don't understand what it is. Can you explain its meaning please?