1 Introduction

Mixed-integer nonlinear optimization problems (MINLP) arise in many engineering applications [5, 8, 25, 26]. Existing solvers that globally optimize MINLP include: ANTIGONE [38, 40], Baron [49], Couenne [6, 34], LINDOGlobal [19], Minotaur [35],and SCIP [54]. The special structure of an optimization problem may expedite its solution, e.g. convexity may be exploited to generate polyhedral cutting planes [41, 49] or only relax the nonconvexities [1, 46]. MINLP have the form [15]:

$$\begin{aligned} \begin{array}{ll} \text {minimize} &{}\quad f_0({\varvec{y}}, {\varvec{w}}, {\varvec{z}}), \\ \text {subject to} &{}\quad b_m^L \le f_m({\varvec{y}}, {\varvec{w}}, {\varvec{z}}) \le b_m^U \quad \forall m \in \{1, \dots , M\},\\ &{}\quad {\varvec{y}} \in \{\mathbb {R}, \pm \infty \}^C, {\varvec{w}} \in \{0, 1\}^B, {\varvec{z}} \in \{\mathbb {Z}, \pm \infty \}^I. \end{array} \end{aligned}$$
(MINLP)

Simplifying, we write \(f_m({\varvec{x}}): \mathbb {S}^N \mapsto \mathbb {R}\) instead of \(f_m({\varvec{y}}, {\varvec{w}}, {\varvec{z}})\) and denote \(\mathbb {S}\) as the domain of \({\varvec{x}}\). Table 1 contains this manuscript’s notation.

Table 1 Notation used in this paper

Contributions This paper presents data structures and algorithms used to implement SUSPECT. The primary contribution of SUSPECT is its easy extensibility to detect the convexity of complex expressions. Custom MINLP solvers can leverage SUSPECT during preprocessing to make informed decisions about how to best customize the solution process. For example, a solver could use SUSPECT to identify which problem variables appear in nonconvex expressions, thereby reducing the space over which it must apply spatial branch and bound. SUSPECT’s extensibility allows domain experts to add new convexity detectors, thereby expanding the range of expressions that SUSPECT can correctly classify. Finally, SUSPECT may also be used to provide special structure detection and bounds tightening when developing new global optimization tools. This paper is published alongside the source code [10], licensed under the Apache License, version 2. All global solvers have some convexity detection facilities, but SUSPECT is the first open source code to explicitly detect convexity as a stand-alone utility.

The rest of the paper is organized as follows. Section 2 introduces convexity detection, the Python library Pyomo and data structures to represent nonlinear optimization problems. Bound tightening and propagation algorithms are described in Sect. 3, while Sect. 4 gives an overview of the monotonicity and convexity propagation rules used in SUSPECT. In Sect. 5 we describe the data structures and algorithms implemented in SUSPECT and in Sect. 6 we introduce the plugin-based architecture used to extend SUSPECT. The test suite and results are presented in Sect. 7. We conclude in Sect. 8.

2 Background

Different methods exist for proving or disproving convexity of an expression (or an optimization problem). Tree-walking approaches [17, 18] are suited for preprocessing given their low computational complexity. More computationally expensive methods (i) use automatic differentiation techniques to compute the interval Hessian [42, 44], (ii) reduce convexity questions to real quantifier elimination problems [45], or (iii) sample to verify convexity [12]. Some solvers, e.g. CVX [22, 23], CVXPY [14] and Convex.jl [51], impose a set of conventions when constructing problems and thereby obtain a convex optimization problem [24].

The bound tightening techniques described in this paper are similar to those used in interval arithmetic and constraint programming [37, 47]. Other bound tightening techniques use pair of inequalities [3], tightening with a linear optimization problem (LP) [4], or solving two LPs for each variable [20].

2.1 Pyomo expression trees

