how can i generate boundary in 2d space from sum of finite vectors.

120 Views Asked by At

the setup is that i have only limited number of 2d vectors

$D = ((x_1, y_1), (x_2, y_2), ...,(x_n, y_n))$

where $0<x_i<1, 0<y_i<1, \sum_{i=1}^{n}x_i \leq 1, \sum_{i=1}^{n}y_i \leq 1 $

Start from origin (0, 0), you can pick any number of vectors to follow to generate a path, within one path, one vector can only be used exactly once.

The end of the paths are the points we care, and it would form a set of points within the $(0,1) \times(0,1)$ plane, i'm wondering how can i get all the boundary points smartly, without actually generate all the points and then use convex hull algorithm to capture that.

1

There are 1 best solutions below

14
On BEST ANSWER

Here is what I meant by my comment:

Perhaps: Sort the vectors angularly about the origin, then add them together in counterclockwise order.

No doubt I am misinterpreting what you are seeking. If so, try to clarify.


          Vecs       Sum
          Left: Vectors in 1st quadrant.    Right: Vector sum in ccw angular order.
Added after @achillehui clarified the OP's intent:
          VecsBoth
          Ccw lower path, cw upper path.


Added 16Sep2019. Two remarks.

(1) Because of the commutativity of vector addition, the total sum of the vectors is the same regardless of in which order they are added. See the figure below (based on a different set of $10$ vectors).

(2) Suppose a prefix of the lower envelope is formed by the first $k$ vectors ccw. If you next add any vector different from the $(k+1)$-st vector ccw, then you will penetrate into the interior of the lower hull, left of what would be obtained by adding the $(k+1)$-st vector ccw. This is nearly a proof by induction.


          RandPaths
          Several random permutation sums (green): Always sum to same point.