instruction
stringlengths
0
29.8k
⌀
|logic|
I'm trying to identify an algorithm to solve this computational problem Input: - Bipartite graph `(V, W, E)`, with `E ⊆ V×W` - A fixed order for both `V` and `W`: `V = (v1, ..., vn)` and `W = (w1, ..., wm)` Output: - The subset of `E` of maximum cardinality in which there are no crossing edges. The mental i...
Algorithm for maximum non-crossing edge set in bipartite graph with a fixed permutation
|algorithms|graphs|bipartite-graph|
null
null
For $L_S=\{\langle M\rangle : L(M)\in S \}$ what is known about $S$ in case of: 1. $L_S\in RE$ 2. $L_S\in R$
What is known about $S$ if $\{\langle M\rangle : L(M)\in S \}$ is recursive or recursively enumerable
|formal-languages|turing-machines|computability|recursively-enumerable|
null
Rice's theorem states that if $L_S$ is not trivial (i.e., is not $\varnothing$ nor all languages) then $L_S$ can't be decided (it might be computably enumerable, though). An extension to Rice's theorem states that $L_S$ is computably enumerable if and only if after replacing $S$ with $S\cap RE$, all the following ho...
I have to make an application as my Parallel Computing university course project. The application should make use of parallel processing. Any ideas or examples for these kinds of applications ??
Any ideas for Parallel Computing Project?
|parallel-computing|applications|
null
null
null
Without loss of generality, assume every vertex has degree 1. Create $\deg(u)$ copies of a vertex $u$, then sort the created vertices in the order of the opposite vertex of the corresponding edge. Then, the bipartite graph can be represented by a permutation as in [permutation graphs](https://en.wikipedia.org/wiki/...
> Most algorithms I know don't "allocate" any space resources, they just use it, and they don't need to know the length of the input explicitly The statement that "Most algorithms I know don't 'allocate' any space resources, they just use it" is red herring, since most algorithms use space beyond input and output. ...
Preparing for my finals in my "advances algorithms" course. Usually there is a question to prove one of the theorems that was given over the course. I'm currently trying to write a **full proof** of the following statement: > Self-organizing list that uses Move-to-Front is 2-Competitive. For the completeness of the...
Prove: Self-organizing list that uses Move-to-Front is 2-Competitive
|algorithms|amortized-analysis|check-my-answer|lists|competitive-ratio|
Here are a few ideas for your project. You can parallelize an existing sequential algorithm, which one clearly depends on your interest and/or knowledge of the field. You may also exploit this as an opportunity to learn something new. **Data mining**: CountSketch Count-Min HyperLogLog Space Saving Frequent S...
I have a project to match two groups of people. Under insurance, if the initial sales agent leaves the insurer, their customers will become so-called “orphan customers”. I've given a big data set containing 100,000 customers with matched agencies (13k agencies in total), for each customer and each agency, it provides ...
Persona matching algorithm
|algorithm-analysis|data-mining|
Here are a few ideas for your project. You can parallelize an existing sequential algorithm, which one clearly depends on your interest and/or knowledge of the field. You may also exploit this as an opportunity to learn something new. # Data mining * CountSketch * Count-Min * HyperLogLog * Space Saving * Freq...
Let T be a hexagonal tiling of the plane, and assume we are given a simple polygon P (we define P as the union of the points on its boundary and its interior). The task is to find the subset of T that intersects P as fast as possible. We can assume that the diameter of the hexagons are some fixed constant c, and tha...
Tiling a simple polygon with hexagons
|algorithms|reference-request|computational-geometry|
I am working through Sipser, and have come accross the following claim, *"any $f(n)$ space bounded Turing machine also runs in time $2^{O(f(n))}$"*, which can be proven by looking at the upper bound on the number of configurations a Turing machine that uses space $f(n)$ can take. An implication of this claim is that a...
Confusion about NP vs. LINSPACE
|complexity-theory|time-complexity|np-complete|space-complexity|
Let T be a hexagonal tiling of the plane and assume we are given a simple polygon P (we define P as the union of the points on its boundary and its interior). The task is to find the subset of T that intersects P as fast as possible. We can assume that the diameter of the hexagons are some fixed constant c, and that...
Let $T$ be a hexagonal tiling of the plane and assume we are given a simple polygon $P$ (we define $P$ as the union of the points on its boundary and its interior). The task is to find the subset of $T$ that intersects $P$ as fast as possible. We can assume that the diameter of the hexagons are some fixed constant $...
null
null
null
{"Voters":[{"Id":755,"DisplayName":"D.W."}],"SiteSpecificCloseReasonIds":[]}
Let $T$ be a hexagonal tiling of the plane and assume we are given a simple polygon $P$ (we define $P$ as the union of the points on its boundary and its interior). The task is to find the subset of $T$ that intersects $P$ as fast as possible. We can assume that the diameter of the hexagons are some fixed constant $...
{"Voters":[{"Id":755,"DisplayName":"D.W."}]}
Let $T$ be a hexagonal tiling of the plane and assume we are given a simple polygon $P$ (we define $P$ as the union of the points on its boundary and its interior). The task is to find the subset of $T$ that intersects $P$ as fast as possible. We can assume that the diameter of the hexagons are some fixed constant $...
The relationships between time and space on which you are relying are not correct. In particular, it is true that $\forall \ \mathrm{T}(n) \ \mathrm{DSPACE}_{\mathrm{TM}}(\mathrm{T}(n)) \subseteq \mathrm{DTIME}_{\mathrm{TM}}\left(\mathrm{T}(n) 2^{O(T(n))}\right.)$ and $\forall \ \mathrm{T}(n) \ \mathrm{NSPACE...
Yes, you can do it in approximately $O(A + n \log n)$ time, where $A$ is the area of $P$ and $n$ is the number of vertices, using a [sweep-line algorithm](https://en.wikipedia.org/wiki/Sweep_line_algorithm). Sweep a vertical line, from left to to right. We have an event at each vertex of $P$ and at every $c/2$ unit...
null
null
null
#### The idea Without listing all elements in $S$, we can, following a usual approach, try checking whether $k$ is in $S$ "from the perspective of each distinct prime factor" of $k$. The subtlety and the difficulty is how and what we can do at each distinct prime factor. #### A simple and fast algorithm 1. If $k...
null
# First Few Iterations of the Algorithm # We have an algorithm in which a squirrel visits the nodes of a directed graph. Our graph has two colors of edges: black and white. Initially, the graph has black edges only, and no white edges. The squirrel never change the color of an edge from black to white. Th...
What algorithm will visit the nodes in a graph a number of times equal to the number of paths to that node from the root?
|graphs|graph-traversal|colorings|depth-first-search|
null
null
null
null
null
I have a problem that consists of finding a good solution for a graph that has vertex weights (and this cost is the highest priority), but also has edge costs.
Is there an algorithm able to finding the best cost in a graph that is weighted on both vertices and edges?
|algorithms|graphs|weighted-graphs|heuristics|
One solution would be to convert the original graph to a graph with only edge costs, and then use Dijkstra's algorithm. To do this we can replace a single node with *n* nodes which are fully connected to each other. *n* is the number of edges entering that node. [![enter image description here][1]][1] Note: T...
null
Here is an algorithm, written in Python. For simplicity, vertices are assumed to be $0,\cdots, n-1$. The idea is similar to depth first search. At each recursive call, the algorithm will extend the path to every kid of the last node of the path that is not included in the path. ```python def cs153457(n: int, roo...
# First Few Iterations of the Algorithm # We have an algorithm in which a squirrel visits the nodes of a directed graph. Our graph has two colors of edges: black and white. Initially, the graph has black edges only, and no white edges. The squirrel never change the color of an edge from black to white. Th...
What algorithm will visit each node in a graph a number of times equal to the number of paths to that node from the root?
|graphs|graph-traversal|colorings|depth-first-search|
# First Few Iterations of the Algorithm # We have an algorithm in which a squirrel visits the nodes of a directed graph. Our graph has two colors of edges: black and white. Initially, the graph has black edges only, and no white edges. The squirrel never changes the color of an edge from black to white. T...
null
null
I just want to say first that I'm not an expert, but I find this question interesting. I will focus on integer exponentiation. Like the OP says, intuitively, exponentiation of integers should cost $O(n)$, since each multiplication should add a constant number of bits to the result. For example, $8 \cdot 8$ in bina...
Here is a recursive algorithm, written in Python. For simplicity, assume vertices are $0,\cdots, n-1$. The idea is basically the same as that of the usual depth first search. At each recursive call, the algorithm will explore all paths that starts from the current source node without revisiting any visited nodes. Ho...
Various computational hierarchies describes the relative expressivity of different classes of languages, machines, or other models of computing, with the classic progression for Automata Theory [0] being: Deterministic Finite Automata (DFA) < Push-Down Automata (PDA) < Turing Machines (TM). These correspond to the ...
Is there a hierarchy of computational expressivity that is sensitive to evaluation strategies?
|turing-machines|computability|lambda-calculus|evaluation-strategies|church-numerals|
From what I understand, LL and LR parsing require a grammar to be in "canonical form", i.e. only productions of the form `A -> b1 b2 ... bn`, where `b1`, ..., `bn` are either a terminal or a nonterminal. To express alternation, one would add multiple productions with the same LHS. However, some EBNF expressions woul...
Canonicalizing Arbitrary EBNF Expressions
|formal-grammars|compilers|parsers|
null
Most (or all) reasonable programming are Turing-complete, and thus can be used to compute exactly the computable functions, i.e., to decide the decidable languages, nothing more and nothing less. So details like strict or lazy evaluation don't make a difference to their expressiveness, in this sense. ---- > a gi...
The Church-Rosser Theorem [0] states that the Lambda Calculus (LC) is confluent: between a source expression S and target expression T, the latter in normal form, for any given P, a sequence of permissible reductions that begins with S, there is some subsequent sequence of reductions Q (possibly the empty sequence)...
Must the evaluation strategy for a language be specified in order to apply the Church-Rosser Theorem?
|lambda-calculus|normal-forms|combinatory-logic|evaluation-strategies|
null
null
The Church-Rosser theorem gives you the following guarantees: - A term has *at most one* normal form. That is, there aren't different normal forms depending on your choice of evaluation strategy. - If a term has a normal form, then no matter what evaluation strategy you use, the result of that evaluation strategy...
null
null
null
null
monitor DiningPhilosophers { enum {THINKING, HUNGRY, EATING} state[5]; condition self[5]; void pickup(int i) { state[i] = HUNGRY; test(i); if (state[i] != EATING) self[i].wait(); } void putdown(int i) { state[i] = THINKING; test((i + 4) % 5...
Why is this code for dining philosophers deadlock free?
|operating-systems|concurrency|mutual-exclusion|
So apparently my confusion has to do with not realizing what a monitor really is. "The monitor construct ensures that only one process at a time is active within the monitor" This means that in my example, once process 1 runs the pickup() call in the monitor, process 2 cannot begin its own pickup() call until process ...
null
**Short answer:** If the mantissa is not all ones, the next floating-point number is $1$ ulp more. - E.g. $1.1000_b\times 2^7\to1.1001_b\times 2^7$ ($192_d\to200_d$), the difference is $2^{7-4}=8$. If the mantissa is all ones, the next floating-point number is all zeroes with the next exponent, and the differe...
*I wrote this to help someone understand standardization in the context of c++.* Most programming languages have a committee that works on a specification of the language called a standard. Individual vendors then implement interpreters or compilers that conform to this standard. The idea is that code should be ...
*I wrote this to help someone understand standardization in the context of c++.* Most programming languages have a committee that works on a specification of the language called a standard. Individual vendors then implement interpreters or compilers that conform to this standard. The idea is that code should be ...
null
Let's say I have a optimization problem P1, where the constraints are linear but the objective function is not. Let's say I have another optimization problem with is linear in constraints and linear in the objective function. The goal of the problem is to show that if P1 has a bounded optimum value then P2 has the s...
How to prove feasibility?