SUSPECT works with optimization models formulated using Pyomo [27, 28], a Python-based Algebraic Modeling Language (AML). Pyomo supports most features common to AMLs, e.g. (i) separating the model definition from the instance data and solution method, (ii) supporting linear and nonlinear expressions, and (iii) structuring modeling using indexing sets and multi-dimensional variables, parameters, and constraints. Pyomo focuses on an open, extensible object model. As with most AMLs, Fig. 1 shows that Pyomo represents objectives and constraints using expression trees,Footnote 1 with internal nodes representing operators and leaf nodes representing operands. Operands may be variable objects, literal constants (integer or floating point numbers, or strings), or placeholders for literal constants (“mutable parameters”). Internal nodes come in three fundamental categories: Unary operators (negation, absolute value, and trigonometric functions), binary operators (subtraction, multiplication, division, exponentiation, and comparison), and n-ary operators (addition, linear expressions).

Fig. 1
figure 1

Pyomo expression hierarchy. Expression classes If, GetItem and ExternalFunction are not supported by SUSPECT and therefore they are not included in the diagram

2.2 Directed acyclic graphs

SUSPECT represents problems using a Directed Acyclic Graph (DAG) to group common subexpressions in a single node [47, 55]. Variables and constants in the problem are sources, while the functions \(f_0\) and \(f_m\), \(m \in \{1, \dots , M\}\) are sinks. SUSPECT represents an MINLP instance as a DAG G, \(G = (V, E)\), where V is the set of vertices and E the set of directed edges \(E \subseteq V \times V\). Each vertex v represents an operation \(\otimes _v\), the children of v are its operands, while the parents of v are the expressions of which v is an operand. More formally, define the children of v as \(c(v) = \{w \in V : (w, v) \in E\}\) and the parents of v as \(p(v) = \{w \in V : (v, w) \in E\}\). Note that sources have \(c(v) = \emptyset \) since they don’t have any operand, and sinks have \(p(v) = \emptyset \) since they are top level operations. The vertex vdepth is:

$$\begin{aligned} d(v) = {\left\{ \begin{array}{ll} 0, &{} \text {if } c(v) = \emptyset ,\\ \max \{d(w) : w \in c(v)\} + 1, &{} \text {otherwise}. \end{array}\right. } \end{aligned}$$

The SUSPECT instance graph G is similar to combining all Pyomo expression trees for that instance except that Pyomo explicitly avoids shared subexpressions and restricts each operator vertex to have at most one parent. Therefore, any two Pyomo expressions share no common internal nodes. In contrast, SUSPECT actively identifies and combines common vertices across expressions [54]. Figure 2 represents Optimization Problem (1) and shows the DAG vertices grouped by depth d(v).

$$\begin{aligned} \begin{array}{lll} \text {minimize} &{} &{} x_0 + x_1 + x_2 \\ \text {subject to} &{} &{} \log (x_1 - x_2) \ge 0\\ &{} &{} x_1 - x_2 + \sqrt{x_0 + x_1} \le 2\\ &{} &{} {\varvec{x}} \in \mathbb {S}^N. \end{array} \end{aligned}$$
(1)
Fig. 2
figure 2

Pictorial representation of Optimization Problem (1), with vertices grouped by depth d(v)

3 Bound tightening and propagation

Feasibility-based bounds tightening propagates bounds from sources to sinks and from sinks to sources. To propagate bounds from sources to sinks, SUSPECT computes the new bounds \(B'_v\) of each node v with existing bound \(B_v\) and bounds on its children nodes \(B_u\) as:

$$\begin{aligned} B'_v = {\left\{ \begin{array}{ll} {[}c, c] &{} \text {if } v \text { is a constant c}\\ {[}x_i^L, x_i^U] &{} \text {if } v \text { is variable } x_i\\ B_v \cap \otimes _v(B_u | u \in c(v)) &{} \text {otherwise}. \end{array}\right. } \end{aligned}$$

For each operator \(\otimes _v\), SUSPECT computes the bound using the interval arithmetic rules in Appendix A [32, 43]. For functions \(g({\varvec{x}})\), \({\varvec{x}} \in X\), \(X \subseteq {{\,\mathrm{\mathbf {dom}}\,}}g\), the expression bound \(g({\varvec{x}})\) is the image of \(g(X) := \{ g({\varvec{x}}) | {\varvec{x}} \in X\}\). If \(X \nsubseteq {{\,\mathrm{\mathbf {dom}}\,}}g\) for some DAG vertex, SUSPECT throws an exception. In normal operation, SUSPECT has \(X \subseteq {{\,\mathrm{\mathbf {dom}}\,}}g\), but this feature helps researchers extend SUSPECT.

Example 1

Consider the function \(g(x_1) := \sqrt{x_1}\), SUSPECT will compute the bound of g as [0, 2] if \(x_1 \in [0, 4]\), but will throw an exception for \(x_1 \in [-1, 1]\).

The reverse step of feasibility-based bound tightening propagates bounds from sinks to sources. A DAG vertex v with unary function \(\otimes _v\) and bound \(B_v\) implies a child u with bound \(B_u\) that is equal to or tighter than \(\otimes _v^{-1}(B_v)\), where \(\otimes _v^{-1}\) is the inverse of the function \(\otimes _v\) if it exists, otherwise it is a function that maps all arguments to \([-\infty , \infty ]\). The absolute value and square functions are the only exceptions in the current implementation: they are not invertible, but we update the bound of \(B_u\) using \(\otimes _v^{-1}(B_v) = B_v \cup (-B_v)\) and \(\otimes _v^{-1}(B_v) = \sqrt{B_v} \cup \left( - \sqrt{B_v} \right) \), respectively. Equation (2) gives the bound tightening step SUSPECT performs for each vertex v that represents an unary function:

$$\begin{aligned} B_u = B_u \cap \otimes _v^{-1}(B_v). \end{aligned}$$
(2)

Example 2

Consider the function \(k(x_1) := \sqrt{x_1}\), with \(k(x_1) \in [0, 2]\), then the bound of \(x_1\) will be [0, 4]. If the expression is \(k(x_1) := |x_1|\), with \(k(x_1) \in [1, 2]\), then \(x_1 \in [-2, 2]\). SUSPECT does not support disjoint intervals because their support is uncommon in most solvers, so the bound is not \([-2, -1] \cup [1, 2]\).

Appendix B shows that SUSPECT also tightens the bounds of the children of linear expressions, but not of other non-unary functions, e.g. product and division.

4 Special structure detection

SUSPECT detects monotonicity and convexity recursively. The rules assume an expression has only unary or binary vertices, but SUSPECT deduces properties of n-ary vertices \(k = g_0 \circ g_1 \circ \cdots \circ g_l\) by applying the rules as \((((g_0 \circ g_1) \circ g_2) \circ \cdots \circ g_l)\), where \(g_i: Z \rightarrow Y\), \(Z \subseteq \mathbb {R}^l\), \(Y \subseteq \mathbb {R}\). This section introduces rules computing the monotonicity and convexity properties of the composition \(k = g \circ h: X \rightarrow Y\) of the functions \(g: Z \rightarrow Y\) and \(h: X \rightarrow Z\), where \(X \subseteq \mathbb {R}^n\), \(Y \subseteq \mathbb {R}\), \(Z \subseteq \mathbb {R}^l\), and \({{\,\mathrm{\mathbf {dom}}\,}}{k} = \{{\varvec{x}} \in {{\,\mathrm{\mathbf {dom}}\,}}h | h({\varvec{x}}) \in {{\,\mathrm{\mathbf {dom}}\,}}{g} \}\) [9]. A function \(k({\varvec{x}})\) is nondecreasing (nonincreasing) if its gradient \(\nabla k({\varvec{x}}) \ge 0\) (\(\nabla k({\varvec{x}}) \le 0\)) \(\forall \, {\varvec{x}} \in X\). Applying the chain rule and computing the gradient of k, the monotonicity of k depends on the signs of \(\nabla g(h({\varvec{x}}))\) and \(\nabla h({\varvec{x}})\):

$$\begin{aligned} \nabla k({\varvec{x}}) = \nabla g(h({\varvec{x}})) \nabla h({\varvec{x}}). \end{aligned}$$

A function \(k({\varvec{x}})\) is convex (concave) if its Hessian \(\nabla ^2 k({\varvec{x}}) \ge 0\) (\(\nabla ^2 k({\varvec{x}}) \le 0\)) for all \({\varvec{x}} \in X\):

$$\begin{aligned} \nabla ^2 k({\varvec{x}}) = \nabla h({\varvec{x}})^T \nabla ^2 g(h({\varvec{x}})) \nabla h({\varvec{x}}) + \nabla g(h({\varvec{x}})) \nabla ^2 h({\varvec{x}}). \end{aligned}$$

If any of g or h are not differentiable, then the monotonicity and convexity of k are considered unknown. SUSPECT has special routines for the absolute value function: if the domain of |x| specifies \(x \ge 0\) (\(x \le 0\)) then we compute first and second derivatives as if \(|x| = x\) (\(|x| = -x\)). We assume nothing if \(x = 0\) is in the interior of the domain. For a more detailed list of monotonicity and convexity rules refer to Appendix C of the supplementary material.

5 Implementation details

SUSPECT is implemented in Python and is compatible with Python version 3.5 and later. The source code is freely available on GitHub.Footnote 2 SUSPECT can be used as a standalone command line application or included in other applications as a library.

5.1 Data structures

SUSPECT implements a problem DAG by storing all vertices in a list, sorted by ascending depth. This sorting ensures that if SUSPECT traverses the list forward (backward), it visits a vertex after having visited all its children (parents). Each vertex stores a reference to its children and parents. Other approaches to representing the DAG are possible, e.g. using adjacency lists [13]. The SUSPECT class hierarchy for vertices, which is diagrammed in Fig. 3, is similar to Pyomo, but SUSPECT has a class for each available unary function because we often need to dispatch based on a vertex type. Having a type for each unary function enables leveraging the same functions used by the other vertex types. Figure 4 represents Optimization Problem (1): the DAG also contains dictionaries to map variables, constraints, and objectives names to their respective vertex.

Fig. 3
figure 3

SUSPECT expression hierarchy. Different from the Pyomo classes shown in Fig. 1, each unary function has its own class, and constraints and objectives are a special type of expression

5.2 Converting Pyomo models to SUSPECT

SUSPECT represents an optimization problem as a DAG, but Pyomo represents problems using separate expression trees for each constraint and objective. SUSPECT uses a hashmap-like data structure to correctly map a Pyomo expression to an existing SUSPECT expression if present, or otherwise create a new expression. The heuristic approach of hashing Pyomo expressions may not converge to the DAG with the fewest vertices, but it should obtain an acceptable DAG. The DAG structure depends on the model building style since no simplifications are performed.

Fig. 4
figure 4

Implementation of the DAG for Optimization Problem (1). The DAG is a list of vertices sorted by \(d(\textit{v})\), together with dictionaries to map variables, constraints, and objectives names to the relative object

The hash function needs: (i) to compute the same value for equivalent expressions but different values for different expressions, and (ii) to limit collisions with a uniform distribution. Computing the hash is recursive: SUSPECT starts from the expression tree leaves and moves to the root. The hash of a variable is its ID. SUSPECT implements two possible strategies for the hash of a constant coefficient:

  • Each unique number gets an increasing ID [SUSPECT default] This is best when there are few distinct floating point numbers, e.g. many coefficients are 1. SUSPECT stores floating point numbers in a binary tree with their associated ID.

  • Rounded number is the hash value This is best when there are many unique floating point numbers.

Hashes of non-leaf nodes combine the hashes of their children expressions, together with the node. Equation (3) shows how the hash function of a vertex v is computed [30], where h is the hash function and \(c_0, \dots , c_n\) are the children of the vertex v.

$$\begin{aligned} h(v) = {\left\{ \begin{array}{ll} \text {ID}(v) &{} \text {if } v \text { is a source,}\\ \text {ID}(\text {VertexClass}) \oplus h(c_0) \oplus h(c_1) \oplus \cdots \oplus h(c_n) &{} \text {otherwise.}\\ \end{array}\right. } \end{aligned}$$
(3)

Figure 5 represents the expression hash map. SUSPECT inserts an expression by hashing the expression into a bucket index and then iterating through the bucket to check for the expression, otherwise SUSPECT appends it to the list. The Python built-in hash map manages the buckets. For lookups, SUSPECT hashes the expression for the bucket and then searches linearly through the bucket. This method matches some equivalent expressions, e.g. reordering a summation \(x_0 + x_1\) to \(x_1 + x_0\). Since SUSPECT represents linear expressions as a summation of variables with the associated coefficients, the expressions \(x_0 + x_1\) and \(x_0 + x_2 + x_3\) would be represented by different linear expression vertices. SUSPECT could be improved by matching polynomials, e.g. \((x - 2)^2 = \left( x^2 - 4x + 4 \right) \).

Fig. 5
figure 5

ExpressionDict implementation. Floating point coefficients make building a dictionary of expressions and values (in this case Bound objects) challenging. SUSPECT uses a hash function that ignores coefficients to insert similar expressions in the same bucket, then compares each expression for equality

SUSPECT builds the DAG by: (i) associating Pyomo expressions to SUSPECT expressions, (ii) adding all problem variables, and (iii) visiting all Pyomo constraint and objective trees. For each Pyomo tree, SUSPECT walks from the leaves (variables and constants) to the root (functions) and modifies the DAG when it finds new subexpressions. This process terminates with a DAG equivalent to the Pyomo model.

5.3 Tree-walking rules: forward and backward visitors

The rules detecting monotonicity and convexity are naturally expressed recursively. The SUSPECT implementation avoids recursion because it can lead to stack overflows. To overcome this challenge, we devise a strategy to compute recursive rules without recursion. A node’s vertex depth is greater than the depth of its children, so visiting nodes in ascending order: (i) visits a node after visiting its children and (ii) visits a node at most once. The problem DAG methods that visit vertices take two parameters: a visitor object (a subclass of ForwardVisitor or BackwardVisitor) and a context. The visitor is called on a node while the context shares information between visitors. SUSPECT uses this context to store information, e.g. bounds, polynomiality, monotonicity, and convexity.

The visitor classes implement the register_handlers and handle_result methods. The first method returns a dictionary associating expression types to a callback. SUSPECT calls the second after each vertex visit to update special structure information. The callbacks registered in the visitor are called with two parameters: the current expression and the context object. Callbacks can use the context to lookup information about other vertices, e.g. children in forward mode and parents in backward mode. To reduce computation time in forward (backward) mode, SUSPECT only visits nodes if any of its children (parents) changed in the previous iteration. To use this feature, implementations return a Boolean from the handle_result method to indicate if the vertex value was updated or not. If the vertex value changes, then SUSPECT adds the node parents (children) to the list of nodes to visit.

5.4 Bound tightening and propagation

DAGs are commonly used for bound propagation and tightening [47, 55]. SUSPECT implements the bound propagation rules defined in Sect. 3 using the Sect. 5.3 tree-walking rules. Since convergence time of the bound tightening step can be infinite [31], SUSPECT incorporates a maximum iteration parameter (default 10).

Floating point operations are subject to rounding errors [21] that are propagated in bounds tightening. To mitigate errors, SUSPECT algorithms work with the generic Bound interface. SUSPECT provides an implementation of this interface using arbitrary precision arithmetic [36], but users can supply their own implementation, e.g. using interval arithmetic [7]. Appendix D discusses the Bound interface.

6 Extending SUSPECT

SUSPECT may be extended to include other convexity structures detectors. SUSPECT already incorporates convexity detection for four important convex expressions:

  1. 1.

    Quadratic expression \(g({\varvec{x}}) = {\varvec{x}}^T Q {\varvec{x}}\) is convex if matrix Q is positive semidefinite and concave if Q is negative semidefinite.

  2. 2.

    Second-Order Cone, i.e. the Euclidean norm \(||{\varvec{x}}||_2 := \sqrt{\sum _{x \in {\varvec{x}}} x^2}\) is convex [33].

  3. 3.

    Perspective Functions with \(x_2 \ge 0\) and \(0 \le x_1 \le 1\) are defined:

    $$\begin{aligned} g(x_1, x_2) := {\left\{ \begin{array}{ll} x_1 h(x_2 / x_1) &{} x_1 > 0, \\ 0 &{} \text {otherwise}. \end{array}\right. } \end{aligned}$$

    If the function \(h({\varvec{x}})\) is convex (concave), then \(g({\varvec{x}})\) is convex (concave) [29, 48].

  4. 4.

    Fractional Expressions where \(x, a_1, a_2, b_1, b_2 \in \mathbb {R}\) have the form:

    $$\begin{aligned} g(x) := \frac{a_1 x + b_1}{a_2 x + b_2} \end{aligned}$$

    The second derivative \(g''(x)\) derives rules for concavity and convexity [40].

SUSPECT adopts a plugin-based architecture to enable third parties to extend its convexity detection capabilities without having to change SUSPECT itself. SUSPECT is distributed with the aforementioned convexity extensions. SUSPECT uses the numpy library, which provides Python wrappers around LAPACK dsyevd routines, to compute the Q matrix eigenvalues. Since dsyevd uses double precision floating point arithmetic, it may obtain incorrect results because of numerical issues. An alternative approach to determine whether Q is positive (negative) semidefinite is to perform two Cholesky decompositions with pivoting, this could also result in a more stable algorithm. As numpy does not currently implement Choelesky decomposition with pivoting, this method has not yet been implemented in SUSPECT.

Writing a new convexity detector requires the user to implement the detector as a class extending ConvexityDetector, and register it with SUSPECT. A convexity detector visitor is similar to the Sect. 5.3 visitors, but each callback returns a Convexity object. When SUSPECT visits a vertex and the built-in convexity detector is inconclusive, it will iterate over the registered detectors that can handle the expression and assign the convexity as the first conclusive result encountered.

SUSPECT uses Python’s setuptools entry points to handle extensions registration. Entry points are a mechanism for the SUSPECT package to advertise extension points in its source. SUSPECT looks for extensions registered under the suspect.convexity_detection and suspect.monotonicity_detection groups for convexity and monotonicity detectors. Users extending SUSPECT need to package their extensions using setuptools and provide a setup.py file.

Example 3

Optimizing heat exchanger network design uses the reciprocal of log mean temperature difference (\(\text {RecLMTD}^\beta \)) with the limits defined:

$$\begin{aligned} \text {RecLMTD}^\beta (x, y) = {\left\{ \begin{array}{ll} \left( \frac{\ln {(x/y)}}{x - y}\right) ^\beta &{} x \ne y,\\ 1/x^\beta &{} x = y, \end{array}\right. } \end{aligned}$$

with variables \(x, y \in \mathbb {R}_{+}\), and constant parameter \(\beta \ge -1\). \(\text {RecLMTD}^\beta \) is concave if \(\beta = -1\), strictly concave if \(-1< \beta < 0\), linear if \(\beta = 0\), and convex if \(\beta > 0\) [41].

Listings 1–3 in Appendix E contain the detector source code. The register_handlers method returns a callback for the expression with PowerExpression as root (case \(x \ne y\)) and one for the expression with DivisionExpression as root (case \(x = y\)). Both callbacks check whether the expression they are given matches the subgraph representing the \(\text {RecLMTD}^\beta \) expression.

Listing 4 contains the setup.py source code necessary to register the new convexity detector with SUSPECT.

Fig. 6
figure 6

Percentage of instances processed vs run time on a log scale. The dashed horizontal line marks the percentage of instances SUSPECT reads and starts processing. Of the 1392 instances SUSPECT can process, 70% are processed in less than 2 s and 87% less than 10 s

7 Numerical results

We consider the MINLPLib 2 dataset [53] which, when we accessed it on 13th December 2017, contained 1527 problems. We conducted the tests as a batch job on a cluster of Amazon AWS C5 instances. Each problem was assigned a single instance to run and each instance is equivalent to 2 cores of a 3.0 GHz Intel Xeon processor with 4 GB memory. To increase reproducibility, the SUSPECT command line tool was packaged as a Docker image running Python 3.5. The results shown in this manuscript were generated using the version of SUSPECT with Git tag v7, dated 18th of May 2018. Together with SUSPECT, we used Pyomo version 5.2. The problems are expected to be in the OSiL [16] format and we use the binary tree strategy for hashing floating point constants.

Figure 6 shows the time (in CPU seconds) needed to run the special feature detection algorithms. The horizontal line marks the percentage of instances SUSPECT can read and start processing. Recall that SUSPECT can manage the Fig. 4 functions. SUSPECT fails at reading 135 (9%) of the 1527 instances because of unsupported nonlinear functions, e.g. the error function, or because the problem size is too big and SUSPECT time outs after more than 5 min converting from Pyomo to SUSPECT. SUSPECT processes 1003 (72%) of the remaining 1392 instances instances in under 2 s. This low computational overhead is due to the strength of tree-walking algorithms. Using the MINLPLib structure information as an oracle and considering the 1392 instances SUSPECT processes, our results matched the expected results in 1275 cases (91.6%). In 35 cases (2%), SUSPECT times out or encounters an exception while performing special structure detection. Table 15 of Appendix F lists the instances where SUSPECT did not detect the convexity properties.

SUSPECT does not have false positives on the test set, this gives confidence in the implementation and makes it possible to use it for solver selection. The johnall problem is labeled as having nonlinear objective function by MINLPLib but SUSPECT detects it as having polynomial objective type. The lip objective function is detected as concave because it is a convex maximization problem. Of the remaining 82 problems not recognized as convex (or concave), 53 fail because of numerical errors when computing the eigenvalues of the quadratic expressions. These problems are marked with a dagger\(^\dagger \) in Table 15. The trim loss minimization problems (tls{2, 4, 5, 6, 7, 12}) are convex but SUSPECT fails at detecting it because they contain the square root of the product of two nonnegative variables. The problem st_e17 contains the constraint \(x_1 - (0.2458 x_1^2)/x_2 \ge 6\) that SUSPECT fails to recognize as convex.

8 Conclusions and future work

This manuscript presents SUSPECT, a tool detecting and reporting special structure in optimization problems formulated using the Pyomo algebraic modeling library. The project can be developed further in different directions. On the convexity detection side, we can add an additional step of convexity disproving if the convexity detection is inconclusive. We can add the ability to detect nonconvex objective functions, e.g. the difference of two convex expressions [2, 50] to take advantage of new algorithms [52] specialized in solving this class of problems or to recognize pooling problem structure [11]. We can improve the bound tightening step using Optimization Based Bound Tightening, for example using one of the recent implementations [20] that started to emerge. It would be easy to extend SUSPECT to work with other algebraic modeling languages since the special structure detection algorithms work on SUSPECT’s own DAG or to extend the family of expression forms known [39]. SUSPECT could be integrated with existing nonlinear solvers to detect the problem type and choose the best optimization algorithm for it.