D IFFERENTIATION OF B LACKBOX C OMBINATORIAL S OLVERS
A BSTRACT
Achieving fusion of deep learning with combinatorial algorithms promises transformative changes to artiﬁcial intelligence.
One possible approach is to introduce combinatorial building blocks into neural networks.
Such end-to-end architectures have the potential to tackle combinatorial problems on raw input data such as ensuring global consistency in multi-object tracking or route planning on maps in robotics.
In this work, we present a method that implements an efﬁcient backward pass through blackbox implementations of combinatorial solvers with linear objective functions.
We provide both theoretical and experimental backing.
In particular, we incorporate the Gurobi MIP solver, Blossom V algorithm, and Dijkstra’s algorithm into architectures that extract suitable features from raw inputs for the traveling salesman problem, the min-cost perfect matching problem and the shortest path problem. The code is available at https://github.com/martius-lab/blackbox-backprop.
I NTRODUCTION
The toolbox of popular methods in computer science currently sees a split into two major components.
On the one hand, there are classical algorithmic techniques from discrete optimization – graph algorithms, SAT-solvers, integer programming solvers – often with heavily optimized implementations and theoretical guarantees on runtime and performance.
On the other hand, there is the realm of deep learning allowing data-driven feature extraction as well as the ﬂexible design of end-to-end architectures.
The fusion of deep learning with combinatorial optimization is desirable both for foundational reasons – extending the reach of deep learning to data with large combinatorial complexity – and in practical applications.
These often occur for example in computer vision problems that require solving a combinatorial sub-task on top of features extracted from raw input such as establishing global consistency in multi-object tracking from a sequence of frames.
The fundamental problem with constructing hybrid architectures is differentiability of the combinatorial components.
State-of-the-art approaches pursue the following paradigm: introduce suitable approximations or modiﬁcations of the objective function or of a baseline algorithm that eventually yield a differentiable computation.
The resulting algorithms are often sub-optimal in terms of runtime, performance and optimality guarantees when compared to their unmodiﬁed counterparts.
While the sources of sub-optimality vary from example to example, there is a common theme: any differentiable algorithm in particular outputs continuous values and as such it solves a relaxation of the original problem.
It is well-known in combinatorial optimization theory that even strong and practical convex relaxations induce lower bounds on the approximation ratio for large classes of problems (Raghavendra, 2008; Thapper & ˇ Zivn´y, 2017) which makes them inherently sub-optimal.
This inability to incorporate the best implementations of the best algorithms is unsatisfactory.
In this paper, we propose a method that, at the cost of one hyperparameter, implements a backward pass for a blackbox implementation of a combinatorial algorithm or a solver that optimizes a linear [Figure] objective function.
This effectively turns the algorithm or solver into a composable building block of neural network architectures, as illustrated in Fig.
Suitable problems with linear objective include classical problems such as SHORTEST - PATH , TRAVELING - SALESMAN (TSP), MIN - COSTPERFECT - MATCHING , various cut problems as well as entire frameworks such as integer programs (IP), Markov random ﬁelds (MRF) and conditional random ﬁelds (CRF).
The main technical challenge boils down to providing an informative gradient of a piecewise constant function.
To that end, we are able to heavily leverage the minimization structure of the underlying combinatorial problem and efﬁciently compute a gradient of a continuous interpolation.
While the roots of the method lie in loss-augmented inference, the employed mathematical technique for continuous interpolation is novel.
The computational cost of the introduced backward pass matches the cost of the forward pass .
In particular, it also amounts to one call to the solver.
In experiments, we train architectures that contain unmodiﬁed implementations of the following efﬁcient combinatorial algorithms: general-purpose mixed-integer programming solver
Gurobi (Gurobi Optimization, 2019), state-of-the-art C implementation of MIN - COST - PERFECTMATCHING algorithm – Blossom V (Kolmogorov, 2009) and Dijkstra’s algorithm (Dijkstra, 1959) for SHORTEST - PATH .
We demonstrate that the resulting architectures train without sophisticated tweaks and are able to solve tasks that are beyond the capabilities of conventional neural networks.
R ELATED W ORK
Multiple lines of work lie at the intersection of combinatorial algorithms and deep learning.
We primarily distinguish them by their motivation.
Motivated by applied problems.
Even though computer vision has seen a substantial shift from combinatorial methods to deep learning, some problems still have a strong combinatorial aspect and require hybrid approaches.
Examples include multi-object tracking (Schulter et al., 2017), semantic segmentation (Chen et al., 2018), multi-person pose estimation (Pishchulin et al., 2016; Song et al., 2018), stereo matching (Kn¨obelreiter et al., 2017) and person re-identiﬁcation
(Ye et al., 2017).
The combinatorial algorithms in question are typically Markov random ﬁelds (MRF)
(Chen et al., 2015), conditional random ﬁelds (CRF) (Marin et al., 2019), graph matching (Ye et al., 2017) or integer programming (Schulter et al., 2017).
In recent years, a plethora of hybrid end-to-end architectures have been proposed.
The techniques used for constructing the backward pass range from employing various relaxations and approximations of the combinatorial problem (Chen et al., 2015; Zheng et al., 2015) over differentiating a ﬁxed number of iterations of an iterative solver (Paschalidou et al., 2018; Tompson et al., 2014; Liu et al., 2015) all the way to relying on the structured SVM framework (Tsochantaridis et al., 2005; Chen et al., 2015).
Motivated by “bridging the gap”.
Building links between combinatorics and deep learning can also be viewed as a foundational problem; for example, (Battaglia et al., 2018) advocate that “combinatorial generalization must be a top priority for AI”.
One such line of work focuses on designing architectures with algorithmic structural prior – for example by mimicking the layout of a Turing machine (Sukhbaatar et al., 2015;
Vinyals et al., 2015; Graves et al., 2014; 2016) or by promoting behaviour that resembles message-passing algorithms as it is the case in Graph Neural Networks and related architectures (Scarselli et al., 2009; Li et al., 2016; Battaglia et al., 2018).
Another approach is to provide neural network building blocks that are specialized to solve some types of combinatorial problems such as satisﬁability (SAT) instances (Wang et al., 2019), mixed integer programs (Ferber et al., 2019), sparse inference (Niculae et al., 2018), or submodular maximization (Tschiatschek et al., 2018).
A related mindset of learning inputs to an optimization problem gave rise to the “predict-and-optimize” framework and its variants (Elmachtoub & Grigas, 2017; Demirovic et al., 2019; Mandi et al., 2019).
Some works have directly addressed the question of learning combinatorial optimization algorithms such as the TRAVELING - SALESMAN - PROBLEM in (Bello et al., 2017) or its vehicle routing variants (Nazari et al., 2018).
A recent approach also learns combinatorial algorithms via a clustering proxy (Wilder et al., 2019).
There are also efforts to bridge the gap in the opposite direction; to use deep learning methods to improve state-of-the-art combinatorial solvers, typically by learning (otherwise hand-crafted) heuristics.
Some works have again targeted the TRAVELING - SALESMAN - PROBLEM (Kool et al., 2019;
Deudon et al., 2018; Bello et al., 2017) as well as other NP-Hard problems (Li et al., 2018).
Also, more general solvers received some attention; this includes SAT-solvers (Selsam & Bjørner, 2019;
Selsam et al., 2019), integer programming solvers (often with learning branch-and-bound rules) (Khalil et al., 2016; Balcan et al., 2018; Gasse et al., 2019) and SMT-solvers (satisﬁability modulo theories)(Balunovic et al., 2018).
M ETHOD
Let us ﬁrst formalize the notion of a combinatorial solver.
We expect the solver to receive continuous input w ∈ W ⊆ R N (e.g. edge weights of a ﬁxed graph) and return discrete output y from some ﬁnite set Y (e.g. all traveling salesman tours on a ﬁxed graph) that minimizes some cost c ( w, y )
(e.g. length of the tour).
More precisely, the solver maps
[Equation]
that [Equation] We will restrict ourselves to objective functions c ( w, y ) that are linear , namely c ( w, y ) may be represented as
[Equation]
in which φ : Y → R N is an injective representation of y ∈ Y in R N .
For brevity, we omit the mapping φ and instead treat elements of Y as discrete points in R N .
Note that such deﬁnition of a solver is still very general as there are no assumptions on the set of constraints or on the structure of the output space Y .
Example 1 (Encoding shortest-path problem) .
If G =
( V, E ) is a given graph with vertices s, t ∈ V , the combinatorial solver for the ( s, t ) - SHORTEST - PATH would take edge weights w ∈ W = R | E | as input and produce the shortest path y ( w ) represented as φ ( y ) ⊆ { 0 , 1 } | E | an indicator vector of the selected edges.
The cost function is then indeed the inner product c ( w, y )
=
w · φ ( y ) .
The task to solve during back-propagation is the following.
We receive the gradient d L/ d y of the global loss L with respect to solver output y at a given point ˆ y =
y ( ˆ w ) .
We are expected to return d L/ d w , the gradient of the loss with respect to solver input w at a point ˆ w .
Since Y is ﬁnite, there are only ﬁnitely many values of y ( w ) .
In other words, this function of w is piecewise constant and the gradient is identically zero or does not exist (at points of jumps).
This should not come as a surprise; if one does a small perturbation to edge weights of a graph, one usually does not change the optimal TSP tour and on rare occasions alters it drastically.
This has an important consequence:
The fundamental problem with differentiating through combinatorial solvers is not the lack of differentiability; the gradient exists almost everywhere .
However, this gradient is a constant zero and as such is unhelpful for optimization.
Accordingly, we will not rely on standard techniques for gradient estimation (see (Mohamed et al., 2019) for a comprehensive survey). [Figure]
First, we simplify the situation by considering the linearization f of L at the point ˆ y .
Then for
[Equation]
[Equation]
we have
[Equation]
and therefore it sufﬁces to focus on differentiating the piecewise constant function f (cid:0) y ( w ) (cid:1) .
If the piecewise constant function at hand was arbitrary, we would be forced to use zero-order gradient estimation techniques such as computing ﬁnite differences.
These require prohibitively many function evaluations particularly for high-dimensional problems.
However, the function f (cid:0) y ( w ) (cid:1) is a result of a minimization process and it is known that for smooth spaces Y there are techniques for such “differentiation through argmin” (Schmidt & Roth, 2014;
Samuel & Tappen, 2009; Foo et al., 2008; Domke, 2012; Amos et al., 2017; Amos & Kolter, 2017).
It turns out to be possible to build – with different mathematical tools – a viable discrete analogy.
In particular, we can efﬁciently construct a function f λ ( w ) , a continuous interpolation of f (cid:0) y ( w ) (cid:1) , whose gradient we return (see Fig. 2).
The hyper-parameter λ > 0 controls the trade-off between “informativeness of the gradient” and “faithfulness to the original function”.
Before diving into the formalization, we present the ﬁnal algorithm as listed in Algo.
It is simple to implement and the backward pass indeed only runs the solver once on modiﬁed input.
Providing the justiﬁcation, however, is not straightforward, and it is the subject of the rest of the section.
Algorithm and function F ORWARD P ASS ( ˆ w ) ˆ y :=
Solver ( ˆ w ) //
ˆ y
=
y
( ˆ w ) save ˆ w and ˆ y for backward pass return ˆ y function B ACKWARD P ASS ( d L d y (ˆ y ) , λ ) load ˆ w
and ˆ y from forward pass w (cid:48) :
= ˆ w + λ · d L d y (ˆ y ) //
Calculate perturbed weights y λ :=
Solver ( w (cid:48) ) return ∇ w f λ ( ˆ w ) :
= − 1 λ (cid:2)
ˆ y − y λ (cid:3) //
Gradient of continuous interpolation
3. C ONSTRUCTION AND P ROPERTIES OF f λ
Before we give the exact deﬁnition of the function f λ , we formulate several requirements on it.
This will help us understand why f λ ( w ) is a reasonable replacement for f (cid:0) y ( w ) (cid:1) and, most importantly, why its gradient captures changes in the values of f .
Property A1.
For each λ > 0 , f λ is continuous and piecewise afﬁne.
The second property describes the trade-off induced by changing the value of λ .
For λ > 0 , we deﬁne sets W λ eq and W λ dif as the sets where f (cid:0) y ( w ) (cid:1) and f λ ( w ) coincide and where they differ, i.e. [Equation] and
[Equation]
Property A2.
The sets W λ dif are monotone in λ
and they vanish as λ → 0 + , i.e.
[Equation]
and W λ dif → ∅ as λ → 0 + .
In other words, Property A2 tells us that λ controls the size of the set where f λ deviates from f and where f λ has meaningful gradient.
This behaviour of f λ can be seen in Fig.
In the third and ﬁnal property, we want to capture the interpolation behavior of f λ .
For that purpose, we deﬁne a δ -interpolator of f .
We say that g , deﬁned on a set G ⊂ W , is a δ -interpolator of f between y 1 and y 2 ∈ Y , if
• g is non-constant afﬁne function; • the image g ( G ) is an interval with endpoints f ( y 1 ) and f ( y 2 ) ; • g attains the boundary values f ( y 1 ) and f ( y 2 ) at most δ -far away from where f ( y ( w )) does.
In particular, there is a point w k ∈ G for which g ( w k ) =
f ( y k ) and dist( w k , P k ) ≤ δ , where P k = { w ∈ W : y w ) =
y k } for k
=
In the special case of a 0-interpolator g , the graph of g connects (in a topological sense) two components of the graph of f (cid:0) y ( w ) (cid:1) .
In the general case, δ measures displacement of the interpolator (see also Fig.
2 for some examples).
This displacement on the one hand loosens the connection to f (cid:0) y
( w ) (cid:1)
but on the other hand allows for less local interpolation which might be desirable.
Property A3.
The function f λ consists of ﬁnitely many (possibly incomplete)
δ -interpolators of f on W λ dif where δ ≤ Cλ for some ﬁxed C .
Equivalently, the displacement is linearly controlled by λ .
Intuitively, the consequence of Property A3 is that f λ has reasonable gradients everywhere since it consists of elementary afﬁne interpolators.
For deﬁning the function f λ , we need a solution of a perturbed optimization problem
[Equation]
Theorem 1.
Let λ > 0 .
The function f λ deﬁned by
[Equation]
(4) satisﬁes Properties A1, A2, A3.
Let us remark that already the continuity of f λ is not apparent from its deﬁnition as the ﬁrst term f (cid:0) y λ ( w ) (cid:1) is still a piecewise constant function.
Proof of this result, along with geometrical description of f λ , can be found in section A.2.
Fig.
3 visualizes f λ for different values if λ .
Now, since f λ is ensured to be differentiable, we have
[Equation]
The second equality then holds due to (2).
We then return ∇ f λ as a loss gradient.
Remark 1.
The roots of the method we propose lie in loss-augmented inference.
In fact, the update rule from (5) (but not the function f λ or any of its properties) was already proposed in a different context in (Hazan et al., 2010; Song et al., 2016) and was later used in (Lorberbom et al., 2018;
Mohapatra et al., 2018).
The main difference to our work is that only the case of λ → 0 + is recommended and studied, which in our situation computes the correct but uninformative zero gradient.
Our analysis implies that larger values of λ are not only sound but even preferable .
This will be seen in experiments where we use values λ ≈ 10 − 20 .
3. E FFICIENT C OMPUTATION OF f λ
Computing y λ in (3) is the only potentially expensive part of evaluating (5).
However, the linear interplay of the cost function and the gradient trivially gives a resolution.
Proposition 1.
Let ˆ w ∈ W be ﬁxed.
If we set w (cid:48)
=
ˆ w + λ d L d y (ˆ y ) , we can compute y λ as
[Equation]
In other words, y λ is the output of calling the solver on input w
E XPERIMENTS
In this section, we experimentally validate a proof of concept : that architectures containing exact blackbox solvers (with backward pass provided by Algo. 1) can be trained by standard methods. [Table]
To that end, we solve three synthetic tasks as listed in Tab. 1.
These tasks are designed to mimic practical examples from Section 2 and solving them anticipates a two-stage process: 1) extract suitable features from raw input, 2) solve a combinatorial problem over the features.
The dimensionalities of input and of intermediate representations also aim to mirror practical problems and are chosen to be prohibitively large for zero-order gradient estimation methods.
Guidelines of setting the hyperparameter λ are given in section A.1.
We include the performance of [-ResNet
 He-]ResNet18 (He et al., 2016) as a sanity check to demonstrate that the constructed datasets are too complex for standard architectures.
