# Questions tagged [algorithms]

A description of the specific steps needed to solve a particular problem in an unambiguous way, expressed in an abstract form.

447 questions
84 views

### Low memory algorithm for matrix diagonalisation

I'm trying to find the largest eigenvalues of very large $N \times N$ matrices ($N = 10^{10}$ and larger). The matrices are not sparse but the multiplication operation is fast. For now, I'm using ...
42 views

### Algorithm to adjust range / scale so it is “nicley” dividable by n

Hard to come up with a good title. I'm looking for an algorithm to adjust a range. Say I have 5.34 as min and 23.96 as max value. This gives it a range/difference of 18.62. I now want to divide this ...
108 views

125 views

### Eigenvector with maximum overlap

Given a matrix $M$ and a vector $v$, is there an efficient method to find the normalized eigenvector of $M$ that is closest to $v$, in that it has maximal overlap. More explicitly, a vector $v$ can be ...
191 views

### How to compute the Frobenius norm of matrices whose entries are either too large or too small?

While implementing in Matlab the Frobenius norm of a matrix $$\| A\|_{\text F} := \sqrt{ \sum_{i=1}^m \sum_{j=1}^n a_{ij}^2 },$$ a problem arises when numbers are too big or too small: If a number ...
95 views

### Linear regression with inequality constraint in Java

I haven't been doing math in years and I'm facing the following problem. I'm trying to implement in Java a linear regression under a set of inequality constraints. Sorry in advance for all the ...
935 views

### When doing a linear regression, what is the fastest/slowest regularizer?

Let's say I am doing a linear regression on a large dataset and I only care about computational speed, which of the following regularizers should I use and which should I absolutely not use? $L_0$ -...
181 views

328 views

### Sieve of Eratosthenes with minimized memory usage [closed]

Originally sieve of Eratosthenes requires a lot of memory. This algorithm is my attempt to limit the memory usage. In fact it requires ln(N) memory (for each found prime number we keep last crossed ...
50 views

91 views

### How can I evaluate the accuracy of my n-body simulation?

I am making an n-body simulation in python. There are many different methods to numerically solve the system of differential equations governing the gravitational interactions between the $n$ ...
318 views

4k views

### The easiest way to find intersection of two intervals

Right now I stuck with a problem. It seems to be really trivial one, but still it is hard for me to find an appropriate solution. The problem is: One has two intervals and are to find the intersection ...
47 views

### The right algorithm to predict from selected data samples [closed]

I'm trying to come up with the right algorithm for a system in which the user enters a few symptoms and the system has to predict or determine the likelihood that a few selected symptoms are ...
53 views

### Comparing the solutions to a multi-objective optimization problem

Suppose I have a multi-objective optimization problem, and I wish to find solutions using two different methods/algorithms. The result of each algorithms is a Pareto front. Comparing two different ...
72 views

### How does this Constrained Minimization algorithm work?

I don't fully understand the subsection 3.2 Constrained minimization of this paper. In particular, I don't understand the first step "Register active set" and the definition of projection $P(x)$. ...
224 views

### sum of n numbers with the power k

I am searching for a good algorithm to solve problem 487 on project-euler. I dont want code or something like that, I only want the name of the algorithm thats best suited. Till now I think of either ...
111 views

### Error Reduction algorithm for single measurement intensity [closed]

I'm trying to solve the phase problem from single intensity measurement. I implemented error reduction algorithm in Matlab for ...
93 views

### Optimization based integration for MPM

I'm considering implementing (just for simplicity) the unconstrained implicit optimization based integration for Material Point Method as described in Chenfanfu Jiang's thesis on MPM (the minimization ...
548 views

### LU decomposition of large dense matrices

I wanted to generate LU decomposition of large size dense matrices ($N>10^7$), the LU decomposition I'm currently using is based on Adaptive Cross Approximation and is taking very long time to ...
48 views

### Passing in a vector from this particular matrix class floating around online [closed]

I am using this matrix class here to assist me in converting this Least Squares algorithm that prices American options that is written in Matlab in C++. My question is pretty simple. I want to pass in ...
452 views

### Can a Depth first traversal of a graph visit node more than once? [closed]

Is there a way in which Depth First Traversal will put a node into the stack more than once using the general algorithm as shown here. Also, is it compulsory for all nodes to be entered into the ...
282 views

### Full segmentation of a linear space using a clustering algorithm

Once again, I am not entirely sure how to describe what I am looking for, hence I have a hard time finding answers using Google or any other literal search method. Let's say I have a time series: (...
78 views

### Computing Algebraic Riccati inequality

In my Robust model control, I have got a couple of quadratic Riccati inequalities which need to be solved numerically on MATLAB. My question, Is there function on MATLAB can solve quadratic Riccati ...