Previous Article in Journal
Hyperchaotic Network Synchronization via Green-AI Metaheuristics: A Performance Comparison of Quantum and Bio-Inspired Solvers
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Interior-Point Optimization for Engineering Design: Implementation of the Karmarkar Algorithm in Structural and Water Resource Problems

by
José Flores-Salinas
1,*,
Cecilia Rios-Varillas
1,
Freddy Tineo-Córdova
1,
Julio Cabrera-Chávez
2,
Jesús Cernades-Gómez
3,
Juan Villalobos-Solano
4,
Sonia Escalante-Huamaní
5 and
Blanca Laines-Lozano
6
1
Faculty of Chemical and Textile Engineering, National University of Engineering, Lima 15333, Peru
2
Faculty of Environmental Engineering, National University of Engineering, Lima 15333, Peru
3
Faculty of Industrial and Systems Engineering, National University of Engineering, Lima 15333, Peru
4
Faculty of Economic Engineering, Statistics, and Social Sciences, National University of Engineering, Lima 15333, Peru
5
Faculty of Economics and Finance, Universidad del Pacífico, Lima 15072, Peru
6
Department of Sciences, Universidad Peruana de Ciencias Aplicadas, Lima 15023, Peru
*
Author to whom correspondence should be addressed.
Algorithms 2026, 19(6), 479; https://doi.org/10.3390/a19060479 (registering DOI)
Submission received: 10 May 2026 / Revised: 29 May 2026 / Accepted: 6 June 2026 / Published: 13 June 2026
(This article belongs to the Topic AI Agents: Progress, Architecture, and Applications)

Abstract

Although interior-point methods (IPMs) have transformed mathematical programming since 1984, the original projective Karmarkar algorithm is rarely documented step by step on reproducible engineering examples that combine algorithmic transparency with real resource allocation constraints. This article therefore does not propose a new variant of Karmarkar’s algorithm; rather, its scientific contribution is the reproducible MATLAB implementation, canonical-form conversion, and comparative validation of the original projective method against the revised Simplex method and Barnes’ affine scaling variant in two engineering settings. The case studies are (i) the minimum-weight plastic design of a rigid frame with seven candidate plastic hinge locations and six collapse mechanisms and (ii) the optimal allocation of crop patterns in the Caplina Valley (Tacna, Southern Peru), an arid irrigated system with an irrigated command area of 1253 ha, monthly labor availability of 22,239 jornales, and water availability derived from Caplina River discharges at 75% persistence. For Case I, the algorithm reached F = 1.001 in the normalized dual space, which corresponds to F = 4.251 in the original structural objective after applying the scaling factor 17/4; relative to the analytical optimum F* = 4.25, this gives |4.251 − 4.25|/4.25 = 2.4 × 10−4 after 20 iterations. For Case II, the model yielded the maximum net production value of USD 703,135.92, allocating 948.47 ha among 12 crops while satisfying water, labor, market, and land constraints. The double validation confirms the algorithm’s strictly interior trajectory, polynomial-time rationale, and transparent internal parameters (α = 0.7968, ε = 10−8), making the implementation a reproducible benchmark for educational use and for future AI–operations research hybrid solvers in regions with limited access to commercial optimization software.

1. Introduction

