<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE article  PUBLIC "-//NLM//DTD Journal Publishing DTD v3.0 20080202//EN" "http://dtd.nlm.nih.gov/publishing/3.0/journalpublishing3.dtd"><article xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" dtd-version="3.0" xml:lang="en" article-type="research article"><front><journal-meta><journal-id journal-id-type="publisher-id">AM</journal-id><journal-title-group><journal-title>Applied Mathematics</journal-title></journal-title-group><issn pub-type="epub">2152-7385</issn><publisher><publisher-name>Scientific Research Publishing</publisher-name></publisher></journal-meta><article-meta><article-id pub-id-type="doi">10.4236/am.2012.330181</article-id><article-id pub-id-type="publisher-id">AM-24091</article-id><article-categories><subj-group subj-group-type="heading"><subject>Articles</subject></subj-group><subj-group subj-group-type="Discipline-v2"><subject>Physics&amp;Mathematics</subject></subj-group></article-categories><title-group><article-title>
 
 
  An Inexact Restoration Package for Bilevel Programming Problems
 
</article-title></title-group><contrib-group><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>lvio</surname><given-names>A. Pilotta</given-names></name><xref ref-type="aff" rid="aff1"><sup>1</sup></xref><xref ref-type="corresp" rid="cor1"><sup>*</sup></xref></contrib><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>Germán</surname><given-names>A. Torres</given-names></name><xref ref-type="aff" rid="aff1"><sup>1</sup></xref><xref ref-type="corresp" rid="cor1"><sup>*</sup></xref></contrib></contrib-group><aff id="aff1"><addr-line>Facultad de Matemática, Astronomía y Física, Universidad Nacional de Córdoba, CIEM (CONICET), Córdoba, Argentina</addr-line></aff><author-notes><corresp id="cor1">* E-mail:<email>pilotta@famaf.unc.edu.ar(LAP)</email>;<email>torres@famaf.unc.edu.ar(GAT)</email>;</corresp></author-notes><pub-date pub-type="epub"><day>31</day><month>10</month><year>2012</year></pub-date><volume>03</volume><issue>10</issue><fpage>1252</fpage><lpage>1259</lpage><history><date date-type="received"><day>June</day>	<month>1,</month>	<year>2012</year></date><date date-type="rev-recd"><day>July</day>	<month>1,</month>	<year>2012</year>	</date><date date-type="accepted"><day>July</day>	<month>8,</month>	<year>2012</year></date></history><permissions><copyright-statement>&#169; Copyright  2014 by authors and Scientific Research Publishing Inc. </copyright-statement><copyright-year>2014</copyright-year><license><license-p>This work is licensed under the Creative Commons Attribution International License (CC BY). http://creativecommons.org/licenses/by/4.0/</license-p></license></permissions><abstract><p>
 
 
  Bilevel programming problems are a class of optimization problems with hierarchical structure where one of the con-straints is also an optimization problem. Inexact restoration methods were introduced for solving nonlinear programming problems a few years ago. They generate a sequence of, generally, infeasible iterates with intermediate iterations that consist of inexactly restored points. In this paper we present a software environment for solving bilevel program-ming problems using an inexact restoration technique without replacing the lower level problem by its KKT optimality conditions. With this strategy we maintain the minimization structure of the lower level problem and avoid spurious solutions. The environment is a user-friendly set of Fortran 90 modules which is easily and highly configurable. It is prepared to use two well-tested minimization solvers and different formulations in one of the minimization subproblems. We validate our implementation using a set of test problems from the literature, comparing different formulations and the use of the minimization solvers.
 
