Problem Detail: Can somebody explain me how can I join forward checking with conflict directed backjumping in my CSP solver? I understand that when the consistency fails when I add a value to a variable, I should save all the instantiated Read More …
Category: Uncategorized
[Solved]: Linear programming formulation of cheapest k-edge path between two nodes
Problem Detail: Given a directed graph $G = (V,E)$ with positive edge weights, find the minimum cost path between $s$ and $t$ that traverses exactly $k$ edges. Here is my attempt using a flow network: begin{align} min sum_{(i,j) in E} c_{ij}x_{ij} Read More …
[Solved]: Is np-complete an equivalence class?
Problem Detail: So, there are multiple possible definitions of “np-complete”, two of which being: A decision problem $L$ is np-complete if and only if: $L in text{NP}$ and $forall L’ in text{NP}: L’ preceq_{p} L$ A decision problem $L$ is np-complete Read More …
[Solved]: Finding asymptotically tight bounds $Theta$ of two procedures
Problem Detail: I would like to check time complexity of two procedures for which I am not totally convinced that I got it right. Now the first procedure is this: public static int c(int n) { int i, j, s = Read More …
[Solved]: Preprocess an array for counting an element in a slice (reduction to RMQ?)
Problem Detail: Given an array $a_1,ldots,a_n$ of natural numbers $leq k$, where $k$ is a constant, I want to answer in $O(1)$ queries of the form: “how many times does $m$ appear in the array between indices $i$ and $j$”? The Read More …
[Solved]: The operator $A(L)= {w mid ww in L}$
Problem Detail: Consider the operator $A(L)= {w mid ww in L}$. Apparently, the class of context free languages is not closed against $A$. Still, after a lot of thinking, I can’t find any CFL for which $A(L)$ wouldn’t be CFL. Does Read More …
[Solved]: A* optimality of the expanded node
Problem Detail: Suppose I have a admissible and consistent heuristic. Is it true, that when I expand a node, I have guaranteed that the path I found to this node is optimal? Look at this pseudocode from wikipedia: function A*(start,goal) closedset Read More …
[Solved]: Calculating modulus of large non-factored numbers
Problem Detail: The internet is full of algorithms to calculate the modulo operation of large numbers that have the form $a^e bmod p$. How about numbers with unknown factorization. More precisely, let’s say I have a 4-byte sized modulus prime $p$, Read More …
[Solved]: Show that a language is RE or recursive
Problem Detail: Consider these 2 languages: $L_{ge5} = left { left< M right> : M text{ accepts at least 5 strings} right} $ $L_{<5} = left { left< M right> : M text{ accepts fewer than 5 strings} right}$ Are these Read More …
[Solved]: Help in understanding the implementation/application of scope trees
Problem Detail: I’m learning (self-taught) about language implementation and compiler design, and I’m implementing a toy language to cement the concepts in my mind. However, I’m having trouble understanding how scope trees are meant to be used. In my toy language, Read More …