Linear programming is one of the most influential mathematical languages in modern engineering, as it allows design, allocation, and planning decisions to be represented by a linear objective function subject to linear constraints. This structure transforms physically distinct problems—such as the minimum sizing of a structure or the optimal distribution of water resources among crops—into computationally comparable and reproducible models [1]. In this sense, linear programming should not be understood solely as a computational technique, but as an abstraction framework that translates physical, economic, and operational constraints into a feasible region over which one can reason rigorously. Dantzig’s Simplex method historically established linear programming as a practical tool by traversing adjacent vertices of the feasible polytope until an optimal solution is reached [2]. Its empirical strength explains why it remains a benchmark for small and medium-sized problems, especially when the economic interpretation of basic variables, active constraints, and shadow prices is required [3]. However, the possibility that Simplex could exhibit exponential complexity in the worst case spurred the search for alternative algorithms with polynomial guarantees, leading to a profound transformation in the theory and practice of optimization [4].
Karmarkar’s algorithm marked a turning point in this evolution by proposing a polynomial method for linear programming that does not advance along the boundary of the polytope but through its interior [5]. Its central contribution was to combine a projective transformation with a descent direction that strictly maintains positive feasibility, which allowed for the linking of complexity guarantees to an interpretable geometric mechanism [6]. Unlike a purely historical reading, the algorithm’s current interest lies in the fact that it explicitly demonstrates how the normalization, centering, and reduction of a potential function can iteratively lead to the optimum without resorting to classical pivoting [7]. Karmarkar’s geometric interpretation remains relevant because it helps to explain an essential conceptual difference between vertex-based methods and interior-point methods. While Simplex successively identifies extreme solutions, interior methods preserve a trajectory within the feasible region and approach the optimum through scaling, barrier, or projection transformations [8]. This difference does not imply that one approach is universally superior to the other; rather, it indicates that each algorithmic family offers distinct advantages depending on the problem size, degree of degeneracy, matrix structure, and analysis objective [9].
Interior-point methods have evolved from the original projective algorithm into primal-dual variants, barrier methods, path-following approaches, and conic formulations widely used in modern solvers [10]. Recent reviews highlight that their impact is particularly significant in large-scale problems, conic programming, column generation, decomposition, and models where the algebraic structure can be exploited to reduce computational costs [11]. Therefore, an explicit implementation of Karmarkar retains scientific and pedagogical value and allows for the step-by-step observation of mechanisms that, in commercial solvers, are often hidden behind highly optimized numerical routines.
Structural design provides a suitable initial setting for evaluating this algorithmic transparency. In ultimate plastic analysis, equilibrium conditions, collapse mechanisms, and strength limits can be formulated as linear constraints, while weight, volume, or structural costs can be expressed as linear objective functions [12]. This relationship between structural theory and linear programming has remained relevant in more recent formulations of reinforcement optimization, where large-scale plastic design problems require specialized interior-point methods and member generation strategies to handle dense base structures [13]. The structural relevance of the approach also warrants careful discussion. Linear plastic design models are useful for constructing controlled benchmarks and for verifying algorithmic convergence, but they do not, on their own, replace comprehensive checks for stability, buckling, kinematic compatibility, or nonlinear behavior. Studies on practical reinforcement optimization have shown that a linear formulation can generate volume-optimal designs, although it is still necessary to incorporate additional local, nodal, or global stability constraints before translating the results into a constructive design [14]. Therefore, the structural case in this study should be interpreted as a mathematically controlled benchmark for evaluating the algorithm and not as a comprehensive prescriptive design guide.
Agricultural planning under water scarcity represents a second scenario in which linear programming remains highly relevant in practice. A recent review of agricultural models based on linear programming shows that these models focus primarily on three areas: crop and land use allocation, irrigation scheduling, and economic optimization under resource constraints [15]. The applied literature confirms that agricultural optimization under water scarcity is not merely an accounting exercise but a tool for guiding decisions under real hydrological stresses [16]. In a coastal basin in India, for example, deterministic models and those with probabilistic constraints allowed for the evaluation of cropping patterns and the joint allocation of surface and groundwater in the face of falling groundwater levels and seawater intrusion [17]. In another application, a multi-objective linear programming approach analyzed how water allocation decisions during a drought [18] interact with economic, social, and environmental objectives, showing that resource distribution directly influences the economic impacts of scarcity [19].
The Caplina Valley, in Tacna, represents a context where these tools are particularly relevant. The Caplina/Concordia system is located in the Atacama Desert and operates under extremely low precipitation, meaning that agriculture and part of the human water supply depend on groundwater reserves subject to intense extraction [20]. Hydrogeochemical evidence at La Yarada has identified processes of salinization, marine intrusion, fertilizer leaching, and quality deterioration, indicating that volumetric water availability is not the only relevant constraint on agricultural production [21]. The pressure on the Caplina/Concordia aquifer also has a dynamic and transboundary dimension. A three-dimensional hydrogeological model projected that the system would remain in unsustainable conditions under various management and climate scenarios, with further declines in the water table and expansion of the marine wedge during the forecast period [20]. Complementarily, recent machine learning-based studies have linked the expansion of the irrigated area to aquifer drawdown in a hyper-arid region with scarce data, reinforcing the need for decision models that integrate agricultural production and hydrological limits [22].
Despite the maturity of linear programming and interior-point methods, four specific gaps justify this study. First, many engineering applications report final solutions from commercial solvers without exposing the algorithmic trajectory, the transformations that preserve feasibility, or the numerical parameters that control convergence, which limits reproducibility and methodological learning. Second, the original projective Karmarkar algorithm is now less frequently demonstrated than modern primal-dual interior-point variants, although it remains foundational for understanding the transition from vertex pivoting to interior optimization. Third, few studies present, in one reproducible workflow, both a controlled structural benchmark with an analytical optimum and a real agricultural allocation problem in an arid Latin American basin. Fourth, the available applied literature seldom documents how minimization and maximization models are converted into Karmarkar canonical form before being solved in MATLAB.
Consequently, the objective of this paper is deliberately methodological and reproducibility-oriented. We implement Karmarkar’s original projective algorithm in MATLAB R2023a (MathWorks, Natick, MA, EE. UU.), document the conversion of the original models into Karmarkar canonical form (KCF), and evaluate the same computational core on two engineering problems with distinct physical interpretations but a common linear programming structure. The contribution is therefore not an algorithmic modification of Karmarkar’s method but an auditable implementation and validation protocol that clarifies how the canonical transformation, projective descent direction, step size choice, and back-transformation operate in practice. The first case corresponds to the minimum-weight plastic design of a rigid portal frame, where the analytical optimum permits the direct verification of convergence and relative errors. The second case concerns optimal crop allocation in the Caplina Valley, Tacna, Peru, where alternatives are optimized under monthly water, labor, market, and land constraints. The specific objectives are as follows: to formalize a reproducible implementation of the projective algorithm; to explain the conversion of minimization and maximization models to KCF; to compare its behavior with the revised Simplex method and Barnes’ affine scaling method; and to interpret the results from structural optimization, agricultural water management, and decision support perspectives.

2. Materials and Methods

2.1. Karmarkar’s Canonical Form and Projective Transformation

The linear programming problem is expressed in Karmarkar canonical form (KCF) as the minimization problem in Equations (1) and (2):
m i n   c T x
s . t .   A x = 0 , e T x = 1 , x 0
where A ∈ ℝ{m×n} is of full rank, e = (1,1,…,1)T ∈ ℝn, x > 0 is maintained during the interior iterations, and the optimum is shifted so that z* = 0 when required by the canonical representation. The current iterate xk is mapped to the centroid e/n of the simplex through the projective transformation T(x) in Equation (3), using Dk = diag(xk).
T ( x ) = D k 1 x e T D k 1 x
In the transformed space, the matrices are redefined as  = A Dk and ĉ = Dk c. The feasibility of the equality constraints is preserved by constructing the augmented matrix B_k in Equation (4) and the orthogonal projector Pk in Equation (5), which projects the transformed objective direction onto the null space of Bk.
B k = [ A ^ e T ]
P k = I B k T ( B k B k T ) 1 B k
The projected descent direction is pk = Pk ĉ. The next point in the simplex is computed by Equation (6), where r = 1/√(n(n − 1)) is the radius of the largest Euclidean ball inscribed in the standard simplex and α controls the fraction of this radius used at each step.
y k + 1 = e n α r p k p k
The updated point in the original variable space is recovered by the inverse projective transformation in Equation (7). Convergence is monitored through the canonical objective and by the decrease in Karmarkar’s potential function in Equation (8).
x k + 1 = D k y k + 1 e T D k y k + 1
Karmarkar’s potential function is given by Equation (8):
f ( x ) = n l n ( c T x ) j = 1 n l n ( x j )

