{"id":15539658,"url":"https://github.com/thchang/dualsimplex","last_synced_at":"2026-02-26T18:32:22.031Z","repository":{"id":157742151,"uuid":"206873847","full_name":"thchang/DualSimplex","owner":"thchang","description":"Fortran 90 code for solving the asymetric dual of an LP","archived":false,"fork":false,"pushed_at":"2019-09-07T21:00:34.000Z","size":208,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-09T12:58:55.423Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Fortran","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thchang.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-09-06T21:05:03.000Z","updated_at":"2020-08-01T08:56:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"6e578803-8566-4fc7-b09f-a99c48f894cb","html_url":"https://github.com/thchang/DualSimplex","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/thchang/DualSimplex","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thchang%2FDualSimplex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thchang%2FDualSimplex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thchang%2FDualSimplex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thchang%2FDualSimplex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thchang","download_url":"https://codeload.github.com/thchang/DualSimplex/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thchang%2FDualSimplex/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29867543,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-26T18:27:06.972Z","status":"ssl_error","status_checked_at":"2026-02-26T18:26:57.848Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-02T12:11:02.828Z","updated_at":"2026-02-26T18:32:21.993Z","avatar_url":"https://github.com/thchang.png","language":"Fortran","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DUALSIMPLEX code with Driver for Delaunay interpolation\n\nDUALSIMPLEX is an open source Fortran 90 module for solving\nlinear programs of the form\n\n``\nmax c^T x\n``\n``\ns.t. A x \u003c= b\n``\n\nwhere, c is a cost vector and A x \u003c= b is a system of linear inequality\nconstraints.\n\nDUALSIMPLEX solves this problem by applying the revised simplex method\nof Dantzig to the asymetric dual\n\n``\nmin b^T y\n``\ns.t. \n``\nA^T y = c \n``\nand\n``\ny \u003e= 0.\n``\n\nTo solve the dual problem, the revised simplex algorithm is applied. In\neach iteration of the dual simplex algorithm, a complete LU factorization\nis performed via DGETRF. Dantzig's rule is used to pivot, until either a\nsolution is found, or a pivot does not improve the objective. When a pivot\nfails to improve the objective, Bland's rule is used until improvement\nresumes, at which point Dantzig's pivoting strategy is resumed.\n\nThis strategy is most effective when A is dense and when M \u003e N. For\nefficient memory access patterns, the constraints are specified by\ninputting A^T instead of A. For efficient linear algebra, LAPACK is\nused for computing LU factorizations and performing triangular solve\noperations, and BLAS is used for computing dot products and matrix-vector\nmultiplication.\n\nWhile a complete LU factorization in each iteration produces maximum\nnumerical stability, a Woodbury update could alternatively be performed\nif iteration speed is of greater concern. When M \u003e\u003e N, the cost of the\nLU factorization is negligible compared to other computational costs,\nand the difference in speed would be negligible.\n\n## Delaunay interpolation\n\nThe problem of piecewise linear multivariate interpolation can be posed\nas a linear program, where the constraint equations are determined by the\npositions of the data points in the input (independent variable) space,\nand the cost vector is determined by the interpolation point.\n\nFor input points P = { p1, ..., pn } and interpolation point q in d-dimensions, \nthe constraint equations are given by\n - Ai = [ -(pi) 1 ], where Ai denotes the ith row of A;\n - bi = Ai dot Ai, where bi denotes the ith element of b and \"dot\" denotes\n   the standard inner product; and\n - c = [-q 1]^T.\n\nThen for the following linear program, a basis is primal feasibile\nif and only if it corresponds to the vertices of a Delaunay simplex,\nand a basis is dual feasible if and only if it corresponds to the vertices\nof a simplex containing q.\n\n``\nmax c^T x\n``\ns.t. \n``\nA x \u003c= b\n``\n\nSo, it follows that any basic optimal solution to the above problem results in\na Delaunay simplex containing q, and the nonzero dual weights are exactly\nthe convex (barycentric) weights needed for solving the interpolation\nproblem.\n\nThe driver code for this repository solves the dual formulation of a\nDelaunay interpolation problem, for points in general position.\nNote that if the input points are not in general position, then the basic\nsolution to the linear programming formulation may not be basic optimal,\nand the above methodology will fail.\n\n## Contents\n\nThis repo contains the following files:\n - dualsimplex.f90 contains an open source Fortran 90 library for solving\n   linear programs of the form: max c^T x, such that Ax \u003c= b, via the dual\n   formulation using the revised simplex algorithm.\n   Note that dualsimplex.f90 uses a dense update and always performs a full\n   Dantzig pivot, making it inefficient for most industrial applications.\n - delaunayLPtest.f90 tests the DUALSIMPLEX algorithm by performing Delaunay\n   interpolation on points in general position.\n - generate\\_data.f90 generates data points in general position along with\n   an interpolation point in their convex hull, for usage with\n   delaunayLPtest.f90\n - Makefile builds the project and executes the main programs.\n\n## The DUALSIMPLEX module\ndualsimplex.f90 contains a Fortran 90 module containing two subroutines:\n\n - DUALSIMPLEX for solving an LP when the initial basis is known (Phase II of\n   the simplex algorithm),\n\n - FEASIBLEBASIS for finding an initial dual feasible basis when none is\n   known (Phase I of the simplex algorithm) by solving the auxiliary\n   problem using DUALSIMPLEX.\n\n\n### DUALSIMPLEX(N, M, AT, B, C, IBASIS, X, Y, IERR, EPS, IBUDGET, OBASIS)\n\nOn input:\n - N is the integer number of variables in the primal problem.\n - M is the integer number of constraints in the primal problem.\n - AT(N,M) is the transpose of the real valued constraint matrix A.\n - B(M) is the real valued vector of upper bounds for the constraints.\n - C(N) is the real valued cost vector for the objective function.\n - IBASIS(N) is an integer valued vector containing the indices (from AT)\n   of an intitial basis that is dual feasible.\n\nOn output:\n - X(N) is a real valued vector, which contains the primal solution.\n - Y(M) is a real valued vector, which contains the dual solution.\n - IERR is an integer valued error flag. The error codes are listed in\n   dualsimplex.f90, where DUALSIMPLEX is defined.\n\nOptional arguments:\n - EPS contains the working precision for the problem. EPS must be a\n   strictly positive real number, and by default EPS is the square-root of\n   the unit roundoff.\n - IBUDGET contains the integer budget for the maximum number of pivots\n   allowed. By default, IBUDGET=50,000.\n - When present, OBASIS(:) returns the integer indices of the final basis\n   as listed in AT.\n\n### FEASIBLEBASIS (N, M, AT, C, BASIS, IERR, EPS, IBUDGET)\n\nOn input:\n - N is the integer number of variables in the primal problem.\n - M is the integer number of constraints in the primal problem.\n - AT(N,M) is the transpose of the real valued constraint matrix A.\n - C(N) is the real valued cost vector for the objective function.\n\nOn output:\n - BASIS(N) is an integer valued vector, which contains the indices of a\n   dual feasible basis for AT.\n - IERR is an integer valued error flag. The error codes are listed in\n   dualsimplex.f90, where FEASIBLEBASIS is defined.\n\nOptional arguments:\n - EPS contains the working precision for the problem. EPS must be a\n   strictly positive real number, and by default EPS is the square-root of\n   the unit roundoff.\n - IBUDGET contains the integer budget for the maximum number of pivots\n   allowed. By default, IBUDGET=50,000.\n\n## Installation\n\n### Prerequisites\n\nDUALSIMPLEX requires both BLAS and LAPACK for efficient linear algebra.\n\n### Building\n\nTo install, pull this repo and run\n``\nmake -B\n``\n\n## Author\n\n* ** Tyler Chang ** - *Primary author*\n\n## Further reading\n\nSee\n\n - Fukuda's FAQ:\nhttps://www.cs.mcgill.ca/~fukuda/soft/polyfaq/polyfaq.html\n - Tyler H. Chang, Layne T. Watson, Thomas C. H. Lux, Bo Li, Li Xu, Ali R. Butt, Kirk W. Cameron, and Yili Hong. 2018. A polynomial time algorithm for multivariate interpolation in arbitrary dimension via the Delaunay triangulation. In Proceedings of the ACMSE 2018 Conference (ACMSE '18). ACM, New York, NY, USA, Article 12, 8 pages.\n - Nimrod Megiddo. 1991. On finding primal-and dual-optimal bases. ORSA Journal on Computing 3.1, pp 63-65.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthchang%2Fdualsimplex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthchang%2Fdualsimplex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthchang%2Fdualsimplex/lists"}