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 …
Blog
[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]: Forward checking with conflict directed backjumping
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 …
[Solved]: Find subset with minimal sum under constraints
Problem Detail: Let $M$ be a finite set of even cardinality. Define $C={{a,b}:a,b in M, a neq b}$ the set of all pairs over $M$. Let $w:C rightarrow mathbb{R}^+_0$ be a function. Now find $C’ subset C$ with the following constraints: Read More …
[Solved]: Range majority queries – most freqent element in range
Problem Detail: Given N numbers and M range queries (starting and ending points), I need to compute majority (most frequent element, if it exists) in these ranges. I’m looking for an algorithm that would answer queries in logarithmic or even constant Read More …
[Solved]: Name of an Exact Cover by 3 sets variant
Problem Detail: Exact cover by 3-sets is $sf{NP}$-complete: Instance: Given a finite set $X = { x_1,x_2,…,x_{3n}}$ of $3n$ elements and a collection $C = { ( x_{i_1}, x_{i_2}, x_{i_3}) } $ of $m$ 3-elements subsets of $X$; Question: Find a Read More …
[Solved]: What is a brief but complete explanation of a pure/dependent type system?
Problem Detail: If something is simple, then it should be completely explainable with a few words. This can be done for the λ-calculus: The λ-calculus is a syntactical grammar (basically, a structure) with a reduction rule (which means a search/replace procedure Read More …
[Solved]: Free and bound variables
Problem Detail: I am familiar with free and bound variables theory , but while learning I somewhere saw this lambda expression ((lambda var ((fn1 var) & (fn2 var))) argument) From what I have learned it seems to me as var is Read More …
[Solved]: It is possible to implement insertion sort for sorting linked list ?
Problem Detail: it is possible to implement insertion sort for sorting linked lists ? will it have the same O(n^2) efficiency as the array version ? Asked By : ghostloops Answered By : David Richerby This question is fully answered by the Wikipedia 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 …