Linearize objective function for intlinprog

148 Views Asked by At

This is the predecessor to the following question:

I have some constraints based on which I have written a Matlab program that provides me some feasible binary bits for Finite state machines(FSM). However, there is no objective function.

My objective function should be to minimize the Hamming distance (HD) between all of the transitions between the obtained binary bits.

It should be Minimize $\sum_{1 \leq i < j \leq k} p_{i,j}\sum_{l=1}^{n} |x_{il} - x_{jl}|$ , $i\neq j $

$\sum_{l=1}^{n} |x_{il} - x_{jl}|$ is the HD between the binary bits that I would like to minimize and then sum all of them, considering each transition. Notations- $n$ binary bits, $p_{i,j}$ is some value I would like to multiply with each of the HD, $k$ state FSM.

How do I linearize this?

1

There are 1 best solutions below

1
On

Every time you have an objective of the form $$\mathrm{minimize} \sum_i p_i|u_i|$$ where $u_i$ are some variables or linear expressions of other variables, and $p_i$ are nonnegative constants, you can linearize it as $$\begin{array}{rl} \mathrm{minimize} & \sum_i p_it_i\\ \mathrm{subject\ to}& t_i\geq u_i, \\ & t_i\geq -u_i, \end{array}$$ where $t_i$ are additional auxiliary variables you introduce.