Given a list of vectors, I want to find whether there exists a vector such that its dot product with those in the list is all (semi)positive, or at least above a certain small negative value.

  • 1
    $\begingroup$ What is the dimension of the ambient space? In principle, one can compute the convex hull of the points and check whether the origin is contained in the interior. Mathematica provides ConvexHullMesh, but that works only in dimensions 2 and 3... $\endgroup$ – Henrik Schumacher Mar 26 at 7:53
  • $\begingroup$ It's 7 dimensional. And the list is of 14 vectors. I was wondering whether Mathematica has some standard function for this sort of thing. I've searched the reference site for "convex cone" but haven't found anything. $\endgroup$ – user3257842 Mar 26 at 7:59
  • $\begingroup$ Maybe you find this one interesting: sciencedirect.com/science/article/abs/pii/0305054893900803 $\endgroup$ – Henrik Schumacher Mar 26 at 8:28
  • $\begingroup$ After reading your post, I figured I could probably get the code to work by using a constrained NMinimize for the "Nearest" function, where you have one parameter for each vector and the constraints explicitly describe the convex hull. $\endgroup$ – user3257842 Mar 26 at 8:33
  • 1
    $\begingroup$ you get a function with (n-1) parameters describing the linear combination of the n vectors with the n'th parameter being equal to 1 minus the sum of the other parameters. Then you minimize its distance to 0 constrained by all parameters and their sum being between 0 and 1. Not the most elegant solution, but it might work for small data-sets. $\endgroup$ – user3257842 Mar 26 at 8:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.