User:SongmingFan/sandbox

Definition
The Orthogonal Vectors problem (OV) is a decision problem in computational geometry and theoretical computer science. It concerns determining whether there exist at least two vectors within a set that are orthogonal to each other. Mathematically, given $$n$$ vectors in $$\{0, 1\}^d$$ where $$d=O(\log n)$$, the problem asks whether there are at least two distinct vectors $$v_i, v_j \in V$$ such that their dot product is zero: $$v_i \cdot v_j=0$$.

For vectors $$v_i=\left(a_1, a_2, \ldots, a_d\right)$$, and $$v_j=\left(b_1, b_2, \ldots, b_d\right)$$ in $$\{0, 1\}^d $$, their dot product is defined as: $$v_i \cdot v_j=a_1 b_1+a_2 b_2+\ldots+a_d b_d$$. A result of zero indicates that the vectors are orthogonal, meaning they share no direction in the space they inhabit. The problem is particularly interesting in high-dimensional spaces where intuitive geometric interpretations are less obvious.

OV can be easily solved in $$O(n^2d)$$ time by taking the dot product of all pairs of vectors. The OV conjecture is that for every $$\varepsilon>0$$, there is a $$c \geq 1$$ such that OV cannot be solved in $$n^{2-\varepsilon}$$ time on instances with $$d=c \log n$$. A negation of this conjecture could imply the existence of more efficient algorithms for certain cases of SAT, potentially contradicting SETH. The best known algorithm is given by Amir Abboud, Richard Ryan Williams, and Huacheng Yu who gave a $$n^{2-\Theta(1 / \log (d / \log n))}$$ runtime.

Naive algorithm
Simply calculate the dot product of all the $$\binom{n}{2}$$ vector pairs from the list, each takes $$O(d) $$ time. The total cost is $$O(n^2d)$$.

A subquadratic algorithm when d < log(n)
First, for each vector $$v \in\{0,1\}^d$$, check if $$v$$ belongs to the list. If it does, add it to the a new list $$A^{\prime}$$. The purpose of creating $$A^{\prime}$$ is to remove all redundant entries in the original list. This step will cost $$O\left(2^d n \cdot d\right)$$.

Then apply the naive algorithm for orthogonal vectors on $$A^{\prime}$$. The process will cost $$O\left(2^{2 d} \cdot d\right)$$ in the worst case. Thus, the total cost of the algorithm is $$O\left(2^d (n+2^d) \cdot d\right)$$. The running times of these algorithm clearly suggest when $$d=(1-\epsilon) \log n$$, then it has a running time of $$O\left(n^{2-\epsilon} \cdot d\right)$$.

Sorting-based algorithm
First, sort the original list by every bit of the vector. For example, for $$a=(1, 1, 0, 0)$$ and $$b=(1, 0, 0, 0)$$, $$a>b$$ because the second bit of $$a$$ is greater than that of $$b$$. Using quick sort to sort the list will cost $$O(nd*log(n))$$.

After that, for each $$v_i$$ in the list, reverse bits of it to get the desired vector $$v_j$$ whose dot product with $$v_i$$ is 0. Applying binary search on the sorted list for $$v_j$$ will cost $$O(2^dd*log(n))$$. An iteration through all the vectors will cost $$O(2^dnd*log(n))$$ in total.

In all, the cost of the algorithm is $$O(2^dnd*log(n))$$.

Variants
Given a set S of n vectors, each vector in $$\{0, 1\}^d$$. OV looks for orthogonal pairs such that if there exists $${u} \cdot {v} = 0$$

Signed-OV looks for orthogonal pairs from two sets, $$S_{-}$$, $$S_+$$ each of n vectors in $$\{0, 1\}^d$$. Where vectors in $$S_{-}$$ carry negative sign and vectors in $$S_+$$carry positive sign. For each orthogonal pair, one vector must carry a positive sign and the other must carry a negative sign.

Given a set S of n vectors, each vector in $$\{0, 1\}^d$$.

Reduction from Signed-OV to OV

Given a solver for OV, Signed-OV can be solved through the following manner.

Let vectors v ∈ $$S_+$$ & u ∈  $$S_{-}^'$$and let vectors u ∈  $$S_{-}$$ & v ∈ $$S_{+}^'$$.

