\chapter{Conclusion and Future Research}\label{chapter6}

In this final chapter, we summarize the contribution of our thesis and also list potential areas for future research that we identified.

\section{Conclusion}

In this thesis, we have overviewed the binary max-sum problem and the related theory, namely Schlesinger's upper bound and its connection to arc consistency. Then, we presented a novel algorithm for convex piecewise-affine function minimization, which is based on the notion of local consistency and works with functions that are given as SMAF or MAF. This algorithm is a generalization of the Augmenting DAG algorithm. We proved the correctness of the algorithm along with the calculation of its asymptotic space complexity and the asymptotic time complexity of one iteration. We also presented its finite-precision version that we implemented in C++ and formulated theorems that in some cases allow to determine the optimality of the given solution.

We tested the algorithm on instances that correspond to Schlesinger's upper bound of a binary max-sum problem, where the max-sum problem was based on two-dimensional grammars and searching the closest image generated by a given grammar. The relaxation that is used by the algorithm showed to be suitable for such problems because it often reached the true optimum. Moreover, our algorithm had significantly shorter runtime on all the instances when compared to an optimal LP solver. On the generated instances, we also tried re-optimizing the solution after a small change in the input instance was done, which could become useful in ill-conditioned or ambiguous problems. 

Finally, we also discussed the convergence speed and justified a general parameter initialization that experimentally showed to work suitably for all of the tested instances. It is therefore not necessary for the user of our algorithm to set any parameters or tune them to optimize the result.

\section{Future Research}

During the exploration of the field of local consistency and convex piecewise-affine minimization, we have encountered a number of open questions that might be resolved in the future.

\subsubsection{Decrease of Space Complexity}

First of all, it might be possible to decrease the space complexity of the algorithm by removal of some additional structures that we currently use but maybe only in the sense of actual space complexity, not asymptotic space complexity. For example, get rid of either the $N(x_k)$ or $N(f_{i,j})$ sets, which take up significant amount of memory. Then, the algorithm might be even more useful for larger instances.

\subsubsection{Oracles}

Talking about space complexity, in case of the shown instances, it is not necessary to store the whole upper bound function as a SMAF explicitly, but only implicitly using the structure of the problem and the data (i.e. the input image). For example, we could have an oracle that would create a numbering of clusters and a numbering of the subfunctions in them that would not be explicitly stored but only calculated from the size of the input image. Next, to find out the coefficients of the vectors $\mathbf{a}$, it could also be calculated on-demand by the oracle and not explicitly stored. This would be an approach that would reduce the space complexity significantly.

\subsubsection{Generalizing the Notion of $\epsilon$-active Subfunctions}

Similarly as we defined the notion of $\epsilon$-active subfunctions in Section \ref{eps_consistency_section_intro}, we could go further in the generalization. We might not use a single global value of $\epsilon$, but introduce these values for each cluster, i.e. have $\epsilon_i$ for each $i \in [l]$. The definition of the active subfunction would then also depend on its cluster's $\epsilon_i$. But, we would also have to design a way of treating the multiple values. And if there were issues with non-existence of the locally consistent point with respect to the vector $\bm{\epsilon}$, we would have to design an (at least partial) ordering on the $\bm{\epsilon}$ vectors that would decide which are better in the same sense as we searched for the smallest value in Section~\ref{consistency_zero_step_size_section}.

We could go even further and define an $\epsilon_{i,j}$ value for each individual subfunction. This would basically allow us to mark almost\footnote{Under the assumption that $\epsilon_{i,j} \geq 0$, the actual maxima in each cluster would be always active. On the other hand, if we allowed $\epsilon_{i,j} \in \mathbb{R}$, then the sets could be completely arbitrary.} an arbitrary set of subfunctions as active. It might help us to deal with the issue of zero step size, where we could alter the set of active subfunctions and obtain another decreasing direction, in which a non-zero step size would be possible. We could e.g. increase the $\epsilon_{i,j}$ of the subfunction that caused the step size to be zero, so it would become active. However, we would still need to design a complete strategy of treating the $\bm{\epsilon}$ values.

\subsubsection{General Convex Subfunctions}

In this thesis, we dealt only with the convex piecewise-affine functions, but we could consider a generalized setting with the minimized function in the form
\begin{equation}\label{sum_of_maxima_of_differentiable}
f(\mathbf{x}) = \sum\limits_{i = 1}^{l} \max\limits_{j = 1}^{m_i}f_{i,j}(\mathbf{x}),
\end{equation}
where the subfunctions $f_{i,j}$ are any convex differentiable functions. Then, we believe that we could almost completely re-use the ideas of both the local consistency algorithm and the algorithm that calculates the decreasing direction and minimize the function $f$. But, we would have to replace the values $\mathbf{a}_{i,j}$ with the gradient of $f_{i,j}$ at the point $\mathbf{x}$ and also design an efficient method of line search.


\subsubsection{Two-label Problems}

It was shown in \cite{kolmogorov2005primal} and reviewed in \cite{research_report} that for binary max-sum problems with 2 labels, it holds that a non-empty AC closure is equivalent to having minimum upper bound. Therefore, it may also be generalized in some sense to the convex piecewise-affine minimization that would provide a guarantee on optimality for a subclass of convex piecewise-affine functions.

\subsubsection{Branch and Bound}

\cite{NguyenGSB14} showed that a type of local consistency can be used to maintain a weighted CSP arc consistent during the search of its state space. Similarly, our algorithm could also be used in such setting, for example in a branch and bound algorithm to provide an upper bound on the quality of the solution. Alternatively, it could also be used in branch and cut methods.

\subsubsection{Persistency}

\cite{shekhovtsov-17-persistency} claims that in the case of a binary max-sum problem, it is possible to find a part of an optimal solution even in polynomial time and also determine which labels will never be in any optimal solution. It remains as an open question for future research whether this notion could be generalized for SMAF minimization.

\subsubsection{Other Problems}

Last but not least, it is important to test the developed algorithm on other instances than  the ones arising from max-sum problems. However, due to the large extent of the thesis, we consider this out of its scope and leave it for future work.

Viewing the minimization of the upper bound as a minimization of a convex piecewise-affine function is beneficial because it is a more general problem that could also be applied in other cases, where such function arises. Additionally, we can also view the transformation from the upper bound minimization to the function as an intermediate layer, which provides a simpler interface when compared to accessing all the values of the binary max-sum problem.
