Messed-up late night thoughts
Feb. 9th, 2005 12:15 pm![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
I had trouble sleeping last night, because my mind drifted off to a problem, which I record below. I make no guarantees with respect to coherence :)
Say that you have a set of tuples (p, u, v), where p is a point on the x-y plane, u and v are positive integers, and u > v. One of the tuples is the origin tuple, (p0, u0, v0), and no two tuples share the same point.
A run is a nonrepeating sequence of n such tuples (pi, ui, vi), starting with the origin tuple, where any sum u0 + v1 + v2 ... + vi is at least ui+1.
Let's say the length of the run is the sum of all the distances between adjacent pi and pi+1 points in the sequence, and the size of the run is the sum u0 + v1 + v2 ... + vn.
Now I want to do one of the following things:
In-between tuple restrictions:
Then my head went "BA-NA-NA" and I decided I should forget about this and go to bed. Maybe I'm mad.
Say that you have a set of tuples (p, u, v), where p is a point on the x-y plane, u and v are positive integers, and u > v. One of the tuples is the origin tuple, (p0, u0, v0), and no two tuples share the same point.
A run is a nonrepeating sequence of n such tuples (pi, ui, vi), starting with the origin tuple, where any sum u0 + v1 + v2 ... + vi is at least ui+1.
Let's say the length of the run is the sum of all the distances between adjacent pi and pi+1 points in the sequence, and the size of the run is the sum u0 + v1 + v2 ... + vn.
Now I want to do one of the following things:
- Find a run with maximum size that is no more than a certain length
- Find a run with minimum length that has at least a certain size
- Say that there's a certain subset of tuples; find a run that is no more than a certain length, but contains the maximum number of tuples in said subset
In-between tuple restrictions:
- Impose the restriction that in a run, a point pj cannot be collinear and between two points later in the run, pi and pi+1
- Impose another restriction that the third point cannot be m distance away from the line segment between pi and pi+1, where m is some multiple of the cube root of the length of the run up to the tuple with point pi.
- For each three adjacent tuples, add to the length some penalty amount proportional to the smaller angle created by the rays (pi, pi+1) and (pi+1 , pi+2)
- Or make the penalty proprotional to the absolute value of the sine of the angle, plus a little extra if the angle is greater than pi/2
Then my head went "BA-NA-NA" and I decided I should forget about this and go to bed. Maybe I'm mad.
no subject
Date: 2005-02-09 07:11 pm (UTC)I'll see if I can implement the versions without any restrictions and make it understandable, to boot. Or you can find me in person sometime.
no subject
Date: 2005-02-09 09:23 pm (UTC)I know dynamic programming is pretty standard for this kind of problem if I were to be optimizing one quantity--but given the various other constraints (e.g. must no more than a certain length, and lengths don't have to be integral here), would it still work? Have to remember my 6.046 now....
no subject
Date: 2005-02-09 10:04 pm (UTC)no subject
Date: 2005-02-09 09:17 pm (UTC)no subject
Date: 2005-02-10 04:33 pm (UTC)no subject
Date: 2005-02-10 08:45 pm (UTC)