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).

An algorithm is an unambiguous specification of how to solve a class of problems. The study of algorithms is the branch of mathematics that specializes in finding efficient (mostly in the terms of time and space complexity) for various computational problems. It often involves combinatorics, number theory and geometry.

The field also includes data structures, computational models and proofs of lower bounds for certain algorithms.

See also and .

10691 questions
3
votes
2 answers

Finding edges that are not part of any perfect matching

Given a balanced bipartite graph, what is, or is there, an efficient algorithm for finding all edges which are not part of any perfect matching in the graph?
janders
  • 43
  • 3
3
votes
2 answers

Existence of algorithm for determining if a given number is rational or not

As far as I understand, it is not necessarily a easy thing to prove that a real number is rational or not. For example, according to http://mathworld.wolfram.com/e.html "$e+\pi \in \mathbb{Q}$?" is still an open problem. This might be completely…
John Smith
  • 1,867
  • 19
  • 31
3
votes
0 answers

Sorted byte arrays with unique values - best possbile compression

I have byte arrays with following constraints: Length between 1 and 256 Length median about 128, but I have to verify this on larger dataset Values are sorted ascending Values are unique I am looking for algorithm for best compression of this…
watbywbarif
  • 141
  • 3
3
votes
1 answer

No of pairs of elements whose XOR satisfies a condition

We are given a set of $n$ non-negative integers. We need to find the number of pairs of integers from this set whose $XOR$ is $ = K$. My approach is to sort the integers which takes $O(NlogN)$. Then for each element $a_i$ find $a_i\oplus K$. Make a…
nitish712
  • 463
  • 5
  • 16
3
votes
1 answer

Directed Graph, shortest path algorithm. I don't even understand what this question is asking. Is it a trick question or just Dijkstra's?

Consider a directed graph with each edge assigned a nonnegative weight D that reflects the difficulty of passing over that edge (perhaps modeling an obstacle course). Define the difficulty of a directed path to be the maximum of the difficulties of…
3
votes
1 answer

Is there a polynomial-time algorithm returning a vertex of the feasible region?

I have a standard basic linear program. Is there a polynomial-time algorithm that can return a vertex of the polytope that describes the feasible region? I know that the ellipsoid method can give a feasible solution, but is it possible to obtain a…
3
votes
1 answer

Cooley-Tukey FFT with arbitrary radices

The radix-2 FFT using Cooley-Tukey utilises two interleaved transforms of length $N/2$, and you can see near the bottom of that section that we can find the second half of the original transform by multiplying the twiddle factor by $-1$. (See the…
Ozzah
  • 242
  • 1
  • 12
3
votes
2 answers

Flip the bulbs in minimum number of moves

We are given a $n \times m$ rectangular matrix in which every cell there is a light bulb, together with the information whether the bulb is ON or OFF. Now i am required to switch OFF all the bulbs but i can perform only one operation that is as…
user3001932
  • 1,028
  • 2
  • 10
  • 25
3
votes
2 answers

Derivative of $n^{\log n}$?

What would be the derivative of $n^{\log n}$? I have to prove that $(\log n)^n$ = $\omega$($n^{\log n}$). I am trying to implement L'Hopital rule.
1xQ
  • 85
  • 2
  • 6
3
votes
3 answers

Can I use the master theorem for this?

this is a HW question so please don't just give me the answer right away. Basically, I'm working on solving the running time of this recurrence method: $$T(n) = 4T(n/3) + n \log \log n$$ I want to try and use the master method to solve this, but…
Mathew
  • 33
  • 3
3
votes
2 answers

Linear Diophantine equation in two variables with additional constraints

Given, $$aX + bY = c$$ where, $$c > b > a > 0;\quad X, Y > 0;\quad b\nmid c, a\nmid c$$ I want to find out if a solution exists as efficiently as possible (I'm not interested in the solutions). Are there any calculations I can make before (or…
3
votes
0 answers

Finding position in a tree based on node number

Let us assume my tree starts with $1$ node, then each node has $2$ nodes beneath it. Let us also assume the top node of the tree is numbered $1$, and node $2$ and $3$ are directly beneath it. An entire row of nodes must fill before any new child…
Joe
  • 131
  • 1
3
votes
1 answer

Eliminating Epsilon Production for Left Recursion Elimination

Im following the algorithm for left recursion elimination from a grammar.It says remove the epsilon production if there is any I have the following grammer S-->Aa/b A-->Ac/Sd/∈ I can see after removing the epsilon productions the grammer becomes …
techno
  • 579
  • 3
  • 13
  • 32
3
votes
1 answer

How to check if $n^2$ will square root evenly without square rooting $n^2$

How can I easily check if the square root of a number is a whole number and not a decimal without computing the square rood of said number. I could square root the number ((n^2)^1/2 or sqrt(n^2)) but I do not want to.
Vader
  • 131
  • 1
  • 5
3
votes
3 answers

Comparison of almost planar graphs

I have multiple graphs all of which are almost planar. Is there any existing terminology / method which compares them, such that one can say which one is more planar? This could simply be the required number of edge removal to make a graph…
1 2 3
99
100