Minimizing Sum of Absolute Values

Click For Summary
SUMMARY

The forum discussion centers on efficiently minimizing the function f(x) = |1-x| + |0.5-2x|, which may include additional absolute value terms. Participants suggest using piecewise defined functions and critical points to identify minima. A graphical approach reveals that the minimum occurs at the critical point where the last absolute value equals zero, specifically at x = 0.25 for the given example. The discussion emphasizes that for multiple absolute values, the minimum can be found at the smallest critical point or by evaluating the function at various critical points.

PREREQUISITES
  • Understanding of piecewise functions and their properties
  • Familiarity with absolute value functions and their graphical representations
  • Knowledge of critical points and optimization techniques
  • Basic calculus, specifically derivatives and their applications
NEXT STEPS
  • Learn about convex optimization techniques for minimizing piecewise linear functions
  • Explore methods for finding critical points in piecewise functions
  • Study the graphical representation of absolute value functions to visualize minima
  • Investigate numerical methods for optimization in multi-variable functions
USEFUL FOR

Mathematicians, computer programmers, and data scientists interested in optimization problems involving absolute values and piecewise functions.

  • #31
Aero51 said:
Would it be possible to find the minimum by squaring the function inside the absolute value signs then carrying out the necessary steps to find a minnima/maxima? I think this should work for any polynomial, not sure about other functions though.

The solution obtained using this method will not be the same as that in the original formulation, though it may possibly be close.
 
Physics news on Phys.org
  • #32
adoado said:
I recently encountered another problem, but it extends this topic. Instead of opening a new thread I guess this place is as good as any..

If one defines the function E=|1-x-y| + |4-2x-y| ... how can I find it's minimum now (x and y coordinates)? Can this be extended to N variables inside each absolute value? Each absolute value will be linear... I am not sure if the above answer can be generalized to suit this problem?

Any ideas? :confused:

Cheers,
Adrian
If you have access to a linear programming package, problems of this type can be solved by linear programming. In the above problem, we would reformulate the problem as follows:

minimize a + b + c + d
subject to
a - b = 1 - x - y
c - d = 4 - 2x - y
a, b, c, d >= 0

The trick is that if 1 - x - y \ge 0, then a = 1 - x - y and b = 0; otherwise a = 0 and b = - (1 - x - y). So a + b = |1 - x - y| in all cases.
You might think that other solutions are possible-- for example, if 1 - x - y = 2, then a = 3 and b = 1 seems to be an alternative solution that would mess things up. But this will never happen if you are using the Simplex Algorithm, because it is guaranteed to always find a solution at a vertex of the feasible polyhedron. At least one of a and b will always be zero.
 
Last edited:
  • #33
The solution obtained using this method will not be the same as that in the original formulation, though it may possibly be close.

Why? If you square the function and find the zeros, these points should correspond to where a derivative does not exist in the original function. Take a-x, for example, if you calculate the 0 point of (a-x)^2 you get a double root at x=a, consistent with the original formula. Squaring any higher order polynomial inside the absolute value function will still have roots at the location where the original function has no derivative. You can use this information to more quickly find the max/min of an absolute value function.
 
  • #34
Aero51 said:
Why? If you square the function and find the zeros, these points should correspond to where a derivative does not exist in the original function. Take a-x, for example, if you calculate the 0 point of (a-x)^2 you get a double root at x=a, consistent with the original formula. Squaring any higher order polynomial inside the absolute value function will still have roots at the location where the original function has no derivative. You can use this information to more quickly find the max/min of an absolute value function.

This method works if f(x) comprises of a single absolute term. If there are two or more terms, i.e. f(x,y) = |2x-y+3|+|x+3y+1| + |x-y+6|, the optimal solution which minimizes f is not the same as g(x,y) = (2x-y+3)^2+(x+3y+1)^2 +(x-y+6)^2, simply because there is no way to transform the second equation to the first.
 

Similar threads

  • · Replies 22 ·
Replies
22
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
Replies
6
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 6 ·
Replies
6
Views
5K
  • · Replies 11 ·
Replies
11
Views
3K