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

463 questions
0
votes
3 answers

Trying to approximate the value of natural log e and the number of term use to calculate e

package homework1C; public class Homework1C { public static void main(String[] args){ double term =2,sum; int n; final double difference = 0.0000000001; double x; for(sum=0.0,n=0;term > difference;n++){ x =…
Khoa Vo
  • 23
  • 9
0
votes
0 answers

moving average accuracy?

I have some data where people vote on things, and it would be nice to have an average for each item of how everyone who has voted on it has voted. You can think of the votes as a stream of constantly incoming numbers. Now I can figure out the…
hackartist
  • 4,968
  • 4
  • 29
  • 47
0
votes
1 answer

Graph partitioning based on nodes and edges weights

I have a graph G=(V,E) that both edges and nodes have weights. I want to partition this graph to create equal sized partitions. The definition of the size of partition is sum(vi)-sum(ej) where vi is a node inside that partition and ej is an edge…
Masood_mj
  • 1,036
  • 8
  • 21
0
votes
1 answer

least squares approximate 1D data by a given amount horizontal lines

The problem is following. I have 1D array of data, that i need to approximate by a given amount of horizontal lines (for example, by 3 lines) in the optimal way (so, the summary error becomes minimal). The method of approximation should be as fast…
-1
votes
0 answers

Optimum time complexity of algorithms for Maximal Independent Set (MIS) up to now?

As I said in the title, does anyone know what is the optimum time complexity of algorithms for Maximal Independent Set (MIS) up to now? or Can anyone enlighten me about from what aspect should I compare algorithms that solving the same problem ?
Ethel Sun
  • 11
  • 1
-1
votes
1 answer

fast double exp2 function in C

I need a version of the following fast exp2 function working in double precision, can you help me ? Please don't answer saying that it is an approximation so a double version is pointless and casting the result to (double) is enough..thanks. The…
elena
  • 1
  • 1
-1
votes
2 answers

How to write a while loop in python

I am really having trouble getting started on this assignment and would really appreciate some help as a newbie! We need to write a program called PiApproximator that approximates the mathematical constant π by summing a finite number of terms in a…
user14321588
-1
votes
1 answer

Installation of sollya tool on windows

I've heard a lot of this free math tool sollya mentioned in many answers concerning approximations for floating point arithmetic. I know it is not specifically a programming question, and i aimed to fit the case tools used regularily by…
-1
votes
3 answers

Infinite series approximation of pi in C not terminating

Here is my code, when using print statements it appeared to be an infinite loop: some potential issues i can troubleshoot are integer division, and perhaps figuring out if the algorithm terminates, and if it always has the correct output, perhaps…
Ben French
  • 11
  • 4
-1
votes
3 answers

Approximation and modification of dictionary variables

I have a question I have a dictionary called (plane) where I can call variables such as 'name' or 'speed'. These values ​​give me this kind of output for example: print(plane.get('name')) print(plane.get('altitude')) Output: 'name'=…
-1
votes
1 answer

Multiple values of tuples

I have problem with approximation in python. I have a function, which gives me a dict with results. For example {1: 0.5, 2: 0.25}. It means that f(1)==0.5, f(2)==0.25, etc. Below is what I do after getting values from my function. lists =…
-1
votes
1 answer

Duplicate Programs

I want to write a code that can find similarity between code files (maybe find similarity by percentage or at least "guess" which files could of been copied), I run it for 30 files and maximum 500 lines in each file. I want to identify duplicate…
-1
votes
2 answers

Solving 'a = b ln [ max (11, b) ]' for b

Given: a = b ln [ max (11, b) ] If a is known, how can one compute b? (Do I need to use an iterative approximation method?)
bestrong
  • 151
  • 7
-1
votes
1 answer

Resto is 12.7 and method getTagli return 10.0 , 2.0 , 0.5 but my result had to be 10.0, 2.0, 0.5, 0.2

Is easy, have two collections set (list) and tagli; scroll list and when resto> item in list, pickup that item and subtract that item until resto is equal 0. public static ArrayList getTagli(Double resto) { Set list =…
-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.
  • 3
  • 1
  • 1
  • 2
1 2 3
30
31