2.2. Implementation in MATLAB

The Algorithm 1 was implemented in MATLAB R2023a (single-thread, double precision) on a workstation equipped with an Intel Core i7-12700, 32 GB RAM, and Ubuntu 22.04. The implementation is organized into six MATLAB scripts: karjfs.m (driver), optkar.m (parameters α and ε), maxkarc.m and minkarc.m (canonical-form solvers), kare.m (standard-form model A x ≥ b), and karfo.m (finite-optimum standard form A x = b). A reference implementation of Barnes’ affine scaling variant was also produced in barnes.m for benchmarking. The numerical implementation follows the documented projective-scaling computational literature on Karmarkar-type solvers, particularly the implementation and data structure recommendations reported by Adler, Karmarkar, Resende, and Veiga [23,24].
Algorithm 1. Karmarkar’s Projective Algorithm.
Input: A, b, c, tolerance ε, and step size α ∈ (0, 0.7968].
  • Convert the original LP to KCF: min cTx subject to A x = 0, eTx = 1, x ≥ 0, with z* shifted to zero when needed.
  • Initialize x0 = e/n and set k = 0.
  • while cTxk > ε do
  • Dk = diag(xk); Âk = A Dk; ĉk = Dkc.
  • Bk = [Âk; eT].
  • Pk = I B k T   ( B k T ) 1   B k .
  • pk = Pk ĉk.
  • yk+1 = e/n − α r pk/||pk||.
  • xk+1 = Dk yk+1/(eTDk yk+1).
  • k = k + 1.
  • end while
  • Return xk and map the canonical solution back to the original variables.
For a generic minimization model min fTu subject to G u ≥ h and u ≥ 0, minkarc.m first introduces non-negative slack variables s and rewrites the constraints as G u − s = h. The variables are then homogenized and normalized by adding the affine constraint eTx = 1; the original objective is shifted by a known lower bound or by the current finite optimum estimate so that the canonical objective satisfies the zero-optimum assumption required by KCF. After the projective iterations, karfo.m rescales the canonical variables and recovers u, s, and the objective value in the original units.
Figure 1 summarizes the implemented architecture of Karmarkar’s projective method. The diagram is organized into preprocessing, projective iteration, and recovery stages. The preprocessing stage receives A, b, c, α, and ε and converts the original model into KCF. The iteration stage constructs Dk, Âk, ĉk, Bk, and Pk; computes the projected direction pk; updates yk+1; and maps the point back to xk+1. The recovery stage transforms the canonical variables into the original engineering variables and reports the objective value in the physical scale of the problem.
For a maximization model max qTu, maxkarc.m applies the equivalent minimization min(−qTu) before the same slack variable, homogenization, and normalization steps. Thus, minkarc.m and maxkarc.m differ only in the sign convention of the objective and in the final back-transformation used to report the objective value. This separation avoids ambiguity when the structural case is solved as a minimization problem and the agricultural allocation case as a maximization problem.
The step size α = 0.7968 was selected because Karmarkar’s projective step is restricted to a fraction of the inscribed-simplex radius and practical projective implementations commonly use a value close to 0.8 to accelerate progress while preserving strict positivity. In this implementation, α = 0.7968 was adopted as a fixed value after verifying that every iterate remained strictly positive and that the canonical objective and potential function decreased monotonically; ε = 10−8 was used as the stopping tolerance for the canonical objective.

2.3. Case Study I: Minimum-Weight Plastic Design

