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

If Best Fit Straight Line the best method for prediction

I need to make prediction for a next point, based on given set of point samples on 2-d coordinate system. I am using Best-Fit Straight Line method for such prediction. Please let me know if there is method better than Best-Fit Straight Line? My code…
Radioguy
  • 23
  • 4
0
votes
2 answers

finding very close points on plane - approximate clustering algorithm needed

I have many points (latitudes and longitudes) on a plane (a city) and I want to find two clusters. Cluster 1 is points cluttered close together and Cluster 2 is everything else. I know the definition of the problem is not exact. The only thing…
arahant
  • 2,203
  • 7
  • 38
  • 62
0
votes
1 answer

Make python use more resources in calculations

Hi I'm trying to do some matrix calculations using python. The problem is there seems to be a limit of how much CPU will the process consume (about 13% of my Core i7). Is there a way I can make it use more resources?
SadStudent
  • 287
  • 1
  • 4
  • 16
0
votes
1 answer

An algorithm to skip 3D curve points

Currently I am drawing a 3D curve consisting of 1200...1500 straight micro-lines directed by an array of 3D points (x,y,z), but rendering is a bit slow regardless of used technology (Adobe Flash, Three.js). The curve is a kind of 3D arc with a 180…
Paul
  • 25,812
  • 38
  • 124
  • 247
0
votes
1 answer

Considering elements together which are approximately equal

We have some elements characterized by some key value. We consider the elements in descending order of key values. So, if we have ten elements with key values, 4, 5, 7, 10, 2, 8, 9, 10, 8.5, 9, we sort the elements by their key values, and consider…
Masroor
  • 886
  • 1
  • 8
  • 23
0
votes
1 answer

Approximation to find a value using Python

So I have one vector of alpha, one vector of beta, and I am trying to find a theta for when the sum of all the estimates (for alpha's i to n and beta's i to n) equals 60. math.exp(alpha[i] * (theta - beta[i])) / (1 + math.exp(alpha[i] * (theta -…
PascalVKooten
  • 20,643
  • 17
  • 103
  • 160
0
votes
3 answers

TSP-Variant, possible algorithm?

One of the classical Travelling Salesman Problem (TSP) definitions is: Given a weighted complete undirected graph where triangle inequality holds return an Hamiltonian path of minimal total weight. In my case I do not want an Hamiltonian path, I…
Paolo.Bolzoni
  • 2,416
  • 1
  • 18
  • 29
0
votes
1 answer

Maximizing profit in graph having positive weight cycles

I have a set of vertices with some profit defined between each pair of vertices such that profit(i,j) may not be equal to profit(j,i). Moreover there exist positive weight cycles and the profit may be negative. This is a NP-hard problem to find the…
Shashwat Kumar
  • 5,159
  • 2
  • 30
  • 66
0
votes
1 answer

Logic for rate approximation

I am looking for some logic to solve the below problem. There are n transaction amounts : T1,T2,T3.. Tn. Commission for these transactions are calculated using a rate table provided as below. if amount between 0 and A1 -> rate is r1 if amount…
Rohan
  • 192
  • 1
  • 2
  • 12
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
  • 1
  • 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
  • 5,172
  • 4
  • 33
  • 48
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,144
  • 12
  • 25
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
1 answer

How to do 2 decimal digit approximation in C++?

I would like to do approximation in my code here. Here is my code: #include #include int main() { double num1 = 123.455; std::cout << std::fixed << std::showpoint; std::cout << std::fixed << std::showpoint; …
-1
votes
2 answers

Continued fraction for pi in Python

I'm trying to approximate pi using continued fraction. I'm using this formula. After many hours, I ended up here. for i in range(1,15,1): e = ((2*i - 1) ** 2) b = (e / (6 + ((2*(i+1) - 1) ** 2))) print(3+b) ` But my output is not so…