# Linearization of a penalty type function with absolute values in objective function

 4 About linearization: your (a_{ij}) and (x_{ij}) can take values 0 or 1 so can formulate the absolute value as: [sum_{ij, a_{ij} = 1} (1 - x_{ij}) + sum_{ij, a_{ij} = 0} x_{ij}] answered 10 May '12, 05:37 Emilie 246●1●2 accept rate: 14% fbahr ♦ 4.6k●7●16 I ended up using a formulation which is easier to code in Excel, but is the same formulation as the answer above. It is to use this: (-p cdot sum_{ij} a_{ij} cdot (1-x_{ij}) + sum_{ij} (1-a_{ij}) cdot x_{ij}), instead of the above, or what I originally mentioned: (-p cdot sum_i sum_j |x_{ij}-a_{ij}|). Works like a charm. Thanks. (22 May '12, 16:33) Samik R. I thought TeX worked in comments too. Doesn't it? (22 May '12, 16:39) Samik R. @Samik: Using * for multiplication may cause troubles (in Markdown, asterisks around a word mean emphasis); use \cdot or \times instead. (23 May '12, 04:37) fbahr ♦ Thanks @fbahr. (23 May '12, 11:29) Samik R.
 2 If I understand your problem properly, it seems that you would want to create decision variables (x) with 3 indices: i = patient number, j = current physician, k = next assigned physician Then your objective function would contain non-zero penalty coefficients for x(i,j,k) where j<>k. There is no double counting and no absolute value processing is required. Note that you could cap the number of patient transfers as a hard constraint: SUM(x(i,j,k)) <= Upper Bound, where j<>k Moreover, if you have other objectives in the objective function, well you obviously need a way of relatively rationalizing the penalty values across the objective types. The AHP is one way to do that, or you could make all but one of the objectives constraints or consider Goal Programming. answered 11 May '12, 06:45 Steve Mack 81●1●4 accept rate: 0% @Steve Mack: Thanks for the response. This modeling also seems correct, but I ended up using the other answer since that requires the same number of variables. (22 May '12, 16:40) Samik R.
 toggle preview community wiki

By Email:

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• image?![alt text](/path/img.jpg "Title")
• numbered list: 1. Foo 2. Bar
• to add a line break simply add two spaces to where you would like the new line to be.
• basic HTML tags are also supported

Tags: