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

Computing Stirling's Approximation in C

Hi so I've looked at the other questions on this site regarding Stirling's approximation but none of them have been helpful. I am suppose to be computing the factorial and also approximating the factorial from the two Stirling's approximation…
Sarah H.
  • 13
  • 1
  • 1
  • 3
-1
votes
2 answers

Approximate match using integer comparison

I am looking for an algorithm that can match the saved pattern to the current pattern even if it is not exactly the same. For example, the saved pattern x is 0, 400, 900, 1500, 2000 and the current pattern y is 0, 300, 800, 1300, 1800. Is there an…
-1
votes
2 answers

Solving a TSP-related task

I have a problem similar to the basic TSP but not quite the same. I have a starting position for a player character, and he has to pick up n objects in the shortest time possible. He doesn't need to return to the original position and the order in…
-1
votes
2 answers

Taylor Series logic in C

I am working on the project where we are approximating e^x using a taylor series, with x being a user entered value. The test values that we have been given are x=.5, x=1.0, and x=1.5. The goal is to get the output is supposed to be a table with a…
-1
votes
2 answers

Algorithm for selecting subset of people who use same stuff NP-hard?

This isn't homework, but a question I encountered during my research. I need to know whether this problem is NP-hard or not. In the first case, I require an approximate algorithm and in the latter case an efficient one providing me with the optimal…
Chris
  • 721
  • 1
  • 10
  • 23
-1
votes
1 answer

Approximation algorithm in broadcasting

What does an approximation solution to a braodcasting algorithm mean... I have been working on an algorithm which says that it has a solution of 12 approximation. What does it actually mean.. Can anybody please help me...
Arun Gangula
  • 143
  • 1
  • 9
-2
votes
1 answer

Python library function to approximate a set of 2D points with a straight line

Given an array with [x, y] points, e.g.: p0 = np.random.rand(21, 2) p1 = np.array([[0, 0], [0, 1], [0, 2], [0, 3]]) I would like to get a straight line [segment] approximation of these points. Least squares method is acceptable, other error…
Paul Jurczak
  • 7,008
  • 3
  • 47
  • 72
-2
votes
1 answer

Finding coefficients for approximations

I just would like to approximate any number, out of mathematical curiosity, purely in terms of e. Example: If I give n=7.3890, the program must return a=1,b=0, which is the best approximation(minimal error) for all whole number pairs(a,b) from math…
DatBoi
  • 99
  • 4
-2
votes
1 answer

My pi approximation using the wallis' method doesn't work and I have no idea what's going on

I'm working in Python 3.7 and part of my assignment is to define Wallis' approach to approximating pi. I'm a maths student, not cut out for doing computer science and could really use some help, this is worth 40% of my grade in total and I can't do…
TomGG98
  • 3
  • 2
-2
votes
1 answer

Mathematics behind the function "approx3d"

Can someone provide me reference regarding the mathematics of the "approx3d" function? Does this function apply "trilinear interpolation"?
David
  • 1
  • 3
-2
votes
1 answer

String Approximation

I am trying to automate a process that is normally done by hand. There is a database full of unique keys that gets updated quarterly. This update will have some of the same exact keys and sometimes it won't but they will be similar. They will add…
Mnazanda
  • 5
  • 3
-3
votes
2 answers

without factorial function to do exponent approximation in python

Use loops to write a program that computes the value of by using the following formula. e ^ x = 1+x/1!+x^2/2!+x^3/3!+ ... Notice that do not import factorial function in math module. Sample answers:e=2.71828 and e^2=7.389056
Ken
  • 9
  • 1
-5
votes
1 answer

How to write a nested for-loop

I'm running a program that preforms a Euler Approximation of an Ordinary Differential Equation. The smaller the step size that is chosen, the more accurate the approximation is. I can get it to work for a set step size using this code: #include…
J.M
  • 15
  • 3
1 2 3
34
35