Let  $$S_{-}^'$$ be a list where u′ = < 1, 0 > +u, and let  $$S_{+}^'$$ be a list where v′ = < 0, 1 > +v. Appending < 1,0 > and < 0,1 > to  $$S_{-}^'$$and $$S_+^{'}$$ ensures $${u^'} \cdot {u^'} = 1$$ and $${v^'} \cdot {v^'} = 1$$. Prepending vectors to make sure non-orthogonality of any 2 vectors within the same set.

Let  $$S_{+-}^'$$ =  $$S_{-}^'$$+ $$S_+^{'}$$. Run solver ($$S_{+-}^'$$). if $${u^'} \cdot {v^'} = 0$$ then $${u} \cdot {v} = 0$$. When solver returns true then this is a valid process of reduction.

Reduction from OV to Signed-OV

Given a solver for Signed-OV, OV can be solved through the following manner.

Let vectors v ∈ $$S$$ and let vectors u ∈ $$S$$ Let  $$S_{-}$$ = < 0,1 > ​+ u, $$S_+$$ = <1,0 > + v, Prepending vectors to make sure non-orthogonality of any 2 vectors within the same set.

Let  $$S_{+-}$$ =  $$S_{-}$$+ $$S_+$$. Run solver for Signed-OV ($$S_{+-}$$). if $${u^'} \cdot {v^'} = 0$$ then $${u} \cdot {v} = 0$$. When solver returns true then this is a valid process of reduction.

OV-hardness
When a problem can be solved in sub-quadratic time, then it can be defined as OV-hard if it implies that OV can be solved using an algorithm that is subquadratic. This is critical, as based on conjectures like SETH, OV can not be solved in subquadratic time. Reductions from OV to other problems demonstrate that if OV cannot be solved in sub-quadratic time, then neither can the reduced problems, unless these foundational conjectures like SETH are falsified. Ryan Williams and Virginia Vassilevska Williams both have made significant contributions to OV-hardness within the field of fine-grained complexity. Their work has facilitated the formation of the discussion around OV-hardness by demonstrating what the implications of solving certain problems in subquadratic time would be through their reductions from OV.

Some conjectures and problems on OV:


 * A popular hardness conjecture on OV usually specify dimension d to be between $$\omega (log \ n)$$ and $$n^{o(1)}$$, also known as low-dimension Orthogonal Vector Conjecture (OVC)


 * One such instance of OV-hardness problem is hardness of k-OV for $$MC( {\forall \exists}k-1{\forall} )$$


 * Sparse high-dimension OVC (SHDOVC), Moderate-dimension OVC (MDOVC) and Low-dimension OVC (LDOVC), three versions of orthogonal vector conjectures can also imply the hardness of problems including Edit Distance, longest common sequence, etc.

Related Problems
The following problems are either all in (or can be approximated in) truly subquadratic time, or none of them are:

1. (OV) Finding an orthogonal pair among $$n$$ vectors.

2. (Min-IP/Max-IP) Finding a red-blue pair of vectors with minimum (respectively, maximum) inner product, among $$n$$ vectors.

3. (Exact-IP) Finding a red-blue pair of vectors with inner product exactly equal to a given integer, among $$n$$ vectors.

4. (Apx-Min-IP/Apx-Max-IP) Finding a red-blue pair of vectors that is a 100-approximation to the minimum (resp. maximum) inner product, among $$n$$ vectors.

5. (Approximate Bichrom. $$\ell_p$$-Closest Pair) Approximating the $$\ell_p$$-closest red-blue pair (for a constant $$p \in [1, 2]$$), among $$n$$points.

6. (Approximate $$\ell_p$$-Furthest Pair) Approximating the $$\ell_p$$-furthest pair (for a constant $$p \in [1, 2]$$), among $$n$$ points.

7. (Approximate Additive Max-IP) Additively approximating the maximum inner product of all red-blue pairs, among $$n$$ vectors.

8. (Approximate Jaccard-Index-Pair) Additively approximating the maximum Jaccard index between $$a \in A$$ and $$b \in B$$, where $$A$$ and $$B$$ are two collections of $$n$$ sets.