</p></abstract><kwd-group><kwd>Bilevel Programming Problems; INEXACT Restoration Methods; Algorithms</kwd></kwd-group></article-meta></front><body><sec id="s1"><title>1. Introduction</title><p>Bilevel programming problems are optimization problems whose feasible set is partially restricted to the solution of another optimization problem. Mathematically speaking, a bilevel problem can be stated by:</p><disp-formula id="scirp.24091-formula112524"><label>(1)</label><graphic position="anchor" xlink:href="5-7400876\b6b3eb72-2080-4183-8d96-a1166b4023fe.jpg"  xlink:type="simple"/></disp-formula><p>where<img src="5-7400876\b7ca826c-be1e-4934-8922-d4f1aa0b298f.jpg" />, <img src="5-7400876\0825c3aa-404c-4a48-908d-95bc76f7558f.jpg" />, <img src="5-7400876\50b0119a-8951-4586-adbd-ffe565676a5f.jpg" />,<img src="5-7400876\f018a728-d6b5-423c-b72c-a868fd68db0a.jpg" />. Eventually, some components of vector y may be free. The sets X and Y are bounded boxes in <img src="5-7400876\ad576fc5-777d-47cf-beff-dbe29309dae9.jpg" /> and <img src="5-7400876\6f8e2c9b-78d6-464d-8ca4-bc8d03b130d7.jpg" /> respectively. We suppose that the gradients of F and H, and the Hessians of f and h exist and are continuous in X &#215; Y. The optimization subproblem appearing in the constraints is called the lower level problem.</p><p>The first formulation of bilevel programming was given in an economical context in [<xref ref-type="bibr" rid="scirp.24091-ref1">1</xref>]. Survey papers on this problem were published in [2,3]. Different approaches about the theory of optimality conditions for bilevel programming problems were introduced in [<xref ref-type="bibr" rid="scirp.24091-ref4">4</xref>]. In [5,6] necessary and sufficient optimality conditions require that the lower level problem has a unique optimal solution.</p><p>Following Dempe [<xref ref-type="bibr" rid="scirp.24091-ref7">7</xref>] algorithms for solving bilevel programming problems can be classified into three categories: the first group solves the problem globally, the second group computes stationary points or points that satisfy some local optimality conditions, and the third group corresponds to heuristic methods. A review of algorithms for globally solving this kind of problems is given in [<xref ref-type="bibr" rid="scirp.24091-ref2">2</xref>].</p><p>Bilevel programming problems are nonconvex optimization problems and for this reason there are difficulties to solve them globally. Therefore, descent methods were developed to compute stationary solutions. For the linear case, see [<xref ref-type="bibr" rid="scirp.24091-ref8">8</xref>]. An important fact assumed in [<xref ref-type="bibr" rid="scirp.24091-ref9">9</xref>] is that the lower level optimal solution is uniquely determined.</p><p>The development of new algorithms and theory of bilevel programming problems is strongly motivated by a large number of applications. For instance, determination of optimal prices [<xref ref-type="bibr" rid="scirp.24091-ref10">10</xref>], aluminium production process [<xref ref-type="bibr" rid="scirp.24091-ref11">11</xref>], electric utility demand-side planning and engineering applications [<xref ref-type="bibr" rid="scirp.24091-ref12">12</xref>]. An overview of applications is given in [<xref ref-type="bibr" rid="scirp.24091-ref13">13</xref>].</p><p>In order to solve bilevel programming problems we will consider the ideas proposed in [14-16], called Inexact Restoration methods (IR). Let us state the nonlinear programming problem in the form:</p><disp-formula id="scirp.24091-formula112525"><label>(2)</label><graphic position="anchor" xlink:href="5-7400876\b82d0edc-610f-44bb-8e4a-e8c2724bf623.jpg"  xlink:type="simple"/></disp-formula><p>where <img src="5-7400876\5674d2ec-658c-45d5-b320-d1488bb05d0d.jpg" /> and <img src="5-7400876\08bd859c-9b29-4b2f-869d-531c79715bac.jpg" />are continuously differentiable and Ω is a polytope. The IR model algorithm generates feasible iterates with respect to Ω. Each iteration includes two different phases: restoration and minimization. In the restoration phase, which is executed once per iteration, an intermediate point (restored point) is found such that its infeasibility is a fraction of the infeasibility of the current point. After restoration we define a linearization of the feasible region π<sub>k</sub> around the restored point. In the minimization phase we compute a trial point belonging to π<sub>k</sub> solving a trust-region subproblem such that the functional value at the trial point is less than the functional value at the restored point. A Lagrangian function can be also used at the minimization phase as it is presented in [16,17]. By means of a merit function, the new iterate is accepted or rejected. In case of rejection, the trust-region radius is reduced and the minimization phase is repeated around the same restored point. The philosophy of IR encourages case-oriented applications. Since IR allows us to choose suitable restoration and minimization procedures, the IR approach is quite appealing in this context.</p><p>Many years ago bilevel programming problems were solved replacing the lower level problem by its KKT conditions, but this presented a serious drawback because many spurious stationary points may appear. On the other hand, one of the reasons for using IR in bilevel programming problems is that the lower level problem may be treated at the restoration phase as an optimization problem. The classical way to find a local solution is to try to solve the lower level problem using optimization strategies that consider the lower objective function. Besides that, notice that when Ω is a polytope, the approximate feasible region π<sub>k</sub> is also a polytope. Thus, the minimization phase consists of solving a linearly constrained optimization problem. Therefore, available algorithms for these kinds of (potentially large-scale) problems can be fully exploited, for example MINOS [<xref ref-type="bibr" rid="scirp.24091-ref18">18</xref>], SNOPT [<xref ref-type="bibr" rid="scirp.24091-ref19">19</xref>] and ALGENCAN [<xref ref-type="bibr" rid="scirp.24091-ref20">20</xref>].</p><p>Our main contribution is to propose a user-friendly environment consisting by a set of Fortran 90 modules to solve a bilevel programming problem using IR without reformulating it as a single-level problem. The package is easily and highly customizable and it is prepared to use two well-tested minimization solvers and different formulations in the minimization subproblem. Other solvers can be easily included with minor changes in the code. The algorithm is based on [<xref ref-type="bibr" rid="scirp.24091-ref6">6</xref>], with additional features: two versions for solving the minimization step and stopping criteria. One of the most attractive features of this environment is the autosetting options. That means that users just need to write Fortran code for the functions involved in the bilevel programming problem, and not to write any code about the algorithm and external solvers. On the other hand, the code is highly configurable, therefore users with expertise on these topics may take advantage of the code structure.</p><p>The code is written mainly in standard Fortran 90, with a few features of standard Fortran 2003. The choice of the language was made because a big number of optimization packages are written either in Fortran 77 or in Fortran 90. Particularly, MINOS and ALGENCAN are written in Fortran 77, which are used in our code.</p><p>We validate our implementation using a set of test problems from the literature, comparing different formulations and the use of the minimization solvers.</p><p>There are several formulations for the bilevel programming problem in the literature with their own code, but not software packages. For example, in [<xref ref-type="bibr" rid="scirp.24091-ref21">21</xref>] genetic algorithms are developed using GAMS [<xref ref-type="bibr" rid="scirp.24091-ref22">22</xref>] and MINOS, in [<xref ref-type="bibr" rid="scirp.24091-ref23">23</xref>] a decomposition based on global optimization approach to bilevel and quadratic programming problems is solved by GAMS/MINOS.</p><p>The most popular available package is BIPA (BIlevel Programming with Approximation methods) [<xref ref-type="bibr" rid="scirp.24091-ref24">24</xref>]. BIPA is a code written in C for solving nonlinear bilevel programming problems. It is a trust-region type method where the subproblem consists in solving a sequence of mixed-integer programs (MIPs) and nonlinear optimization problems. The latter programs are solved using ILOG CPLEX [<xref ref-type="bibr" rid="scirp.24091-ref25">25</xref>] routines and DONLP2 [<xref ref-type="bibr" rid="scirp.24091-ref26">26</xref>] respectively. ILOG CPLEX is a high-performance mathematical programming solver for linear programming, mixed-integer programming, and quadratic programming, and it is mantained by IBM. DONLP2 is a solver for general nonlinear programming problems.</p><p>The paper is structured as follows. In Section 2 a mathematical background of IR methods is given. Section 3 is devoted to explain an algorithm based on IR applied to solve bilevel programming problems. Section 4 refers to the design of the package, and Section 5 shows numerical experiments for a set of test problems. Finally, Section 6 is dedicated to the conclusions.</p></sec><sec id="s2"><title>2. Inexact Restoration Methods</title><p>IR methods have been introduced in the last few years for solving nonlinear programming problems [14-16], due to the drawbacks present in feasible methods. Feasible methods generate a sequence of feasible points that, in the presence of strong nonlinearities, may behave badly. In these cases, it is not appropriate to perform large steps far from the solution, because the nonlinearity forces the distance between consecutive feasible iterates to be very short. On the other hand, short steps far from the solution are not convenient because it may produce slow convergence. IR methods keep infeasibility under control and are tolerant when the iterates are far from the solution. At the end of the algorithm feasibility is preserved since the weight of infeasibility is increased during the process.</p><p>IR methods are intended to solve the following problem</p><disp-formula id="scirp.24091-formula112526"><label>(3)</label><graphic position="anchor" xlink:href="5-7400876\27ca0283-7dc0-4522-8799-b3ca838de78c.jpg"  xlink:type="simple"/></disp-formula><p>where <img src="5-7400876\28133474-5182-4998-b7a6-5dd7dbc117a9.jpg" /> and <img src="5-7400876\b72acfd5-83b7-4f7a-9288-11b50e9e0b5c.jpg" /> are continuously differentiable and <img src="5-7400876\e569d7b1-9745-4b60-bd4b-d53adc0f315a.jpg" /> is a closed and convex set. Each iteration consists of two phases: restoration and minimization. In the restoration phase an intermediate point <img src="5-7400876\a78e1cb2-2544-43ed-9446-7f8e20a2249a.jpg" /> is obtained such that the infeasibility at y<sup>k</sup> is reduced with respect to the infeasibility at x<sup>k</sup>. At the beginning of the minimization phase a linearization π<sub>k</sub> of the feasible region defined by the constraints C(x) = 0 is constructed around the restored point y<sup>k</sup>, that is:</p><disp-formula id="scirp.24091-formula112527"><label>(4)</label><graphic position="anchor" xlink:href="5-7400876\0a166a6f-71bd-470e-a2a5-3d25d3b8ca19.jpg"  xlink:type="simple"/></disp-formula><p>Then, a trial point</p><p><img src="5-7400876\589c7eed-3878-46a1-8f1d-5cc0025f5a5b.jpg" /></p><p>is computed such that<img src="5-7400876\f34a2b0f-22b1-40d4-a26c-3c1375bde9a8.jpg" />. Here <img src="5-7400876\50fbb7ad-21f0-40da-a1b5-816dd875b485.jpg" /> is a trust-region radius. Another formulation [<xref ref-type="bibr" rid="scirp.24091-ref17">17</xref>] solves a minimization problem where the objective function is replaced by its Lagrangian function:</p><disp-formula id="scirp.24091-formula112528"><label>(5)</label><graphic position="anchor" xlink:href="5-7400876\9313580b-8ee8-4ac5-974b-02528ee407de.jpg"  xlink:type="simple"/></disp-formula><p>for all<img src="5-7400876\2528d370-888f-4644-bdfc-39d56e5850d8.jpg" />. In order to accept the trial point <img src="5-7400876\e0e95d5e-a6b4-4c75-b2c3-9af125403378.jpg" /> a penalty merit function is considered:</p><disp-formula id="scirp.24091-formula112529"><label>(6)</label><graphic position="anchor" xlink:href="5-7400876\524ef6c5-819e-45af-b38c-27a2868343fb.jpg"  xlink:type="simple"/></disp-formula><p>where <img src="5-7400876\c02a27d6-fb08-418a-b2e9-483618c126e7.jpg" /> is a penalty parameter defined by a nonmonotone sequence. Instead of the merit function, a filter criterion may be considered to accept the trial point [<xref ref-type="bibr" rid="scirp.24091-ref27">27</xref>]. Until the acceptance condition is satisfied, the trust-region radius is reduced and the minimization problem is solved again.</p><p>The minimization phase is a problem with linear constraints (if Ω is a polytope), therefore any available solver for linearly constrained optimization can be applied. Besides that, the method gives the freedom to formulate each phase and choose the solver in order to take advantage of the structure of the problem. These features make the IR methods very attractive.</p><p>There exist convergence results for the sequence generated by the IR methods under mild hypotheses [14,15].</p></sec><sec id="s3"><title>3. IR Bilevel Algorithm</title><p>Let us consider, without loss of generality, the following problem:</p><disp-formula id="scirp.24091-formula112530"><label>(7)</label><graphic position="anchor" xlink:href="5-7400876\4c95c526-d30b-4f6f-b88c-1598bb7d3f52.jpg"  xlink:type="simple"/></disp-formula><p>We write the KKT conditions of the lower level problem in the form</p><disp-formula id="scirp.24091-formula112531"><label>(8)</label><graphic position="anchor" xlink:href="5-7400876\89e25f12-4835-4c9d-8c3e-9ed3ddb66364.jpg"  xlink:type="simple"/></disp-formula><p>where <img src="5-7400876\9a5d1b32-c4f4-48bf-8afa-1213b49f0922.jpg" /> and<img src="5-7400876\29689b45-e55f-4993-a0aa-883d0963eb63.jpg" />. Based on [<xref ref-type="bibr" rid="scirp.24091-ref6">6</xref>] we propose the following algorithm:</p><sec id="s3_1"><title>3.1. Algorithm</title><p>Set the algorithmic parameters tol, M &gt; 0, <img src="5-7400876\15b6cd5d-685d-40e0-8c36-2d333b188d53.jpg" />, <img src="5-7400876\ba566c3d-8a8a-43bb-9b34-566fd558886d.jpg" />, <img src="5-7400876\a46a23e9-ed9b-401e-9535-edfa3c4d3f9b.jpg" />, {w<sub>k</sub>} a summable sequence of positive numbers, and initial approximations x<sub>0</sub>, y<sub>0</sub>, γ<sub>0</sub> and λ<sub>0</sub> (initial Lagrangian multiplier estimators).</p><p>Step 1. At iteration k, set</p><p><img src="5-7400876\1d5f58b6-219b-44b2-92de-fd2597cd97c2.jpg" />,</p><p><img src="5-7400876\f1199525-b4b1-496d-a19b-834b54cdbe6e.jpg" /></p><p>Step 2. Restoration phase. Find y<sup>R</sup>, μ<sup>R</sup>and γ<sup>R</sup> such that</p><p><img src="5-7400876\4043d6ad-fb22-44d3-93cd-a02d9f343915.jpg" /></p><p>Step 3. Minimization phase. Set i ← 0 and choose <img src="5-7400876\cf054f2b-8450-4aa8-ae61-badf0f1284c0.jpg" />Compute a trial point <img src="5-7400876\c74e7517-c691-4059-b9eb-af67441e300f.jpg" /> as the solution of the following problem</p><p><img src="5-7400876\f8789635-5605-432b-b0c0-4e87bb92955f.jpg" /></p><p><img src="5-7400876\bfc5ecfc-ba85-47c4-be48-7eba9753b8de.jpg" /></p><p><img src="5-7400876\bc43a9a6-a6e7-4710-a059-fc17a628455c.jpg" /></p><p>For the Lagrangian formulation, change the objective function by the Lagrangian function</p><p><img src="5-7400876\7424865c-fdc9-497b-a1c0-01c5143828a2.jpg" /></p><p>with<img src="5-7400876\5fab3c9a-4c05-4ddb-9270-a6e5ba20c4bd.jpg" />.</p><p>Step 4. Update the Lagrangian multipliers (only for the Lagrangian formulation). Compute a trial <img src="5-7400876\59045fa8-c7a6-446e-a942-d965f15b0aca.jpg" />such that <img src="5-7400876\90ef55b9-3e60-4135-becb-7a87e9b8bcb0.jpg" /></p><p>Step 5. Predicted reduction. Compute <img src="5-7400876\207696dd-e99b-48e9-ae53-61099cec623b.jpg" /> as the maximum <img src="5-7400876\d1d72869-43ce-4c37-9d33-fb8bd81e67d2.jpg" /> such that</p><p><img src="5-7400876\568c52a0-2769-4cae-b44d-fc727c09d8c5.jpg" /></p><p>where</p><p><img src="5-7400876\77c5ffa9-89a3-4709-bbb0-fd311977c34d.jpg" /></p><p>For the Lagrangian formulation the predicted reduction is defined by</p><p><img src="5-7400876\bdcabe34-a574-4194-aec6-4273a6f41acb.jpg" /></p><p>Set<img src="5-7400876\40a20d9e-6472-4d29-aea2-32abbdcd1342.jpg" />.</p><p>Step 6. Actual reduction. Compute</p><p><img src="5-7400876\239c6780-3e9b-4349-a5f2-b8a27e84185e.jpg" /></p><p>For the Lagrangian formulation, the actual reduction is defined by</p><p><img src="5-7400876\f0a91cc5-d349-499a-9949-4b3d17f443a8.jpg" /></p><p>Step 7. Acceptance and stopping criteria. See the algorithm described below.</p></sec><sec id="s3_2"><title>3.2. Acceptance and Stopping Criteria</title><p>We wish that the merit function at the trial point should be less than the merit function at the current point, that is,<img src="5-7400876\875bf264-6222-4318-9500-c04fa6fd5e35.jpg" />. However, as in unconstrained optimization a reduction of the merit function is not enough to guarantee convergence. In fact, we need a sufficient reduction of the merit function, that is defined by the following test:</p><p><img src="5-7400876\6b618d08-da05-4d6b-a840-59e32958d6c1.jpg" /></p><p>If this test holds, we accept the trial point as a new approximation and terminate iteration k. Otherwise, we reduce the trust-region radius and repeat the minimization phase.</p><p>The stopping criteria proposed here consists of a comparison between two successive approximations of either the sequence<img src="5-7400876\461d26be-5714-434d-b30e-a96d7e9fd7f4.jpg" />, or the sequence of functional values<img src="5-7400876\3d11314f-fdb7-46b5-9741-b48e6a17dd24.jpg" />, and a feasibility test using the KKT conditions of the lower level problem and the upper level constraints (if there exist).</p><p>We remark that the new stopping criteria is different from the criteria used in [<xref ref-type="bibr" rid="scirp.24091-ref1">1</xref>], where a nonlinear minimization problem has to be solved in each iteration and this could be computationally expensive. Moreover, the numerical experiments validate the proposed procedure.</p><p>The proposed stopping criteria is:</p><p>if <img src="5-7400876\19af69ad-2ab1-4765-b975-61b6e290e768.jpg" /> then</p><p>set<img src="5-7400876\de208c7a-a5b3-45fc-971a-b56eacb881ad.jpg" />, <img src="5-7400876\f8370bf0-06ae-4a74-b5f6-e5e1a55aa6b0.jpg" />and</p><p>repeat minimization phase (Step 3)</p><p>else</p><p>compute</p><p><img src="5-7400876\dc3162e1-d332-4134-a576-06c1b11991a1.jpg" /></p><p><img src="5-7400876\e95a9747-aae5-4aa1-9ead-b7c1428393d2.jpg" /></p><p>set<img src="5-7400876\b8826d21-143f-44d9-93c2-4e037b048322.jpg" />,</p><p><img src="5-7400876\b6e0a60d-b09e-4ef9-95ac-d73a4f736b60.jpg" />, <img src="5-7400876\cae5a539-838e-4fad-91b9-8f2e4ec9a1c0.jpg" /></p><p>set <img src="5-7400876\2d7decea-db6c-49c2-8157-21f04491b7da.jpg" /></p><p>if <img src="5-7400876\ae7efa64-0b41-496e-9cb0-e73ceb565267.jpg" /> or <img src="5-7400876\11e8e011-4eeb-4923-92f1-3dc06a153618.jpg" />then</p><p>if <img src="5-7400876\86097a28-6787-42e6-9bfa-170a5878939c.jpg" /> then</p><p>Terminate declaring finite convergence</p><p>Otherwise Return to restoration phase</p><p>(Step 2)</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;end</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;else</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Return to restoration phase (Step 2)</p><p>&#160;&#160;&#160;&#160;&#160;end</p><p>&#160;&#160;end</p></sec></sec><sec id="s4"><title>4. Design</title><p>The software environment presented here consists of a set of modules, mainly in standard Fortran 90, that solves the bilevel programming problem using an IR formulation. The algorithm is based on the ideas of [<xref ref-type="bibr" rid="scirp.24091-ref6">6</xref>] with a new stopping criterion and two optional procedures for the minimization phase. The code is able to solve restoration and minimization phases by means of two optimization solvers: MINOS and ALGENCAN. MINOS has been extensively used for many years and it is one of the most known codes in optimization, becoming a reference in this area. Although MINOS is a commercial software, our code can be compiled using ALGENCAN instead of MINOS (ALGENCAN can be freely downloaded). Other solvers could be included with minor changes. Each problem can be configured in only one module with its own setting options (default or advanced) independently of the rest of the code. A list of capabilities is described below:</p><p>Modularity: the modules can be classified into categories: 1) sizes, bounds and initial conditions; 2) default algorithmic parameters like solver and formulation choices, tolerances, etc.; 3) variables of the external solvers; 4) variables from different phases; 5) definition of the problem (this is the only one module provided by the user); 6) modules related to the bilevel algorithm (completely independent of the problem and external solvers).</p><p>Simplicity: there are no derived types of variables defined in the code. The code has been prepared for both an expert programmer as well as for a medium programmer.</p><p>Language: the modules are programmed in standard Fortran 90 with a very few features of standard Fortran 2003 (for instance, array constructors) for easier data input. It has been successfully compiled and executed with the Intel Fortran Compiler, Portland Fortran Compiler, GNU Fortran and G95.</p><p>Configurability: there are two possible configurations: default and advanced. The default configuration only requires to set problem sizes, initial conditions and the functions involved in the problem. The advanced configuration needs the requirements of the default configuration and allows to modify one or several default parameters and procedures, for instance:</p><p>-&#160;&#160;&#160;&#160;&#160;&#160; external solver (MINOS or ALGENCAN);</p><p>-&#160;&#160;&#160;&#160;&#160;&#160; Lagrangian or non Lagrangian formulation;</p><p>-&#160;&#160;&#160;&#160;&#160;&#160; solver settings for restoration or minimization phases;</p><p>-&#160;&#160;&#160;&#160;&#160;&#160; function settings for restoration or minimization phases;</p><p>-&#160;&#160;&#160;&#160;&#160;&#160; KKT conditions of the lower level problem and the upper level constraints;</p><p>Precision: the code handles double precision real variables, because the external solvers (MINOS and ALGENCAN) handle double precision real variables by default.</p></sec><sec id="s5"><title>5. Numerical Experiments</title><p>In this section we illustrate the use of our software to solve a particular bilevel programming problem. Besides that, we consider a set of test problems from the literature and present numerical results for different parameters and options of our code (i.e. external solvers, formulations, etc.).</p><sec id="s5_1"><title>5.1. Sample Application</title><p>We consider the problem BIPA2 from [<xref ref-type="bibr" rid="scirp.24091-ref24">24</xref>]:</p><p><img src="5-7400876\74b9732a-6a40-43c3-bbf1-61d72d27353e.jpg" /></p><p>We add slack variables and rewrite the problem in the following standard form:</p><p><img src="5-7400876\a4820553-4dc4-4790-b7d0-af5232f12092.jpg" /></p><p>where x = (x<sub>1</sub>) and y = (y<sub>1</sub>, y<sub>2</sub>, y<sub>3</sub>, y<sub>4</sub>).</p><p>Specific settings may require additional information for the restoration and minimization phases, for example the calculation of the function <img src="5-7400876\1c3e5219-4bfc-4edc-aeaa-2de101e557fd.jpg" /> (see Equation (8)) representing the KKT conditions of the lower level problem and its Jacobian matrix<img src="5-7400876\04709657-30f3-423a-a039-acdf97c0314c.jpg" />:</p><p><img src="5-7400876\19abbb7f-225b-40ec-90a2-7ad88a44c5af.jpg" /></p><p><img src="5-7400876\1fcf399b-1173-4d17-9981-cd5a83982918.jpg" /></p><p>In order to avoid messy computations to obtain functions C and C', or the solver settings, users can choose the default configuration, in which only the problem data has to be given. In case of a complex problem, the default configuration is a good option to prevent human errors.</p><p>The next subsection contains a number of other examples. For programming details please refer to the user manual that accompanies the software.</p></sec><sec id="s5_2"><title>5.2. Additional Test Problems</title><p><xref ref-type="table" rid="table1">Table 1</xref> reports test problems from literature. The first column indicates the problem as it is referenced in the last column. The numbers n, m, q and p are the same than in (1).</p><p>Most of these problems belong to the test problem collection in [<xref ref-type="bibr" rid="scirp.24091-ref28">28</xref>]. Initial points are given in <xref ref-type="table" rid="table1">Table 1</xref>. All tests were performed in a PC running Linux, Core 2 Duo, 2.0GHz, 3Gb RAM, with the following Fortran compilers: Intel Fortran Compiler, G95, GNU Fortran and Portland Compiler.</p><p>In all cases the solution was successfully found in a small number of iterations (except problem 9.2.05 that converged in 43 iterations) and agrees with the reported solution (see <xref ref-type="table" rid="table2">Table 2</xref>). Notice that these results were obtained using the default configuration. The main default setting parameters are:</p><p>-&#160;&#160;&#160;&#160;&#160;&#160; External solver: MINOS.</p><p>-&#160;&#160;&#160;&#160;&#160;&#160; IR formulation: without using the Lagrangian formulation.</p><p>-&#160;&#160;&#160;&#160;&#160;&#160; All of the solver dependent functions are automatically set.</p><p>For a complete list of setting parameters, please refer to the user manual.</p><p>All the problems in <xref ref-type="table" rid="table2">Table 2</xref> were tested with advanced configurations, for example using a user setting function C. The same results were obtained using other formulations, for instance, ALGENCAN as the external solver and the Lagrangian function. The numerical results agree in all cases unless the number of iterations, due to internal formulations.</p><p>In all cases the CPU time was negligible, therefore no comparison with other solvers could be made.</p></sec></sec><sec id="s6"><title>6. Conclusions</title><p>The main idea behind this work is to provide an environment in order to solve general bilevel programming problems. One of the most important features of our implementation besides portability is to provide a userfriendly code. At the same time the code is intended to be highly configurable to exploit the best characteristics of both the problems and external solvers. This environment,</p><table-wrap-group id="1"><label><xref ref-type="table" rid="table1">Table 1</xref></label><caption><title> Test problems</title></caption></table-wrap-group><table-wrap-group id="2"><label><xref ref-type="table" rid="table2">Table 2</xref></label><caption><title> Numerical experiments for test problems with the default configuration</title></caption></table-wrap-group><p>in the case of the default configuration, supplies all the necessary tools to automatically set the auxiliary subroutines and solvers. Therefore, it allows a cleaner and shorter coding and avoids a lot of human errors.</p><p>The bilevel algorithm based on the inexact restoration method has appealing theoretical properties, in the sense that under certain hypotheses, convergence is assured [<xref ref-type="bibr" rid="scirp.24091-ref1">1</xref>]. This feature is a remarkably advantage over other packages that solve bilevel programming problems without convergence results. To solve each phase of the inexact restoration algorithm adapted to bilevel programming problems, external solvers are needed. In our case we use two packages (MINOS and ALGENCAN), however, other solvers can be added with minor changes in the source code. We decided not to mix different solvers for the restoration and minimization phases, because they are based on different philosophies. For instance, MINOS uses factorizations and ALGENCAN exploits matrix-vector products.</p><p>Finally, numerical results are promising since different kinds of bilevel programming problems (linear, quadratic and nonlinear) have been successfully solved. Several tests have been carried out using different algorithmic parameters and configurations with the same results, with similar execution time.</p><p>The source code and the user manual can be obtained from the authors’ electronic addresses.</p></sec><sec id="s7"><title>REFERENCES</title></sec></body><back><ref-list><title>References</title><ref id="scirp.24091-ref1"><label>1</label><mixed-citation publication-type="other" xlink:type="simple">H. V. Stackelberg, “Marktform and Gleichgewicht,” Springer-Verlag, Berlin, 1934.</mixed-citation></ref><ref id="scirp.24091-ref2"><label>2</label><mixed-citation publication-type="other" xlink:type="simple">J. F. Bard, “Practical Bilevel Optimization: Algorithms and Applications,” Kluwer Academic Publishers, Dordrecht, 1998.</mixed-citation></ref><ref id="scirp.24091-ref3"><label>3</label><mixed-citation publication-type="other" xlink:type="simple">L. N. Vicente, “Bilevel Programming: Introduction, History, and Overview,” In: Encyclopedia of Optimization, Kluwer Academic Publishers, Dordrecht, 2001, pp. 24-31. doi:10.1007/0-306-48332-7_38</mixed-citation></ref><ref id="scirp.24091-ref4"><label>4</label><mixed-citation publication-type="other" xlink:type="simple">S. Dempe, “Foundations of Bilevel Programming,” Kluwer Academic Publishers, Dordrecht, 2002.</mixed-citation></ref><ref id="scirp.24091-ref5"><label>5</label><mixed-citation publication-type="other" xlink:type="simple">S. Dempe, “A Necessary and a Sufficient Optimality Condition for Bilevel Programming Problems,” Optimization, Vol. 25, No. 4, 1992, pp. 341-354. 
doi:10.1080/02331939208843831</mixed-citation></ref><ref id="scirp.24091-ref6"><label>6</label><mixed-citation publication-type="other" xlink:type="simple">R. Andreani, S. L. C. Castro, J. L. Chela, A. Friedlander and S. A. Santos, “An Inexact-Restoration Method for Nonlinear Bilevel Programming Problems,” Computational Optimization and Applications, Vol. 43, No. 3, 2009, pp. 307-328. doi:10.1007/s10589-007-9147-4</mixed-citation></ref><ref id="scirp.24091-ref7"><label>7</label><mixed-citation publication-type="other" xlink:type="simple">S. Dempe, “Annottated Bibliography on Bilevel Programming and Mathematical Problems with Equilibrium Constraints,” Optimization, No. 52. No. 3, 2003, pp. 333-359. doi:10.1080/0233193031000149894</mixed-citation></ref><ref id="scirp.24091-ref8"><label>8</label><mixed-citation publication-type="other" xlink:type="simple">S. Dempe, “A Simple Algorithm for the Linear Bilevel Programming Problem,” Optimization, No. 18, No. 3, 1987, pp. 373-385. doi:10.1080/02331938708843247</mixed-citation></ref><ref id="scirp.24091-ref9"><label>9</label><mixed-citation publication-type="other" xlink:type="simple">J. E. Falk and J. Liu, “Annotated Bibliography on Bilevel Programming and Mathematical Programs with Equilibrium Constraints,” Central European Journal of Operations Research, Vol. 52, No. 2, 1993, pp. 101-117.</mixed-citation></ref><ref id="scirp.24091-ref10"><label>10</label><mixed-citation publication-type="other" xlink:type="simple">L. Brotcorne, M. Labbè, P. Marcotte and G. Savard, “A Bilevel Model and Solution Algorithm for a Freight Tariff Setting Problem,” Transportation Science, Vol. 34, No. 3, 2000, pp. 289-302. doi:10.1287/trsc.34.3.289.12299</mixed-citation></ref><ref id="scirp.24091-ref11"><label>11</label><mixed-citation publication-type="other" xlink:type="simple">M. G. Nicholls, “The Application of Nonlinear Bilevel Programming to the Aluminium Industry,” Journal of Global Optimization, Vol. 8, No. 3, 1996, pp. 245-261. doi:10.1007/BF00121268</mixed-citation></ref><ref id="scirp.24091-ref12"><label>12</label><mixed-citation publication-type="other" xlink:type="simple">J. Herskovits, A. Leontiev, G. Dias and G. Santos, “Contact Shape Optimization: A Bilevel Programming Approach,” Structural and Multidisciplinary Optimization, Vol. 20, No. 3, 2000, pp. 214-221.</mixed-citation></ref><ref id="scirp.24091-ref13"><label>13</label><mixed-citation publication-type="other" xlink:type="simple">P. Marcotte and G. Savard, “Bilevel Programming: Applications,” In: Encyclopedia of Optimization, Kluwer Academic Publishers, Dordrecht, 2001.  
doi:10.1007/0-306-48332-7_33 </mixed-citation></ref><ref id="scirp.24091-ref14"><label>14</label><mixed-citation publication-type="other" xlink:type="simple">J. M. Martínez, “Two-Phase Model Algorithm with Global Convergence for Nonlinear Programming,” Journal of Optimization Theory and Applications, Vol. 96, No. 2, 1998, pp. 397-436. doi:10.1023/A:1022626332710</mixed-citation></ref><ref id="scirp.24091-ref15"><label>15</label><mixed-citation publication-type="other" xlink:type="simple">J. M. Martínez and E. A. Pilotta, “Inexact Restoration Algorithm for Constrained Optimization,” Journal of Optimization Theory and Applications, Vol. 104, No. 1, 2000, pp. 135-163. doi:10.1023/A:1004632923654</mixed-citation></ref><ref id="scirp.24091-ref16"><label>16</label><mixed-citation publication-type="other" xlink:type="simple">J. M. Martínez and E. A. Pilotta, “Inexact Restoration Methods for Nonlinear Programming: Advances and Perspectives,” In: L. Q. Qi, K. Teo and X. Q. Yang, Eds., Optimization and Control with Applications, Applied Optimization Series, Chapter 12, Springer, Netherlands, 2005, pp. 271-292.</mixed-citation></ref><ref id="scirp.24091-ref17"><label>17</label><mixed-citation publication-type="other" xlink:type="simple">E. G. Birgin and J. M. Martínez, “Local Convergence of an Inexact-Restoration Method and Numerical Experiments,” Journal of Optimization Theory and Applications, Vol. 127, No. 2, 2005, pp. 229-247.  
doi:10.1007/s10957-005-6537-6</mixed-citation></ref><ref id="scirp.24091-ref18"><label>18</label><mixed-citation publication-type="other" xlink:type="simple">B. A. Murtagh and M. A. Saunders, “Large-Scale Linearly Constrained Optimization,” Mathematical Programming, Vol. 14, No. 1, 1978, pp. 41-72.  
doi:10.1007/BF01588950</mixed-citation></ref><ref id="scirp.24091-ref19"><label>19</label><mixed-citation publication-type="other" xlink:type="simple">W. Murray, P. E. Gill and M. A. Saunders, “SNOPT: An SQP Algorithm for Large-Scale Constrained Optimization,” SIAM Journal on Optimization, Vol. 12, No. 4, 2002, pp. 979-1006.</mixed-citation></ref><ref id="scirp.24091-ref20"><label>20</label><mixed-citation publication-type="other" xlink:type="simple">E. G. Birgin and J. M. Martínez, “Large-Scale Active-Set Box-Constrained Optimization Method with Spectral Projected Gradients,” Computational Optimization and Applications, Vol. 23, No. 1, 2002, pp. 101-125.  
doi:10.1023/A:1019928808826</mixed-citation></ref><ref id="scirp.24091-ref21"><label>21</label><mixed-citation publication-type="other" xlink:type="simple">S. R. Hejazi, A. Memariani, G. Jahanshahloo and M. M. Sepehri, “Linear Bilevel Programming Solution by Genetic Algorithm,” Computers &amp; Operations Research, Vol. 29, No. 13, 2002, pp. 1913-1925.  
doi:10.1016/S0305-0548(01)00066-1</mixed-citation></ref><ref id="scirp.24091-ref22"><label>22</label><mixed-citation publication-type="other" xlink:type="simple">GAMS, http://www.gams.com/</mixed-citation></ref><ref id="scirp.24091-ref23"><label>23</label><mixed-citation publication-type="other" xlink:type="simple">V. Visweswaran, C. A. Floudas, M. G. Ierapetritou and E. N. Pistikopoulos, “State of the Art in Global Optimization: Computational Methods and Applications,” Kluwer Academic Publishers, Dordrecht, 1996.</mixed-citation></ref><ref id="scirp.24091-ref24"><label>24</label><mixed-citation publication-type="other" xlink:type="simple">B. Colson, P. Marcotte and G. Savard, “A Trust-Region Method for Nonlinear Bilevel Programming: Algorithm and Computational Experience,” Computational Optimization and Applications, Vol. 30, No. 3, 2005, pp. 211-227. doi:10.1007/s10589-005-4612-4</mixed-citation></ref><ref id="scirp.24091-ref25"><label>25</label><mixed-citation publication-type="other" xlink:type="simple">CPLEX http://www-01.ibm.com/software/integration/optimization/cplex-optimizer/</mixed-citation></ref><ref id="scirp.24091-ref26"><label>26</label><mixed-citation publication-type="other" xlink:type="simple">P. Spellucci, “An SQP Method for General Nonlinear Programs Using Only Equality Constrained Subproblems,” Mathematical Programming, Vol. 82, No. 3, 1998, pp. 413-448. doi:10.1007/BF01580078</mixed-citation></ref><ref id="scirp.24091-ref27"><label>27</label><mixed-citation publication-type="other" xlink:type="simple">E. Karas, E. Pilotta and A. Ribeiro, “Numerical Comparison of Merit Function with Filter Criterion in Inexact Restoration Algorithms Using Hard-Spheres Problems,” Computational Optimization and Applications, Vol. 44, No. 3, 2009, pp. 427-441.  
doi:10.1007/s10589-007-9162-5</mixed-citation></ref><ref id="scirp.24091-ref28"><label>28</label><mixed-citation publication-type="other" xlink:type="simple">C. A. Floudas, P. M. Pardalos, C. S. Adjiman, W. R. Esposito, Z. Gumus, S. T. Harding, J. L. Klepeis, C. A. Meyer and C. A. Schweiger, “Handbook of Test Problems for Local and Global Optimization,” Kluwer Academic Publishers, Dordrecht, 1999.  
doi:10.1007/BF01585928</mixed-citation></ref><ref id="scirp.24091-ref29"><label>29</label><mixed-citation publication-type="other" xlink:type="simple">J. E. Falk and J. Liu, “On Bilevel Programming, Part I: General Nonlinear Cases,” Mathematical Programming, Vol. 70, No. 1, 1995, pp. 47-72.</mixed-citation></ref><ref id="scirp.24091-ref30"><label>30</label><mixed-citation publication-type="other" xlink:type="simple">Z. H. Gumus and C. A. Floudas, “Global Optimization of Nonlinear Bilevel Programming Problems,” Journal of Global Optimization, Vol. 20, No. 1, 2001, pp. 1-31. 
doi:10.1023/A:1011268113791</mixed-citation></ref><ref id="scirp.24091-ref31"><label>31</label><mixed-citation publication-type="other" xlink:type="simple">K. Shimizu, Y. Ishizuka, and J. F. Bard, “Nondifferentiable and Two-Level Mathematical Programming,” Kluwer Academic Publishers, 1997.  
doi:10.1007/978-1-4615-6305-1</mixed-citation></ref></ref-list></back></article>