Remark 2.
The included solvers have very efﬁcient implementations and do not severely impact runtime.
All models train in under two hours on a single machine with 1 GPU and no more thanutilized CPU cores.
Only for the large TSP problems the solver’s runtime dominates.
4. W ARCRAFT S HORTEST P ATH
Problem input and output.
The training dataset for problem SP ( k ) consists of 10000 examples of randomly generated images of terrain maps from the Warcraft II tileset (Guyomarch, 2017).
The maps have an underlying grid of dimension k × k where each vertex represents a terrain with a ﬁxed cost that is unknown to the network.
The shortest (minimum cost) path between top left and bottom right vertices is encoded as an indicator matrix and serves as a label (see also Fig. 4).
We consider datasets SP ( k ) for k ∈ { 12 , 18 , 24 , 30 } .
More experimental details are provided in section A.3.
[Figure]
Architecture.
An image of the terrain map is presented to a convolutional neural network which outputs a k × k grid of vertex costs.
These costs are then the input to the Dijkstra algorithm to compute the predicted shortest path for the respective map.
The loss used for computing the gradient update is the Hamming distance between the true shortest path and the predicted shortest path.
[Table]
Results.
Our method learns to predict the shortest paths with high accuracy and generalization capability, whereas the ResNet18 baseline unsurprisingly fails to generalize already for small grid sizes of k = 12 .
Since the shortest paths in the maps are often nonunique (i.e. there are multiple shortest paths with the same cost), we report the percentage of shortest path predictions that have optimal cost.
The results are summarized in Tab. 2.
4. G LOBE T RAVELING S ALESMAN P ROBLEM
Problem input and output.
The training dataset for problem TSP ( k ) consists of 10000 examples where the input for each example is a k -element subset of ﬁxed 100 country ﬂags and the label is the shortest traveling salesman tour through the capitals of the corresponding countries.
The optimal tour is represented by its adjacency matrix (see also Fig. 5).
We consider datasets TSP ( k ) for k ∈ { 5 , 10 , 20 , 40 } . I npu t [Figure] [Equation]
[Figure]
  −→
