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.
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.