Skip to main content

Questions tagged [algorithms]

Mathematical questions about Algorithms, including the analysis of algorithms, combinatorial algorithms, proofs of correctness, invariants, and semantic analyses. See also (computational-mathematics) and (computational-complexity).

Filter by
Sorted by
Tagged with
0 votes
0 answers
22 views

I have been working on an algorithm for efficient matrix–vector multiplication on GPUs in the regime of moderate sparsity (30%–90%), with no structural assumptions on the sparsity pattern. The ...
vlejd's user avatar
  • 1
-3 votes
0 answers
65 views

I’ve been exploring a measurement approach for NP and NP-complete problems based on average time per logical step. I define: ...
Israeli Ochimnai's user avatar
2 votes
1 answer
42 views

Motivation I am experimenting with symbolic implementations of algorithms that, given a majorization relation between two exponent vectors, automatically generate Olympiad-style inequality proofs ...
hbghlyj's user avatar
  • 6,107
1 vote
1 answer
147 views

I have to randomly put $N$ points in a sphere of radius $R$ in a way that the distance of every point from the other points is greater than or equal to $r_0$. Is there an algorithm to solve this ...
Riccardo.Alestra's user avatar
8 votes
3 answers
324 views

The greatest common divisor (gcd) of two integers $a$ and $b$ can be computed with the Euclidean Algorithm. With the gcd known, one can compute the least common multiple (lcm) via the formula $\mathrm{...
Martin's user avatar
  • 741
0 votes
1 answer
59 views

Is there any better way than a brute force scan to find a square (or possible the smallest square) of format $A+n*B$, where $A$ and $B$ are some fixed constant integers? (I know that that is ...
JarmoP's user avatar
  • 101
4 votes
1 answer
279 views

My question is about a certain combinatorial game. The game works as follows. We have $n$ urns, each of which contains $m$ balls, where $m$ and $n$ are positive and satisfy $m < n$. A move consists ...
Jason's user avatar
  • 728
0 votes
0 answers
23 views

I have a DAG where every node has a (usually small) set of candidate integers. A candidate a is compatible with b if (a | b) or (b | a). For every root I want to choose one candidate per node to ...
user5109988's user avatar
3 votes
2 answers
407 views

Given a graph, I wish to try and color it with the minimum number of colors (0,1...k). Each 2 connected vertices must have different colors. I proposed the following algorithm - Initialize an array of ...
C. Arnold's user avatar
0 votes
0 answers
32 views

I'm trying to solve the following Codeforces question (https://codeforces.com/contest/837/problem/D), and I feel like I have a solution that's very close but is probably still over the time constraint....
redLotus31415's user avatar
2 votes
0 answers
43 views

Problem: (from the Indian ZIO exam, $2021$, problem $2$) We are given a list of integers of length $n$. What is the minimum number of elements whose sign you need to flip such that every prefix sum ...
Marc Carlsan's user avatar
0 votes
0 answers
10 views

As stated in title, I wonder know if there exists any algorithms for generating simplicial $n$-spheres on $k$ vertices. The motivation for seeking such algorithms comes from my goal to compute the ...
Y.Wayne's user avatar
  • 377
1 vote
0 answers
38 views

I am unsure which category this question best fits into, so I apologize in advance if this is not the ideal place to ask. It is known (see for example: Do cyclic permutations of rows and column ...
Dano Logos's user avatar
0 votes
0 answers
38 views

Consider the discrete Log Problem w.r.t. prime $p$. Given $b, p, r$ find $x$ where: $b^x\bmod p=r$. Q: What is the complexity of calculating the Least Significant Bit of $x$ in the worst case? Note: ...
TheoryQuest1's user avatar
1 vote
1 answer
80 views

Let $K$ be any field. Two square matrices $A,B \in \text{Mat}_n(K)$ are called similar (denote it my $\sim$) iff there exists a $S \in \text{GL}_n(K)$ such that $A=SBS^{-1}$, so in this form an ...
user267839's user avatar
  • 10.1k
1 vote
1 answer
73 views

Consider the following streaming algorithm for maximum matching in a weighted graph. ...
Simd's user avatar
  • 779
3 votes
0 answers
60 views

Finding solution of a Sliding Puzzle of size $N \times N$. asks about solving a sliding-block puzzle with multiple holes. Apparently a 2-hole puzzle is always solvable; as those who've played with the ...
John Hughes's user avatar
0 votes
1 answer
97 views

We are given two matrices $R^{N \times N}$, each containing unique integers from $0$ to $N^2 - 1$ (except $0$, it does not need to be unique). The $0$ in the matrices will be called $blank$. The task ...
RodrigerScroge's user avatar
1 vote
0 answers
25 views

Given a list of constraints $$ F_i = \{ x\in\mathbb{R}^n\mid L_i(x) \leq c_i \} $$ where $L_i\in L(\mathbb{R}^n,\mathbb{R})$ and $c_i\in\mathbb{R}$ for every $i\in\{ 0,\dots,m \}$ with $m \geq n$, ...
virtualcode's user avatar
1 vote
1 answer
111 views

Consider a finite family $F=\{f_i\}_{i=1}^n$ of nonconstant linear functions $f_i(x)=m_ix+b_i$ (where $m_i$, $b_i$ and $x$ are real numbers). Is there a simple way to determine the index $I(x)$ such ...
Taladris's user avatar
  • 12.5k
0 votes
1 answer
34 views

Definition of a leaf node: A node that does not have any child node is called a leaf node. Given an algorithm with a running time: $$T(n)=2T(n/2)+O(\sqrt{n}).$$ So the number of nodes at root level ...
Xiaoyang Liu's user avatar
3 votes
1 answer
236 views

We say that a sequence $x_1, x_2,\ldots, x_n$ is increasing if $x_i ≤ x_{i+1}$ for all $1 ≤ i < n$. How many ways are there to fill an 8 x 8 table with numbers 1, 2, 3, and 4 such that: • The ...
Pippin's user avatar
  • 33
15 votes
0 answers
441 views
+100

Let $A$ be a nonempty subset of $X=\left\{0,1,\ldots,n\right\}$. We may ask whether $A$ can be written as $A=B+C$, where $B,C$ are also nonempty subsets of $X=\left\{0,1,\ldots,n\right\}$. Here, $B+C$ ...
Dilemian's user avatar
  • 1,371
0 votes
1 answer
75 views

In a Linear Program, introducing non-negativity and/or non-positivity constraints into the Primal turns equality constraints into "regular inequality constraints" (a.k.a., inequality ...
user10478's user avatar
  • 2,184
0 votes
0 answers
110 views

Motivation While I was looking at the method of sections to find the forces in the members of a truss in engineering mechanics, I had a question about the minimum amount of calculation required to ...
Arjun Ghosh's user avatar
0 votes
0 answers
20 views

I am currently implementing Kim & Kim's extension of the Greiner-Hormann algorithm seen here. However i have came across an issue that i am unaware if i'm missing something or not. I have 2 ...
Daniel's user avatar
  • 1
1 vote
2 answers
62 views

Binary exponentiation provides an algorithm for calculating a power $a^n$, where you iterate over the binary digits of $a$, and at each step update $\mathbb{val} \leftarrow \mathbb{val} ^ 2$ $\mathbb{...
Jeremy Salwen's user avatar
1 vote
0 answers
79 views

I'm confused by wikipedia's explanation of balanced ternary's algorithm for the square root. They only show a formula I don't know how to generalize to more digits than 2, and the example given doesn'...
D. Sánchez Barreras's user avatar
2 votes
1 answer
68 views

I have a set $S = \{v_1, v_2, \cdots, v_N\}$ with $N$ vectors, each of which have $d$ dimensions. I would now like to find a set $S' = \{n | v_n \in \mathrm{span(}S \setminus \{v_n \}) \}$, i.e. the ...
Frederik's user avatar
4 votes
2 answers
330 views

Let us consider two monic polynomials $f(X), g(X) \in \dfrac{\mathbb{Z}}{p^k\mathbb{Z}}[X]$. Now, we call $h(X)$ is a divisor of $f(X)$, if there exists a $l(X) \in \dfrac{\mathbb{Z}}{p^k\mathbb{Z}}[X]...
Afntu's user avatar
  • 4,285
-1 votes
1 answer
107 views

Does anyone know how to perform Gaussian elimination modulo $4$? Are there any ready-to-use code snippets or relevant websites available? I find that there are almost no existing code implementations ...
DSTBP's user avatar
  • 103
3 votes
1 answer
115 views

I've got a polyline of straight line segments to which I'd like to calculate an offset polyline (like an offset curve, but described as a sequence of connected non-arcing line segments). This is ...
Tim Meyer's user avatar
  • 131
5 votes
0 answers
54 views

A Salem-Spencer set is a set of numbers no three of which form an arithmetic progression. Suppose $A$ is a Salem-Spencer set. And let $(a_n)_{n=1}^{\infty}$ be the set $A$ written as a strictly ...
Adam Rubinson's user avatar
3 votes
2 answers
102 views

It's not hard to show that the maximum eigenvalue of a matrix $A\in \mathbb{S}^n$ can be calculated through the following SDP: \begin{align*} \max&\ Tr(AX) \\ \text{subject to}& \ Tr(X) = 1\\ ...
Risss's user avatar
  • 93
1 vote
0 answers
37 views

Recently I realized that I've coded a custom-made function for recursive output error method which differs a bit from the traditional algorithm and would like to know the perception of my peers. ...
Jean-Fr's user avatar
  • 141
1 vote
0 answers
45 views

In this lecture (43:39 - 44:10) and this lecture (1:11:13 - 1:12:46), Stephen Boyd hints at a method for introducing equality constraints into a convex program. The notation from the lectures is $$\...
user10478's user avatar
  • 2,184
2 votes
1 answer
99 views

We study equivalence classes of ternary matrices of size $m\times n$, where equivalence is defined via row permutations, column permutations, and negation of entire columns. Our goal is to define and ...
fgrieu's user avatar
  • 1,860
1 vote
0 answers
33 views

A little context: I am implementing a branch and cut algorithm and I have a separation routine, where I construct a digraph and have to run a minimum mean cycle algorithm to check whether some ...
m6rco's user avatar
  • 43
2 votes
0 answers
105 views

Let $B_n$ be the $n$-th Bernoulli number. $T(n,k)$ be an integer coefficients such that $T(n,k) = \nu_k$ where we start with vector $\nu$ of a fixed length $n$ with elements $\nu_1=1$, $\nu_i=0$ for $...
user avatar
0 votes
0 answers
75 views

I’m interested in computational problems that are asymmetric: problems where finding a solution is hard, but verifying a candidate solution is easy. For example, in the approximate nearest neighbour ...
Daniel Adams's user avatar
1 vote
0 answers
251 views

We begin with four numbers written on a board: $1,0,0,0$ At each step, we may choose two of the four numbers (possibly the same), and replace one of the four with either their sum or their product. ...
Goaki.'s user avatar
  • 125
1 vote
0 answers
48 views

I strongly suspect this question has a very straightforward answer. Let $M = \mathbb{Q}(\sqrt{a_1},\dots,\sqrt{a_k})$ be a large multiquadratic field. In this setup we assume it is infeasible to ...
Oisin Robinson's user avatar
1 vote
0 answers
70 views

Given a vector of algebraic numbers, $\vec{a} = (a_1, a_2, \dots, a_n)$, let the "max algebraic degree" be $$ \operatorname{maxDeg}(a_1, a_2, \dots, a_n) = \max(\deg(a_1), \deg(a_2), \dots, \...
Peter Kagey's user avatar
  • 5,448
4 votes
0 answers
148 views

We have $n$ glasses with capacities $1,2,\dots,n$ liters, respectively. The amount of water in each glass is always an integer and the sum is $n$. In each move, we may pour water from one glass into ...
ALi1373's user avatar
  • 71
0 votes
1 answer
69 views

I'm looking for a known or clean algorithm for the following simultaneous Diophantine approximation problem. I have $n$ real numbers $\vec{a} = (a_1, a_2, \ldots, a_n) \in \mathbb{R}^n$ such that $0 \...
Alien's user avatar
  • 711
0 votes
1 answer
81 views

It is stated in the video on youtube, here, at 16:48; that multiplication of two $8 \times 8$ matrices, using the Divide-and-Conquer (i.e., recursive) approach, needs $64$ multiplications of $2 \times ...
jiten's user avatar
  • 4,972
1 vote
1 answer
144 views

I'm looking for the most efficient way to compute ${n+10^{10} \brace 10^{10}}$ for $1 \leqslant n \leqslant 1000$. Obviosly, the standard formula, namely $$ {n \brace k} = \frac{1}{k!} \sum\limits_{j=...
user avatar
1 vote
1 answer
138 views

Fibonacci Algorithms This question came to me when I learned today that the Fibonacci sequence has a really neat $2\times 2$ matrix power defnition which enables a newbie to compute $n$th Fibonacci ...
Luna's Chalkboard's user avatar
2 votes
0 answers
54 views

Colloquial framing of the question: I have two solid wood blocks of arbitrary shape. I need to fit them together in some way, sort of like they were two pieces of a jigsaw puzzle. Is there an ...
zhuli's user avatar
  • 2,828

1
2 3 4 5
236