Label   [Figure] [Equation] [Figure]
[Equation]
[Figure]
[Equation]
[Figure]
[Equation]
 
[Figure]
with optimal TSP
[Figure]
Architecture.
Each of the k ﬂags is presented to a convolutional network that produces k threedimensional vectors.
These vectors are projected onto the unit sphere in R 3 ; a representation of the globe.
The TSP solver receives a matrix of pairwise distances of the k computed locations.
The loss of the network is the Hamming distance between the true and the predicted TSP adjacency matrix.
The architecture is expected to learn the correct representations of the ﬂags (i.e. locations of the respective countries’ capitals on Earth, up to rotations of the sphere).
The employed Gurobi solver optimizes a mixed-integer programming formulation of TSP using the cutting plane method (Marchand et al., 2002) for lazy sub-tour elimination.
[Table]
Results.
This architecture not only learns to extract the correct TSP tours but also learns the correct representations.
Quantitative evidence is presented in Tab. 3, where we see that the learned locations generalize well and lead to correct TSP tours also on the test set and also on somewhat large instances (note that there are 39!
≈ 10 46 admissible TSP tours for k = 40 ).
The baseline architecture only memorizes the training set.
Additionally, we can extract the suggested locations of world capitals and compare them with reality.
To that end, we present Fig.
5b, where the learned locations of 10 capitals in Southeast Asia are displayed.
4. MNIST M IN - COST P ERFECT M ATCHING
Problem input and output.
The training dataset for problem PM ( k ) consists of 10000 examples where the input to each example is a set of k 2 digits drawn from the MNIST dataset arranged in a k × k grid.
For computing the label, we consider the underlying k × k grid graph (without diagonal edges) and solve a MIN - COST - PERFECT - MATCHING problem, where edge weights are given simply by reading the two vertex digits as a two-digit number (we read downwards for vertical edges and from left to right for horizontal edges).
The optimal perfect matching (i.e. the label) is encoded by an indicator vector for the subset of the selected edges, see example in Fig.
Architecture.
The grid image is the input of a convolutional neural network which outputs a grid of vertex weights.
These weights are transformed into edge weights as described above and given to the solver.
The loss function is Hamming distance between solver output and the true label.
[Table]
Results.
The architecture containing the solver is capable of good generalizations suggesting that the correct representation is learned.
The performance is good even on larger instances and despite the presence of noise in supervision – often there are many optimal matchings.
In contrast, the ResNet18 baseline only achieves reasonable performance for the simplest case PM (4) .
The results are summarized in Tab. 4.
D ISCUSSION
We provide a uniﬁed mathematically sound algorithm to embed combinatorial algorithms into neural networks.
Its practical implementation is straightforward and training succeeds with standard deep learning techniques.
The two main branches of future work are: 1) exploring the potential of newly enabled architectures, 2) addressing standing real-world problems.
The latter case requires I npu t →    ...   [Figure]
A CKNOWLEDGEMENT
We thank the International Max Planck Research School for Intelligent Systems (IMPRS-IS) for supporting Marin Vlastelica. We acknowledge the support from the German Federal Ministry of Education and Research (BMBF) through the Tbingen AI Center (FKZ: 01IS18039B). Additionally, we would like to thank Paul Swoboda and Alexander Kolesnikov for valuable feedback on an early version of the manuscript.
A A PPENDIX A. G UIDELINES FOR S ETTING THE V ALUES OF λ .
In practice, λ has to be chosen appropriately but we found its exact choice uncritical (no precise tuning was required).
Nevertheless, note that λ should cause a noticeable disruption in the optimization problem from equation (3), otherwise it is too likely that y ( w ) =
y λ ( w ) resulting in a zero gradient.
In other words, λ should roughly be of the magnitude that brings the two terms in the deﬁnition of w (cid:48) in Prop. 1 to the same order:
[Equation]
where (cid:104)·(cid:105) stands for the average.
This again justiﬁes that λ is a true hyperparameter and that there is no reason to expect values around λ → 0 + .
A. P ROOFS
Proof of Proposition 1.
Let us write L
= L (ˆ y ) and ∇ L = d L d y (ˆ y ) , for brevity.
Thanks to the linearity of c and the deﬁnition of f , we have
[Equation]
where c 0 = λL − λ ∇ L ˆ y and w (cid:48)
=
ˆ w + λ ∇ L as desired.
The conclusion about the points of minima then follows.
Before we prove Theorem 1, we make some preliminary observations.
To start with, due to the deﬁnition of the solver, we have the fundamental inequality
[Equation]
Observation 1.
The function w (cid:55)→ c (cid:0) w, y ( w ) (cid:1) is continuous and piecewise linear.
Proof.
Since c ’s are linear and distinct, c (cid:0) w, y ( w ) (cid:1) , as their pointwise minimum, has the desired properties.
Analogous fundamental inequality
[Equation]
follows from the deﬁnition of the solution to the optimization problem (3).
A counterpart of Observation 1 reads as follows.
Observation 2.
The function w (cid:55)→ c (cid:0) w, y λ ( w ) (cid:1) + λf (cid:0) y λ ( w ) (cid:1) is continuous and piecewise afﬁne.
Proof.
The function under inspection is a pointwise minimum of distinct afﬁne functions w (cid:55)→ c ( w, y )
+ λf ( y ) as y ranges Y .
As a consequence of above-mentioned fundamental inequalities, we obtain the following two-sided estimates on f λ .
Observation 3.
The following inequalities hold for w ∈ W
[Equation]
Proof.
Inequality (6) implies that c (cid:0) w, y ( w ) (cid:1) − c (cid:0) w, y λ ( w ) (cid:1) ≤ 0 and the ﬁrst inequality then follows simply from the deﬁnition of f λ .
As for the second one, it sufﬁces to apply (7) to y =
y ( w ) .
Now, let us introduce few notions that will be useful later in the proofs.
For a ﬁxed λ , W partitions into maximal connected sets P on which y λ ( w ) is constant (see Fig. 7).
We denote this collection of sets by W λ and set W = W 0 .
For λ ∈ R and y 1 (cid:54) =
y 2 ∈ Y , we denote
[Equation]
( y 2 ) (cid:9) .
We write F ( y 1 , y 2 ) =
F 0 ( y 1 , y 2 ) , for brevity.
For technical reasons, we also allow negative values of λ here.
[Figure]
Note, that if W = R N , then F λ is a hyperplane since c ’s are linear.
In general, W may just be a proper subset of R N and, in that case, F λ is just the restriction of a hyperplane onto W .
Consequently, it may happen that F λ ( y 1 , y 2 ) will be empty for some pair of y 1 , y 2 and some λ ∈ R .
To emphasize this fact, we say “hyperplane in W ”.
Analogous considerations should be taken into account for all other linear objects.
The note “in W ” stands for the intersection of these linear object with the set W .
Observation 4.
Let P ∈ W λ and let y λ ( w ) =
y for w ∈ P .
Then P is a convex polytope in W , where the facets consist of parts of ﬁnitely many hyperplanes F λ ( y, y k ) in W for some { y k } ⊂ Y .
Proof.
Assume that W = R N .
The values of y λ may only change on hyperplanes of the form
F λ ( y, y (cid:48) ) for some y (cid:48) ∈ Y .
Then P is an intersection of corresponding half-spaces and therefore P is a convex polytope.
If W is a proper subset of R N the claim follows by intersecting all the objects with W .
Observation 5.
Let y 1 , y 2 ∈ Y be distinct.
If nonempty, the hyperplanes F [Equation] y 1 , y 2 ) and F λ ( y 1 , y 2 ) are parallel and their distance is equal to | λ | K ( y 1 , y 2 ) , where
[Equation]
Proof.
If we deﬁne a function c ( w ) =
c ( w, y 1 ) − c ( w, y 2 ) =
w ( y 1 − y 2 ) and a constant C = f
( y 2 )
− f
( y 1 ) , then our objects rewrite to
F ( y 1 , y 2 ) = { w ∈ W : c ( w ) = 0 } and F λ ( y 1 , y 2 ) = { w ∈ W : c ( w ) = λC } .
Since c is linear, these sets are parallel and F ( y 1 , y 2 ) intersects the origin.
Thus, the required distance is the distance of the hyperplane F λ ( y 1 , y 2 ) from the origin, which equals to | λC | / (cid:107) y 1 − y 2 (cid:107) .
As the set Y is ﬁnite, there is a uniform upper bound K on all values of K ( y 1 , y 2 ) .
Namely
[Equation]
A.2. P ROOF OF T HEOREM
Proof of Property A1.
Now, Property A1 follows, since
[Equation]
and f λ is a difference of continuous and piecewise afﬁne functions.
Proof of Property A2.
Let 0 < λ 1 ≤ λ 2 be given.
We show that W λ 2 eq ⊆ W λ 1 eq which is the same as showing W λ 1 dif ⊆ W λ 2 dif .
Assume that w ∈ W λ 2 eq , that is, by the deﬁnition of W λ 2 eq and f λ ,
[Equation]
in which we denoted y 2 =
y λ 2 ( w ) .
Our goal is to show that
[Equation]
where y 1 = y λ 1 ( w ) as this equality then guarantees that w ∈ W λ 1 eq .
Observe that (7) applied to λ
=
λ 1 and y
=
y ( w ) , yields the inequality “ ≥ ” in (10).
Let us show the reversed inequality.
By Observation 3 applied to λ
=
λ 1 , we have
[Equation]
We now use (7) with λ = λ 2 and y =
y 1 , followed by equality (9) to obtain
[Equation]
[Equation]
Next, we have to show that W λ dif → ∅ as λ → 0 + , i.e. that for almost every w ∈ W , there is a λ >such that w / ∈ W λ dif .
To this end, let w ∈ W be given.
We can assume that y ( w ) is a unique solution of solver (1), since two solutions, say y 1 and y 2 , coincide only on the hyperplane F ( y 1 , y 2 ) in W , which is of measure zero.
Thus, since Y is ﬁnite, the constant
[Equation]
is positive.
Denote
[Equation]
If d > 0 , set λ < c/d .
Then, for every y ∈ Y such that f (cid:0) y ( w ) (cid:1) >
f ( y ) , we have
[Equation]
which rewrites
[Equation]
For the remaining y ’s, (13) holds trivially for every λ > 0 .
Therefore, y ( w ) is a solution of the minimization problem (3), whence y λ ( w ) =
y ( w ) .
This shows that w ∈ W λ eq as we wished.
If d = 0 , then f (cid:0) y ( w ) (cid:1) ≤ f ( y ) for every y ∈ Y and (13) follows again.
Proof of Property A3.
Let y 1 (cid:54) =
y 2 ∈ Y be given.
We show that on the component of the set { w ∈ [Equation]
y [Equation] 1 and y λ
[Equation] the function f λ agrees with a δ -interpolator, where δ ≤ Cλ and C > 0 is an absolute constant.
The claim follows as there are only ﬁnitely many sets and their components of the form (14) in W λ dif .
Let us set
[Equation]
and
[Equation]
The condition on c tells us that h is a non-constant afﬁne function.
It follows by the deﬁnition of
F ( y 1 , y 2 ) and F λ ( y 1 , y 2 ) that
[Equation]
and
[Equation]
By Observation 5, the sets F and F λ are parallel hyperplanes.
Denote by G the nonempty intersection of their corresponding half-spaces in W .
We show that g is a δ -interpolator of f on G between y 1 and y 2 , with δ being linearly controlled by λ .
We have already observed that g is the afﬁne function ranging from f ( y 1 ) – on the set F λ ( y 1 , y 2 ) – to f ( y 2 ) – on the set F ( y 1 , y 2 ) .
It remains to show that g attains both the values f ( y 1 ) and f ( y 2 ) at most δ -far from the sets P 1 and P 2 , respectively, where P k ∈ W denotes a component of the set { w ∈ W : y ( w ) =
y k } , k
= 1 , 2 .
Consider y 1 ﬁrst.
By Observation 4, there are z 1 , . . .
, z (cid:96) ∈ Y , such that facets of P 1 are parts of hyperplanes F ( y 1 , z 1 ) , . . .
, F ( y 1 , z (cid:96) ) in W .
Each of them separates W into two half-spaces, say
W + k and W − k , where W − k is the half-space which contains P 1 and W + k is the other one.
Let us denote c k ( w ) =
[Equation] w, y [Equation]
) − c [Equation] w, z k ) for w ∈ W and k = 1 , . . .
, (cid:96).
Every c k is a non-zero linear function which is negative on W − k and positive on W + k .
By the deﬁnition of y 1 , we have
[Equation]
for w ∈ P
[Equation]
and for k = [Equation] [Equation] , that is
[Equation] [Figure]
Now, denote
[Equation]
Each W λk is a half-space in W containing W − k and hence P 1 .
Let us set P λ 1 = (cid:84) (cid:96)k =1 W λk .
Clearly,
P 1 ⊆
P λ 1 (see Fig.
By Observation 5, the distance of the hyperplane (cid:8) w ∈ W : c k ( w ) = λ (cid:12)(cid:12) f ( z k ) − f ( y 1 ) (cid:12)(cid:12)(cid:9) from P 1 is at most λK , where K is given by (8).
Therefore, since all the facets of P λ [-
-]1 are at most λK far from P 1 , there is a constant C such that each point of P λ 1 is at most Cλ far from P 1 .
Finally, choose any w 1 ∈ P λ 1 ∩ F λ ( y 1 , y 2 ) .
By (16), we have g ( w 1 ) =
f ( y 1 ) , and by the deﬁnition of P λ 1 , w 1 is no farther than Cλ away from P 1 .
Now, let us treat y 2 and deﬁne the set P λ 2 analogous to P λ 1 , where each occurrence of y 1 is replaced by y 2 .
Any w 2 ∈ P λ 2 ∩ F ( y 1 , y 2 ) has desired properties.
Indeed, (15) ensures that g ( w 2 ) =
f ( y 2 ) and w 2 is at most Cλ far away from P 2 .
A. D ETAILS OF E XPERIMENTS A.3. W ARCRAFT S HORTEST P ATH
The maps for the dataset have been generated with a custom random generation process by using 142 tiles from the Warcraft II tileset (Guyomarch, 2017).
The costs for the different terrain types range from 0 .
Some example maps of size 18 × 18 are presented in Fig.
9a together with a histogram of the shortest path lengths.
We used the ﬁrst ﬁve layers of ResNet18 followed by a max-pooling operation to extract the latent costs for the vertices.
Optimization was carried out via Adam optimizer (Kingma & Ba, 2014) with scheduled learning rate drops dividing the learning rate by 10 at epochs 30 and 40 .
Hyperparameters and model details are listed in Tab.
[Table]
[Figure]
A.3. MNIST M IN - COST P ERFECT M ATCHING
The dataset consists of randomly generated grids of MNIST digits that are sampled from a subset of 1000 digits of the full MNIST dataset.
We trained a fully convolutional neural network with two convolutional layers followed by a max-pooling operation that outputs a k × k grid of vertex costs for each example.
The vertex costs are transformed into the edge costs via the known cost function and the edge costs are then the inputs to the Blossom V solver (Edmonds, 1965) as implemented in (Kolmogorov, 2009).
Regarding the optimization procedure, we employed the Adam optimizer along with scheduled learning rate drops dividing the learning rate by 10 at epochs 10 and 20 , respectively.
Other training details are in Tab. 6.
Lower batch sizes were used to reduce GPU memory requirements.
[Table]
G LOBE T RAVELING S ALESMAN P ROBLEM
For the Globe Traveling Salesman Problem we used a convolutional neural network architecture of three convolutional layers and two fully connected layers.
The last layer outputs a vector of dimension 3 k containing the k 3-dimensional representations of the respective countries’ capital cities.
These representations are projected onto the unit sphere and the matrix of pairwise distances is fed to the TSP solver.
The high combinatorial complexity of TSP has negative effects on the loss landscape and results in many local minima and high sensitivity to random restarts.
For reducing sensitivity to restarts, we set Adam parameters to β 1 = 0 .
5 (as it is done for example in GAN training (Radford et al., 2015)) and (cid:15) =
10 − 3 .
The local minima correspond to solving planar TSP as opposed to spherical TSP.
For example, if all cities are positioned to almost identical locations, the network can still make progress but it will never have the incentive to spread the cities apart in order to reach the global minimum.
To mitigate that, we introduce a repellent force between epochs 15 and 30.
In particular, we set
[Equation]
where x i ∈ R 3 for i = 1 , . .
, k are the positions of the k cities on the unit sphere.
The regularization constants C k were chosen as 2 . 0 , 3 . 0 , 6 . 0 , and 20 . 0 for k ∈ { 5 , 10 , 20 , 40 } .
For ﬁne-tuning we also introduce scheduled learning rate drops where we divide the learning rate by 10 at epochs 80 and 90 .
[Table]
In Fig.
5b [Table] we compare the true city locations with the ones learned by the hybrid architecture.
Due to symmetries of the sphere, the architecture can embed the cities in any rotated or ﬂipped fashion.
We resolve this by computing “the most favorable” isometric transformation of the suggested locations.
In particular, we solve the orthogonal Procrustes problem (Gower & Dijksterhuis, 2004)
[Equation]
[Table]
[Equation]
[Table] where X are the suggested locations [Table] Y the true locations
[Table]
and R ∗ the optimal transformation to apply.
We report the resulting offsets in kilometers in Tab. 8. [Table]
A. T RAVELING S ALESMAN WITH AN A PPROXIMATE S OLVER
Since approximate solvers often appear in practice where the combinatorial instances are too large to be solved exactly in reasonable time
[Table]
we test our method also in this setup.
In particular, we use the approximate solver (OR-Tools (ort, 2019)) for the Globe TSP.
We draw two conclusions from the numbers presented below in Tab. 9.
(i)
The choice of the solver matters.
Even if OR-Tools is fed with the ground truth representations (i.e. true locations) it does not achieve perfect results on the test set (see the right column).
We expect, that also in practical applications, running a suboptimal solver (e.g. a differentiable relaxation) substantially reduces the maximum attainable performance.
(ii)
The suboptimality of the solver didn’t harm the feature extraction – the point of our method.
Indeed, the learned locations yield performance that is close to the upper limit of what the solver allows (compare the middle and the right column).
[Table]