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

Approximating a closed curve with a polynomial equation

We have given a closed shape. The shape is given as a matrix of 0's and 1's. For an example see: We can think of this image as a coordinate system. For simplicity, let the mid point of the image be the origin that is x=0, y=0 point and the range of…
2
votes
0 answers

Minimal vs Minimum solution for Set Cover

There is a set of items that need to be covered. The subsets of these items are available. If we ask for the minimum number of these subsets that cover the whole items, the problem is the well-known Set Cover problem. Let denote the solution to the…
2
votes
3 answers

How to fit a piecewise (alternating linear and constant segments) function to a parabolic function?

I do have a function, for example , but this can be something else as well, like a quadratic or logarithmic function. I am only interested in the domain of . The parameters of the function (a and k in this case) are known as well. My goal is to fit…
Betelgeux
  • 353
  • 2
  • 15
2
votes
1 answer

Find minimum number of elements in a list that covers specific values

A recruiter wants to form a team with different skills and he wants to pick the minimum number of persons which can cover all the required skills. N represents number of persons and K is the number of distinct skills that need to be included. list…
user14385051
2
votes
1 answer

Given set of points in 2d space, each with some penalty, find a convex region covering exactly N points, minimizing penalty

Is there an algorithm for this? It's okay if it's an approximation or adds further constraints to simplify. Here's a more detailed statement I have K points in some low dimensional space (say 2d). Each one has a penalty (could be zero). And if…
2
votes
2 answers

How to use MIPGap and TimeLimit from Gurobi in python?

I'm working on a large scale MILP. So I have to set the time limit to a reasonable value or I have to set the MIPGap to a reasonable level. I already know the documentation from gurobi. MIPGap:…
2
votes
1 answer

Can I break down a large-scale correlation matrix?

the correlation matrix is so large (50000by50000) that it is not efficient in calculating what I want. What I want to do is to break it down to groups and treat each as separate correlation matrices. However, how do I deal with the dependence…
2
votes
4 answers

How to approximate points more correctly

I'm trying to approximate my data, but I need a smoother line, how can I implement it? import matplotlib.pyplot as plt from scipy.interpolate import interp1d import numpy as np m_x = [0.22, 0.29, 0.38, 0.52, 0.55, 0.67, 0.68, 0.74, 0.83, 1.05,…
RoyalGoose
  • 453
  • 9
  • 24
2
votes
1 answer

Approximating a shape boundary using Fourier descriptors

I am trying to approximate shape boundaries by using Fourier descriptors. I know this can be done because I've learned about it in class and read about it in several sources. To obtain the Fourier descriptors of a boundary of (x,y) coordinates, I do…
MahlerFive
  • 5,159
  • 5
  • 30
  • 40
2
votes
1 answer

Is this MIPS program supposed to take this long? (program that approximates pi)

Part 2 of this The objective of that was to write a MIPS program that used that algorithm. I did. It works, only it takes about 30 minutes to complete with delta = 1E-2. The C program (compiled with gcc) takes about 1 minute and a half with that…
Hypercube
  • 89
  • 6
2
votes
4 answers

what is the best way to get an approximate number of search results from a query?

to describe it some more, if i have an image map of a region that when clicked, a query is performed to get more information about that region.my client wants me to display an approximate number of search results while hovering over that region…
lock
  • 6,404
  • 18
  • 58
  • 76
2
votes
1 answer

How to get exactly 2 digits after the decimal point in sage

How to get exactly 2 digits after the decimal point approx in sage? If I do the following: sage: k = 0.0006 sage: k.n(digits = 2) 0.00060 I get too many digits. In this case I would want 0.00 as the solution.
Mahathi Vempati
  • 1,238
  • 1
  • 12
  • 33
2
votes
2 answers

Trying to implement the difference formula in MATLAB

Im trying to implement the difference formula f'(x) ≈ [ f(x+h) - f(x) ] / h using MATLAB for x=1 and h=10^-k, where k=0,...,16. Furthermore, I want to plot the error. Below is my code. I see that the error is around 3, which I believe it too big.…
2
votes
1 answer

Specifying x values when converting approx() to data frame

I am trying to get a data frame from the output of approx(t,y, n=120) below. My intent is for the input values returned to be in increments of 0.25; for instance, 0, 0.25, 0.5, 0.75, ... so I've set n = 120. However, the data frame I get doesn't…
Chris A.
  • 369
  • 2
  • 14
2
votes
1 answer

Processing Buffon's Needle Simulation

Hey guys we started coding Buffons needle simulation in my computing class today. My teacher showed us the following code but couldn't explain why the simulation was not getting accurate approximations. There is lots of noise and the approximation…
Student01
  • 45
  • 2