Optimization over linear combinition of min functions Assume we are given these six variables: $x_{12},x_{21},x_{13},x_{31},x_{23},x_{32}$. Then if,
$A_{ij} = min\{x_{ij},x_{ji} \}, B_{ik} = min\{x_{ik} - A_{ij}, x_{ki} \}, C_{jk} = min\{x_{jk} - A_{ij},x_{kj} - B_{ik} \}$. We want to choose $i,j,k \in \{1,2,3\}$ to maximize $A_{ij} + B_{ik} + C_{jk}$. 
Given the numerical value of $x_{12},x_{21},x_{13},x_{31},x_{23},x_{32}$, we can check all 6 possible assignments of $(i,j,k)$ (which are (1,2,3),(1,3,2),(2,1,3),(2,3,1),(3,1,2),(3,2,1)) to see which one maximizes $A + B + C$. But, I want to know what we can say if $x_{12},x_{21},x_{13},x_{31},x_{23},x_{32}$ are parameters. My guess is that we should minimize $A_{ij}$ and $B_{ik}$ because $A_{ij}$ appears in $B_{ik}$ and $C_{jk}$ with negative sign and $B_{ik}$ appears in $C_{jk}$ with negative sign. Any idea/suggestion?
 A: My interpretation here is that you want to optimize over indexing in variables. This requires, as far as I can see, mixed-integer programming, and some pretty nasty constructs. Essentially, you have to introduce logic models of the type "if i=1 and j=1 then xij=x(1,1)". Hence, you introduce 3 binaries for $i$, three binaries for $j$ and three binaries for $k$, and then start combining the cases, doing the implications using big-M models for instance.
Here is a test implementation in the MATLAB modelling language YALMIP (disclaimer, developed by me). The MILP that arises is solved in 0s using any efficient MILP solver, such as Gurobi, Mosek, CPLEX, ...
% Let x be a variable (we'll fix later for special case)
n = 3;
x = sdpvar(n,n,'full');

% Let YALMIP do the variable index modelling, i.e.., MILP models
% for indexing and min will be setup automatically behind the scene
intvar i j k
Aij = min(x(i,j),x(j,i));
Bik = min(x(i,k) - Aij,x(k,i));
Cjk = min(x(j,k) - Aij,x(k,j)-Bik);

% Solve special case x actually is constant with this value
X = randn(n);
Model = [1 <= [i j k] <= n, alldifferent([i j k]), X==x];
optimize(Model,-(Aij+Bik+Cjk))
value([i j k])

% Some other case where x is unknown but constrained
Model = [1 <= [i j k] <= n, alldifferent([i j k]), magic(3)>=x>=0];
optimize(Model,-(Aij+Bik+Cjk))
value([i j k])
value(x)

A: You can solve this with linear programming, as the problem is equivalent to
$$
\mbox{Maximize }\quad Z= a+b+c
$$
subject to
\begin{align}
a&\le x_{ij}\quad & \forall i,j\\
a&\le x_{ji}\quad & \forall i,j\\
b &\le x_{ik}-a\quad & \forall i,k\\
b &\le x_{ki}\quad & \forall i,k\\
c &\le x_{jk}-a\quad & \forall k,j\\
c &\le x_{kj}-b\quad & \forall k,j
\end{align}