The first case study is adapted as a benchmark from the structural engineering literature on algebraic linear programming for the optimal plastic design of steel portal frames [12]. It consists of finding the minimum weight of a rigid frame of height h = l and span 3l subjected to a horizontal force F1 = P at the top-left joint and a vertical force F2 = 2P at midspan (Figure 2). Following the kinematic theorem of plasticity, plastic hinges may form at seven candidate locations (joints 1–7 in Figure 2). The variables x1 and x2 denote the plastic moments of the columns and the beam, respectively, and the objective function F = 2x1 + 3x2 is proportional to the total weight under the assumption that the cross-sectional area is proportional to the plastic moment.
Six elementary collapse mechanisms (a–f) are admissible (Figure 3). Equating the external work to the internal plastic dissipation work for each mechanism yields the system of inequalities that constrains the LP:
m i n   F = 2 x 1 + 3 x 2
s . t . { 4 x 1 1 ( a )   beam 4 x 1 + 2 x 2 4 ( b )   sway 2 x 1 + 2 x 2 3 ( c )   combined   I 4 x 2 3 ( d )   local   beam 2 x 1 + 4 x 2 4 ( e )   combined   II 2 x 1 + 2 x 2 1 ( f )   joint
Figure 3 illustrates the six admissible plastic collapse mechanisms (a–f) used to formulate the structural LP in Equations (9)–(11). Each subfigure identifies the candidate plastic hinges, shown by red markers, whose formation converts the frame into a kinematically admissible failure mechanism. The inequality displayed above each mechanism gives the minimum plastic moment capacity required to resist the given collapse mode; for instance, the sway mechanism is represented by 4x1 + 2x2 ≥ 4. These inequalities define the feasible region processed by the algorithm and allow the numerical result to be compared with the analytical optimum of the benchmark problem.
x 1 , x 2 0

2.4. Case Study II: Optimal Cropping Pattern in the Caplina Valley

The Caplina Valley is located in the Tacna region of Southern Peru (Figure 4) and represents an arid agricultural system that depends on the Caplina River and associated groundwater resources for irrigation. The irrigated command area used in the model is 1253 ha, and the maximum annual cropped area is 2506 ha when double cropping is permitted. Crop areas, crop categories, and economic coefficients were organized from the agricultural statistical framework of Peru’s Ministerio de Desarrollo Agrario y Riego (MIDAGRI/SIEA) [25]. The hydrological right-hand sides were compiled from Caplina River monthly discharges at 75% persistence reported in local water management records and cross-checked against the public hydrological information infrastructure of Peru’s Autoridad Nacional del Agua (ANA/SNIRH) [26]. The deterministic formulation is also consistent with operational agricultural linear programming studies that combine crop allocation with hydroclimatic information [27], while labor availability was taken from the case study dataset and should be interpreted as a monthly planning constraint. The numerical input files used in the computations are provided as Supplementary Materials to ensure reproducibility.
The agricultural linear programming model uses the decision vector
x = ( x 1 , , x 12 ) T
where xi denotes the cultivated area assigned to crop i. The objective function maximizes the total net production value (NPV), in US dollars, according to max Z = ∑i=112 cixi, where ci is the crop-specific NPV coefficient reported in Table 1. The optimization is then subject to 37 constraints. The monthly water balance constraints are expressed in Equation (13), where wij denotes the water requirement of crop i in month j and Wj is the available water volume in month j. Labor, market, and land constraints are formulated analogously, as shown in Equations (14)–(16).
i = 1 12 w i j x i W j ,   j { 1 , , 12 }
Equation (14) reports the representative labor availability constraint. Equations (15) and (16) then state the individual market upper bounds and the global annual land constraint, respectively. This ordering makes the objective function and all constraint families explicit before the numerical right-hand sides are summarized in Table 1 and Table 2.
m a x   Z = 980 x 1 + 759 x 2 + 882 x 3 + 847 x 4 + 768 x 5 + 169 x 6 + 1077 x 7 + 213 x 8 + 186 x 9 + 459 x 10 + 561 x 11 + 405 x 12 . + i = 1 12 l i j x i L j ,   j { 1 , , 12 }
0 x i U i ,   i { 1 , , 12 }
i = 1 12 x i 2506
The model includes 37 constraints organized into four groups: (i) twelve monthly water availability constraints (m3 month−1); (ii) twelve monthly labor constraints (jor month−1); (iii) twelve market upper-bound constraints on individual crop areas; and (iv) one global annual land constraint. Table 2 summarizes the right-hand-side values used for the main binding resource groups. The complete coefficient matrices are provided in the Supplementary Dataset.

3. Results

3.1. Convergence and Optimum of Case I (Rigid Frame)

Karmarkar’s projective algorithm with α = 0.7968 and ε = 10−8 converged to F = 1.001 in the normalized dual problem after 20 iterations. Because the normalized objective is reported relative to the analytical optimum scale, the original-space value is obtained as F_original = 1.001 × (17/4) = 4.251. The relative error is therefore |4.251 − 4.25|/4.25 = 2.4 × 10−4, not less than 10−4. Table 3 shows the iteration history and makes this conversion explicit.
Figure 5 presents the convergence behavior of the objective function for the minimum-weight design in Case I, comparing Karmarkar’s projective algorithm, Barnes’ affine scaling variant, and the revised Simplex method. In the linear-scale panel, Simplex reaches the optimum in fewer iterations for this compact benchmark, while Karmarkar follows a strictly interior trajectory and approaches the analytical optimum after 20 iterations. In the semilogarithmic panel, the absolute error trend shows a more regular reduction for the projective implementation than for Barnes’ affine scaling variant in this specific test case. Therefore, the figure supports the convergence validation of the implementation, but it should not be interpreted as general proof of computational superiority over Simplex for all linear programs.
Table 4 compares the performance of the three solvers on Case I. Karmarkar’s projective method required 20 iterations to reach the tolerance, compared with 28 iterations for Barnes’ affine scaling variant. The final original-space objective reported by Karmarkar was 4.251, corresponding to a relative error of 2.4 × 10−4 with respect to F* = 4.25. Although the revised Simplex method was faster on this small problem, the value of the projective implementation lies in the transparent interior trajectory, explicit feasibility preservation, and reproducible canonical-form computation.

3.2. Optimal Cropping Pattern of Case II (Caplina Valley)

Karmarkar’s algorithm allocated 948.47 ha (37.8% of the maximum land constraint) and yielded the maximum total net production value of USD 703,135.92. Table 5 details the areas allocated to each crop and their economic contributions.
Figure 6 summarizes the optimal crop allocation solution for the Caplina Valley. Panel (a) compares the selected area with the market upper bound for each crop, showing that black grape, sweet corn, tomato, alfalfa, and nearly forage corn are driven to their upper bounds, while potato, chili pepper, broad bean, and pea are excluded by the economic resource trade-off of the model. Panel (b) reports the corrected economic contributions by crop; sweet corn contributes USD 199,680.00, tomato contributes USD 134,625.00, black grape contributes USD 117,600.00, and the total net production value computed from the rounded reported areas is USD 703,135.92.

4. Discussion

The results of this study should be interpreted at two complementary levels. At the algorithmic level, the implementation confirms that Karmarkar’s projective algorithm can reproduce optimal linear programming solutions via a strictly interior trajectory, maintaining positive feasibility during iterations and avoiding the vertex hopping characteristic of Simplex [28]. At the applied level, the two cases show that the same mathematical framework can represent engineering problems with very different physical meanings: the first associated with the structural design of a rigid frame and the second with the agricultural allocation of resources in a hyper-arid basin. This dual perspective strengthens the manuscript’s contribution, as it avoids presenting the algorithm as an abstract exercise and positions it as a verifiable tool for constrained decision-making.
In the structural case, Karmarkar’s algorithm approached the analytical optimum of the plastic design benchmark, with an original-space value of F = 4.251 and a relative error of 2.4 × 10−4 with respect to F* = 4.25 after 20 iterations. This result is relevant because plastic design problems can be formulated using linear relationships between collapse mechanisms, plastic moments, and minimum weight criteria, which allows for the construction of verifiable benchmarks for optimization algorithms [12]. The observed convergence is also consistent with the literature on structural optimization, where interior-point methods have been used to solve large-scale linear or conic formulations when the number of constraints and variables makes it less convenient to rely exclusively on pivoting strategies [13].
Comparisons with the revised Simplex method must be formulated precisely to avoid a methodologically weak claim. In this study, Simplex was faster and required fewer iterations on the small structural problem, which is to be expected because its practical performance is typically excellent on compact instances with a manageable constraint structure [1]. However, the scientific advantage of Karmarkar in this context does not lie in always outperforming Simplex in CPU time but in demonstrating a polynomial and geometrically interpretable interior process [4].
The trajectory obtained by Karmarkar must also be distinguished from that of Barnes’ affine scaling variant. The projective algorithm applies re-centering via a projective transformation before proceeding in a descent direction, which allows it to preserve an explicit relationship between the current point, the canonical simplex, and the potential function [29]. In contrast, affine scaling methods simplify part of this geometric structure and may be easier to implement, but they do not offer exactly the same projective re-centering mechanism [8]. Therefore, Karmarkar’s lower number of iterations compared to Barnes in Case I is consistent with the stabilizing role of re-centering, although the small size of the benchmark prevents drawing general conclusions about computational efficiency.
The utility of the structural benchmark is reinforced when its scope and limitations are recognized. The optimal result validates the implementation against an analytical solution, but a linear plastic model does not automatically incorporate buckling, second-order effects, connections, detailed compatibility, or complete code requirements. This caution aligns with research on the optimization of truss-type structures, where linear models allow for the derivation of minimum-volume topologies or designs but subsequently require additional verifications of stability and constructability [14]. Therefore, it should be noted that Case I is an algorithmic verification test, not a comprehensive structural design procedure ready for construction.
The Caplina Valley case provides the most significant applied dimension of the study, as it transforms a linear programming formulation into a tool for analyzing agricultural production under monthly constraints on water, labor, market, and land. The optimal solution allocates 948.47 hectares and yields net production value of USD 703,135.92, indicating that the available land is not fully utilized when economic and hydrological constraints are imposed. This behavior is consistent with the literature on agricultural optimization, where optimal crop allocation typically depends not only on arable land but also on water productivity, prices, monthly water availability, and market capacity [15].
The model’s crop selection should be discussed as a consequence of opportunity costs and not as an unconditional agronomic recommendation. The presence of black grapevine, sweet corn, tomato, alfalfa, forage corn, starchy corn, vegetables, and forestry crops indicates that, under the coefficients used, these crops generate a favorable marginal contribution relative to their resource consumption. In contrast, the exclusion of potatoes, chili peppers, beans, and peas suggests that these crops are outcompeted by alternatives with a better ratio of net return to production constraints. Agricultural planning studies using linear programming show that the final crop mix can change substantially when prices, water availability, or market constraints vary; therefore, the solution must be accompanied by sensitivity analyses before deriving policy recommendations [30].
The discussion must also acknowledge the institutional scale of the decision. Linear programming provides an optimal solution under defined assumptions, but implementation requires compatibility with water rights, irrigation infrastructure, market access, labor availability, and farmers’ preferences. Previous agricultural optimization models applied in water-scarce basins show that mathematically efficient solutions are not always socially adoptable if risk, equity, and operational feasibility are excluded. Therefore, the proposed model should be understood as a technical layer supporting decision-making and not as a self-sufficient public policy.
From an algorithmic standpoint, a major limitation is that the canonical form required by Karmarkar can increase the dimensionality and introduce additional computational costs in large-scale implementations. This limitation is well known in the evolution of interior-point methods, where modern primal-dual variants solve perturbed Karush–Kuhn–Tucker systems and are often preferred in industrial solvers [9]. Applications involving severe water deficits and large-scale resource allocation systems also show that conjunctive-use and uncertainty-aware formulations may require enhanced optimization structures beyond a deterministic base model [31]. In addition, modern interior-point implementations frequently require warm starting, sensitivity analysis, or hybrid decision generation strategies to be efficient in real-time or repeatedly solved contexts [32,33]. However, the projective implementation retains specific methodological value: it makes the geometric transformation, preservation of feasibility, and reduction of the potential function visible. This visibility is useful for the reproducibility, teaching, and validation of hybrid algorithms.
The risk of overexploitation must also be explicitly incorporated into the interpretation of the results. Narvaez-Montoya et al. modeled the Caplina/Concordia transboundary aquifer and projected unsustainable conditions under future scenarios, including piezometric declines and the advance of marine intrusion [20]. This evidence supports the need for agricultural linear programming not to be limited to the annual water balance but rather to be linked to hydrogeological models or to maximum extraction constraints by zone. In a coastal basin, the optimal cropping decision can spatially modify the pumping pressure and, consequently, influence the hydraulic gradient that favors or limits marine intrusion.
The deterministic formulation used in the manuscript is adequate as a first reproducible approximation but insufficient to fully represent the climatic and hydrological uncertainty in Caplina. Mizyed’s review shows that, although linear programming dominates agricultural allocation and irrigation planning, contemporary models are moving toward mixed, fuzzy, fractional, and multi-objective variants to capture real-world complexities [15]. In addition, operational agricultural linear programming models can be strengthened by coupling optimization with hydroclimatic forecasting, as shown in recent applications to irrigated agriculture [27]. This observation supports the manuscript’s proposal to incorporate extensions using stochastic programming, robust optimization, or scenario analysis. Such extensions would be particularly useful when monthly water availability, agricultural prices, and market demand cannot be considered constant.

5. Conclusions

This study demonstrates that Karmarkar’s original projective algorithm can be implemented as a transparent, reproducible, and conceptually robust tool for solving linear programming problems in engineering. Its contribution is not the proposal of a new optimization algorithm but the explicit documentation of canonical-form conversion, projective descent, numerical back-transformation, and comparative validation in two distinct applications: a structural plastic design benchmark and an agricultural resource allocation problem in the Caplina Valley, Tacna. The structural case confirms that the implementation reaches the analytical optimum scale, with a final original-space value of 4.251 and a relative error of 2.4 × 10−4 after 20 iterations, while the agricultural case yields net production value of USD 703,135.92 under water, labor, market, and land constraints. The revised Simplex method remains computationally advantageous in the small benchmark, but Karmarkar’s strictly interior trajectory offers a distinct educational and methodological advantage because feasibility preservation, the transformation geometry, and the convergence behavior are observable. In the agricultural case, the optimal solution must be interpreted within hydrological, commercial, labor, and institutional limits, especially in a hyper-arid basin affected by aquifer overexploitation, salinization, and climate uncertainty. Future work should extend the present deterministic model through stochastic programming, robust optimization, multi-objective formulations, water quality constraints, and hybrid artificial intelligence/operations research workflows for more sustainable water and infrastructure management.

Supplementary Materials

The following supporting information can be downloaded at: https://www.mdpi.com/article/10.3390/a19060479/s1, Table S1: Package contents; Table S2: Caplina Valley crop coefficients.

Author Contributions

J.F.-S.: conceptualization, methodology, investigation, resources, writing—original draft preparation, supervision and project administration. C.R.-V.: methodology, validation, formal analysis, data curation and writing—review and editing. F.T.-C.: methodology, investigation, resources, writing—original draft preparation and writing—review and editing. J.C.-C.: methodology, validation, formal analysis, resources and writing—review and editing. J.C.-G.: software, formal analysis, validation, visualization and writing—review and editing. J.V.-S.: software, data curation, formal analysis, visualization and writing—original draft preparation. S.E.-H.: investigation, validation, resources and writing—review and editing. B.L.-L.: conceptualization, validation, supervision, resources and writing—review and editing. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Data Availability Statement

Data is contained within the Supplementary Materials.

Conflicts of Interest

The authors declare no conflicts of interest.

Abbreviations

The following abbreviations are used in this manuscript:
LPLinear Programming
IPMInterior-Point Method
KCFKarmarkar Canonical Form
KKTKarush–Kuhn–Tucker (optimality conditions)
NPVNet Production Value
OROperations Research
εStopping Tolerance of the Interior-Point Algorithm
αStep Size Parameter, α ∈ (0, 0.7968)

References

  1. Dantzig, G.B. Linear Programming and Extensions; Princeton University Press: Princeton, NJ, USA, 2016. [Google Scholar]
  2. Shameem, S. An Experiment with Simplex Method for Solving Linear Programming Problems. Bachelor’s Thesis, Brac University, Dhaka, Bangladesh, 2022. [Google Scholar]
  3. Fearnley, J.; Savani, R. The complexity of the simplex method. In Proceedings of the Forty-Seventh Annual ACM Symposium on Theory of Computing; Springer: Berlin/Heidelberg, Germany, 2015; pp. 201–208. [Google Scholar]
  4. Wright, M. The interior-point revolution in optimization: History, recent developments, and lasting consequences. Bull. Am. Math. Soc. 2005, 42, 39–56. [Google Scholar] [CrossRef]
  5. Anstreicher, K.M. Linear programming: Karmarkar projective algorithm. In Encyclopedia of Optimization; Springer: Berlin/Heidelberg, Germany, 2025; pp. 1–3. [Google Scholar]
  6. Karmarkar, N. A new polynomial-time algorithm for linear programming. In Proceedings of the Sixteenth Annual ACM Symposium on Theory of Computing; ACM, Inc.: New York, NY, USA, 1984; pp. 302–311. [Google Scholar]
  7. Hooker, J.N. Karmarkar’s linear programming algorithm. Interfaces 1986, 16, 75–90. [Google Scholar] [CrossRef]
  8. Bayer, D.A.; Lagarias, J.C. The nonlinear geometry of linear programming. I. Affine and projective scaling trajectories. Trans. Am. Math. Soc. 1989, 314, 499–526. [Google Scholar] [CrossRef]
  9. Potra, F.A.; Wright, S.J. Interior-point methods. J. Comput. Appl. Math. 2000, 124, 281–302. [Google Scholar] [CrossRef]
  10. Ye, Y. Interior Point Algorithms: Theory and Analysis; John Wiley & Sons: Hoboken, NJ, USA, 2011. [Google Scholar]
  11. Gondzio, J. Interior point methods in the year 2025. EURO J. Comput. Optim. 2025, 13, 100105. [Google Scholar] [CrossRef]
  12. O’brien, E.J.; Dixon, A.S. Algebraic linear programming applied to optimal plastic design of steel portal frames. Eng. Optim. 1993, 21, 175–195. [Google Scholar] [CrossRef]
  13. Zegard, T.; Paulino, G.H. GRAND3—Ground structure based topology optimization for arbitrary 3D domains using MATLAB. Struct. Multidiscip. Optim. 2015, 52, 1161–1184. [Google Scholar] [CrossRef]
  14. Gilbert, M.; Tyas, A. Layout optimization of large-scale pin-jointed frames. Eng. Comput. 2003, 20, 1044–1064. [Google Scholar] [CrossRef]
  15. Mizyed, A. Sustainable water footprint management in agriculture: A review of linear programming-based models and future directions. Integr. Environ. Assess. Manag. 2025, 2, 352–361. [Google Scholar] [CrossRef] [PubMed]
  16. Mateos, L.; Araus, J.L. Hydrological, engineering, agronomical, breeding and physiological pathways for the effective and efficient use of water in agriculture. Agric. Water Manag. 2016, 164, 190–196. [Google Scholar] [CrossRef]
  17. Sethi, L.N.; Panda, S.N.; Nayak, M.K. Optimal crop planning and water resources allocation in a coastal groundwater basin, Orissa, India. Agric. Water Manag. 2006, 83, 209–220. [Google Scholar] [CrossRef]
  18. Freire-González, J.; Decker, C.A.; Hall, J.W. A linear programming approach to water allocation during a drought. Water 2018, 10, 363. [Google Scholar] [CrossRef]
  19. Ahmad, I.; Tang, D. Multi-objective linear programming for optimal water allocation based on satisfaction and economic criterion. Arab. J. Sci. Eng. 2016, 41, 1421–1433. [Google Scholar] [CrossRef]
  20. Narvaez-Montoya, C.; Torres-Martínez, J.A.; Pino-Vargas, E.; Cabrera-Olivera, F.; Loge, F.J.; Mahlknecht, J. Predicting adverse scenarios for a transboundary coastal aquifer system in the Atacama Desert (Peru/Chile). Sci. Total Environ. 2022, 806, 150386. [Google Scholar] [CrossRef]
  21. Chucuya, S.; Vera, A.; Pino-Vargas, E.; Steenken, A.; Mahlknecht, J.; Montalván, I. Hydrogeochemical characterization and identification of factors influencing groundwater quality in coastal aquifers, case: La Yarada, Tacna, Peru. Int. J. Environ. Res. Public Health 2022, 19, 2815. [Google Scholar] [CrossRef]
  22. Chucuya, S.; Pacci, R.; Bustincio, B.; Taya-Acosta, E.; Alfonso-Morales, W.; Huayna, G.; Pino-Vargas, E.; Ingol-Blanco, E.; Mora, A.; Torres-Martínez, J.A.; et al. Reconstructing aquifer dynamics with machine learning: Linking irrigation expansion to groundwater decline in a data-scarce hyper-arid region. Agric. Water Manag. 2025, 322, 110018. [Google Scholar] [CrossRef]
  23. Adler, I.; Resende, M.G.C.; Veiga, G.; Karmarkar, N. An implementation of Karmarkar’s algorithm for linear programming. Math. Program. 1989, 44, 297–335. [Google Scholar] [CrossRef]
  24. Adler, I.; Karmarkar, N.; Resende, M.G.C.; Veiga, G. Data structures and programming techniques for the implementation of Karmarkar’s algorithm. ORSA J. Comput. 1989, 1, 84–106. [Google Scholar] [CrossRef]
  25. Ministerio de Desarrollo Agrario y Riego (MIDAGRI), Sistema Integrado de Estadística Agraria (SIEA), Datos y Estadísticas Agrarias. Available online: https://siea.midagri.gob.pe/ (accessed on 29 May 2026).
  26. Autoridad Nacional del Agua (ANA). Sistema Nacional de Información de Recursos Hídricos (SNIRH), Observatorio Nacional de Recursos Hídricos. Available online: https://snirh.ana.gob.pe/onrh/ (accessed on 29 May 2026).
  27. Boninsenha, I.; Pimenta, F.M.; Pousa, R.; Costa, M.H.; Mantovani, E.C. A linear programming model for operational optimization of agricultural activity considering a hydroclimatic forecast—Case studies for Western Bahia, Brazil. Water 2022, 14, 3625. [Google Scholar] [CrossRef]
  28. Bixby, R.E.; Gregory, J.W.; Lustig, I.J.; Marsten, R.E.; Shanno, D.F. Very large-scale linear programming: A case study in combining interior point and simplex methods. Oper. Res. 1992, 40, 885–897. [Google Scholar] [CrossRef]
  29. Su, L.; Liu, L.; Feng, S. Linear programming in machine building based on Karmarkar improvement algorithm in the context of new engineering. Authorea Prepr. 2022. [Google Scholar] [CrossRef]
  30. Zhang, C.; Engel, B.A.; Guo, P.; Liu, X.; Guo, S.; Zhang, F.; Wang, Y. Double-sided stochastic chance-constrained linear fractional programming model for managing irrigation water under uncertainty. J. Hydrol. 2018, 564, 467–475. [Google Scholar] [CrossRef]
  31. Azaiez, M.N.; Hariga, M. A single-period model for conjunctive use of ground and surface water under severe overdrafts and water deficit. Eur. J. Oper. Res. 2001, 133, 653–666. [Google Scholar] [CrossRef]
  32. Gondzio, J.; Grothey, A. A new unblocking technique to warmstart interior point methods based on sensitivity analysis. SIAM J. Optim. 2008, 19, 1184–1210. [Google Scholar] [CrossRef]
  33. Babier, A.; Chan, T.C.Y.; Diamant, A.; Mahmood, R. Learning to optimize contextually constrained problems for real-time decision-generation. arXiv 2018, arXiv:1805.09293. [Google Scholar] [CrossRef]
Figure 1. Flowchart of the implemented Karmarkar projective algorithm (file karjfs.m). The single-line boxes represent the preprocessing, projective iteration, stopping test, inverse mapping, and final recovery stages.
Figure 1. Flowchart of the implemented Karmarkar projective algorithm (file karjfs.m). The single-line boxes represent the preprocessing, projective iteration, stopping test, inverse mapping, and final recovery stages.
Algorithms 19 00479 g001
Figure 2. Rigid frame with applied loads (F1 = P, F2 = 2P) and seven candidate plastic hinge locations. Redrawn for this study from the benchmark geometry used in the algebraic linear programming formulation of optimal plastic design [12].
Figure 2. Rigid frame with applied loads (F1 = P, F2 = 2P) and seven candidate plastic hinge locations. Redrawn for this study from the benchmark geometry used in the algebraic linear programming formulation of optimal plastic design [12].
Algorithms 19 00479 g002
Figure 3. Six admissible plastic collapse mechanisms for the rigid frame. Subfigures (af) show the active plastic hinges and the corresponding linear inequality used in the structural optimization model; red markers denote plastic hinge locations.
Figure 3. Six admissible plastic collapse mechanisms for the rigid frame. Subfigures (af) show the active plastic hinges and the corresponding linear inequality used in the structural optimization model; red markers denote plastic hinge locations.
Algorithms 19 00479 g003
Figure 4. Study area of the agricultural allocation model. (a) Location of Tacna in Southern Peru. (b) Detailed view of the Caplina Valley, including the Caplina River corridor, the city of Tacna, and the La Yarada irrigation sub-zone.
Figure 4. Study area of the agricultural allocation model. (a) Location of Tacna in Southern Peru. (b) Detailed view of the Caplina Valley, including the Caplina River corridor, the city of Tacna, and the La Yarada irrigation sub-zone.
Algorithms 19 00479 g004
Figure 5. Convergence of the objective function for Case I. Note: (a) Linear-scale comparison of Karmarkar’s projective method, Barnes’ affine scaling method, and the revised Simplex method; (b) semilogarithmic plot of the absolute error, showing faster error reduction for the projective implementation than for the affine scaling variant in this benchmark.
Figure 5. Convergence of the objective function for Case I. Note: (a) Linear-scale comparison of Karmarkar’s projective method, Barnes’ affine scaling method, and the revised Simplex method; (b) semilogarithmic plot of the absolute error, showing faster error reduction for the projective implementation than for the affine scaling variant in this benchmark.
Algorithms 19 00479 g005
Figure 6. Optimal cropping pattern and economic outcomes for the Caplina Valley. (a) Optimal allocation of cropping area compared with market upper bounds for the twelve crops. (b) Corrected economic contribution of each crop, totaling USD 703,135.92 when computed from the rounded areas reported in Table 5.
Figure 6. Optimal cropping pattern and economic outcomes for the Caplina Valley. (a) Optimal allocation of cropping area compared with market upper bounds for the twelve crops. (b) Corrected economic contribution of each crop, totaling USD 703,135.92 when computed from the rounded areas reported in Table 5.
Algorithms 19 00479 g006
Table 1. Crops modeled, crop types, and net production value (NPV) coefficients used in the Caplina Valley allocation model.
Table 1. Crops modeled, crop types, and net production value (NPV) coefficients used in the Caplina Valley allocation model.
ItemCrop (English/Spanish)TypeNPV c_i (USD ha−1)
1Black grape/common black grapePermanent980
2PotatoTemporary759
3Amylaceous maizeTransitory882
4VegetablesTransitory847
5Sweet cornTransitory768
6Chili pepper/AjíTransitory169
7TomatoTransitory1077
8Broad beanTransitory213
9PeaTransitory186
10AlfalfaForage459
11Forage maize/forage cornForage561
12ForestryForestry405
Table 2. Right-hand-side values for water, labor, market, and land constraints in the Caplina Valley model.
Table 2. Right-hand-side values for water, labor, market, and land constraints in the Caplina Valley model.
Constraint GroupIndexValue (Units)
Water availability (m3/month)Jan–Dec1,582,934; 1,874,880; 1,909,699; 1,462,406; 1,331,165; 1,319,328; 1,312,416; 1,272,240; 1,174,176; 1,159,747; 1,039,392; 1,157,069
Labor (jor)Jan–Dec22,239 (per month)
Market upper bounds (ha)Crops 1–12120; 80; 190; 40; 260; 110; 125; 200; 150; 50; 130; 190
Land (ha)Annual2506 (double cropping permitted)
Table 3. Iteration history of Karmarkar’s projective algorithm for Case I.
Table 3. Iteration history of Karmarkar’s projective algorithm for Case I.
Iteration ky11y21x1x2F
Reference5000
100.1230.0760.4880.0231.045
200.1120.0820.5000.0001.001
Table 4. Comparative performance of the three solvers on Case I.
Table 4. Comparative performance of the three solvers on Case I.
MethodIterations to ε = 10−8CPU Time (ms, Mean of 30 Runs)Final FRelative Error |F − F*|/F*
Karmarkar (projective)207.44.2512.4 × 10−4
Barnes (affine)286.14.2551.2 × 10−3
Simplex (revised)60.94.250.0
Note: CPU times are reported only as descriptive values for the small Case I benchmark and should not be generalized to large-scale instances without additional benchmarking.
Table 5. Optimal crop allocation and economic contributions for the Caplina Valley model.
Table 5. Optimal crop allocation and economic contributions for the Caplina Valley model.
iCropMarket Upper Bound (ha)Optimal Area xi* (ha)Net Revenue ci · xi* (USD)
1Black grape120120.00117,600.00
2Potato800.000.00
3Starchy corn19088.9378,436.26
4Vegetables4014.3412,145.98
5Sweet corn260260.00199,680.00
6Chili pepper1100.000.00
7Tomato125125.00134,625.00
8Broad bean2000.000.00
9Pea1500.000.00
10Alfalfa5050.0022,950.00
11Forage corn130129.2872,526.08
12Forestry190160.9265,172.60
TOTAL2506948.47703,135.92
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Flores-Salinas, J.; Rios-Varillas, C.; Tineo-Córdova, F.; Cabrera-Chávez, J.; Cernades-Gómez, J.; Villalobos-Solano, J.; Escalante-Huamaní, S.; Laines-Lozano, B. Interior-Point Optimization for Engineering Design: Implementation of the Karmarkar Algorithm in Structural and Water Resource Problems. Algorithms 2026, 19, 479. https://doi.org/10.3390/a19060479

AMA Style

Flores-Salinas J, Rios-Varillas C, Tineo-Córdova F, Cabrera-Chávez J, Cernades-Gómez J, Villalobos-Solano J, Escalante-Huamaní S, Laines-Lozano B. Interior-Point Optimization for Engineering Design: Implementation of the Karmarkar Algorithm in Structural and Water Resource Problems. Algorithms. 2026; 19(6):479. https://doi.org/10.3390/a19060479

Chicago/Turabian Style

Flores-Salinas, José, Cecilia Rios-Varillas, Freddy Tineo-Córdova, Julio Cabrera-Chávez, Jesús Cernades-Gómez, Juan Villalobos-Solano, Sonia Escalante-Huamaní, and Blanca Laines-Lozano. 2026. "Interior-Point Optimization for Engineering Design: Implementation of the Karmarkar Algorithm in Structural and Water Resource Problems" Algorithms 19, no. 6: 479. https://doi.org/10.3390/a19060479

APA Style

Flores-Salinas, J., Rios-Varillas, C., Tineo-Córdova, F., Cabrera-Chávez, J., Cernades-Gómez, J., Villalobos-Solano, J., Escalante-Huamaní, S., & Laines-Lozano, B. (2026). Interior-Point Optimization for Engineering Design: Implementation of the Karmarkar Algorithm in Structural and Water Resource Problems. Algorithms, 19(6), 479. https://doi.org/10.3390/a19060479

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Article metric data becomes available approximately 24 hours after publication online.
Back to TopTop