A numerically adaptive implementation of the simplex method



Similar documents
Adaptive Stable Additive Methods for Linear Algebraic Calculations

Solution of Linear Systems

Mathematical finance and linear programming (optimization)

7. LU factorization. factor-solve method. LU factorization. solving Ax = b with A nonsingular. the inverse of a nonsingular matrix

Operation Count; Numerical Linear Algebra

A Constraint Programming based Column Generation Approach to Nurse Rostering Problems

An Overview Of Software For Convex Optimization. Brian Borchers Department of Mathematics New Mexico Tech Socorro, NM

SOLVING LINEAR SYSTEMS

Numerical Matrix Analysis

CS3220 Lecture Notes: QR factorization and orthogonal transformations

8 Square matrices continued: Determinants

Numerical Methods I Eigenvalue Problems

Divide: Paper & Pencil. Computer Architecture ALU Design : Division and Floating Point. Divide algorithm. DIVIDE HARDWARE Version 1

Vector and Matrix Norms

Direct Methods for Solving Linear Systems. Matrix Factorization

Integrating Benders decomposition within Constraint Programming

A Simultaneous Solution for General Linear Equations on a Ring or Hierarchical Cluster

Linear Programming for Optimization. Mark A. Schulze, Ph.D. Perceptive Scientific Instruments, Inc.

6. Cholesky factorization

Techniques of the simplex basis LU factorization update

Branch-and-Price Approach to the Vehicle Routing Problem with Time Windows

1 Solving LPs: The Simplex Algorithm of George Dantzig

Lecture 5: Singular Value Decomposition SVD (1)

Notes on Factoring. MA 206 Kurt Bryan

4.6 Linear Programming duality

MATRIX ALGEBRA AND SYSTEMS OF EQUATIONS. + + x 2. x n. a 11 a 12 a 1n b 1 a 21 a 22 a 2n b 2 a 31 a 32 a 3n b 3. a m1 a m2 a mn b m

CS321. Introduction to Numerical Methods

Fault Tolerant Matrix-Matrix Multiplication: Correcting Soft Errors On-Line.

DNA Data and Program Representation. Alexandre David

The Singular Value Decomposition in Symmetric (Löwdin) Orthogonalization and Data Compression

Lecture 3: Finding integer solutions to systems of linear equations

Binary Division. Decimal Division. Hardware for Binary Division. Simple 16-bit Divider Circuit

A Mathematical Programming Solution to the Mars Express Memory Dumping Problem

Linear Programming Notes V Problem Transformations

Numerical Analysis. Gordon K. Smyth in. Encyclopedia of Biostatistics (ISBN ) Edited by. Peter Armitage and Theodore Colton

Measures of Error: for exact x and approximation x Absolute error e = x x. Relative error r = (x x )/x.

Computational aspects of simplex and MBU-simplex algorithms using different anti-cycling pivot rules

December 4, 2013 MATH 171 BASIC LINEAR ALGEBRA B. KITCHENS

7 Gaussian Elimination and LU Factorization

Solving Linear Systems of Equations. Gerald Recktenwald Portland State University Mechanical Engineering Department

APPM4720/5720: Fast algorithms for big data. Gunnar Martinsson The University of Colorado at Boulder

EXCEL SOLVER TUTORIAL

Department of Chemical Engineering ChE-101: Approaches to Chemical Engineering Problem Solving MATLAB Tutorial VI

Linear Algebra Notes

The mathematics of RAID-6

Linear Programming in Matrix Form

Duality in General Programs. Ryan Tibshirani Convex Optimization /36-725

5 INTEGER LINEAR PROGRAMMING (ILP) E. Amaldi Fondamenti di R.O. Politecnico di Milano 1

ANALYTIC HIERARCHY PROCESS (AHP) TUTORIAL

ECE 0142 Computer Organization. Lecture 3 Floating Point Representations

! Solve problem to optimality. ! Solve problem in poly-time. ! Solve arbitrary instances of the problem. #-approximation algorithm.

IEOR 4404 Homework #2 Intro OR: Deterministic Models February 14, 2011 Prof. Jay Sethuraman Page 1 of 5. Homework #2

HSL and its out-of-core solver

Implementation of Canny Edge Detector of color images on CELL/B.E. Architecture.

Poisson Equation Solver Parallelisation for Particle-in-Cell Model

Optimal Scheduling for Dependent Details Processing Using MS Excel Solver

Chapter 6: Sensitivity Analysis

Chapter 07: Instruction Level Parallelism VLIW, Vector, Array and Multithreaded Processors. Lesson 05: Array Processors

13 MATH FACTS a = The elements of a vector have a graphical interpretation, which is particularly easy to see in two or three dimensions.

Equilibrium computation: Part 1

Hardware-Aware Analysis and. Presentation Date: Sep 15 th 2009 Chrissie C. Cui

FUZZY CLUSTERING ANALYSIS OF DATA MINING: APPLICATION TO AN ACCIDENT MINING SYSTEM

by the matrix A results in a vector which is a reflection of the given

Efficient and Robust Allocation Algorithms in Clouds under Memory Constraints

Precision & Performance: Floating Point and IEEE 754 Compliance for NVIDIA GPUs

MATRIX ALGEBRA AND SYSTEMS OF EQUATIONS

α = u v. In other words, Orthogonal Projection

ANALYSIS, THEORY AND DESIGN OF LOGISTIC REGRESSION CLASSIFIERS USED FOR VERY LARGE SCALE DATA MINING

Contrôle dynamique de méthodes d approximation

Fast Exponential Computation on SIMD Architectures

A Static Analyzer for Large Safety-Critical Software. Considered Programs and Semantics. Automatic Program Verification by Abstract Interpretation

What is Linear Programming?

DATA ANALYSIS II. Matrix Algorithms

International Doctoral School Algorithmic Decision Theory: MCDA and MOO

Intro to GPU computing. Spring 2015 Mark Silberstein, , Technion 1

Oracle Database In-Memory The Next Big Thing

Ridgeway Kite Innova've Technology for Reservoir Engineers A Massively Parallel Architecture for Reservoir Simula'on

DEFERRED IMAGE PROCESSING IN INTEL IPP LIBRARY

Adding vectors We can do arithmetic with vectors. We ll start with vector addition and related operations. Suppose you have two vectors

Eigenvalues and Eigenvectors

Matrix Multiplication

Floating Point Fused Add-Subtract and Fused Dot-Product Units

Practical Guide to the Simplex Method of Linear Programming

How To Write A Hexadecimal Program

Notes on Determinant

Linear Programming. March 14, 2014

. P. 4.3 Basic feasible solutions and vertices of polyhedra. x 1. x 2

5 Homogeneous systems

Rethinking SIMD Vectorization for In-Memory Databases

General Framework for an Iterative Solution of Ax b. Jacobi s Method

Question 2: How do you solve a matrix equation using the matrix inverse?

1 Introduction. Linear Programming. Questions. A general optimization problem is of the form: choose x to. max f(x) subject to x S. where.

Monday January 19th 2015 Title: "Transmathematics - a survey of recent results on division by zero" Facilitator: TheNumberNullity / James Anderson, UK

Algebraic expressions are a combination of numbers and variables. Here are examples of some basic algebraic expressions.

Study of a neural network-based system for stability augmentation of an airplane

Intel Labs at ISSCC Copyright Intel Corporation 2012

High Performance Matrix Inversion with Several GPUs

Attention: This material is copyright Chris Hecker. All rights reserved.

Outline. Generalize Simple Example

npsolver A SAT Based Solver for Optimization Problems

Transcription:

A numerically adaptive implementation of the simplex method József Smidla, Péter Tar, István Maros Department of Computer Science and Systems Technology University of Pannonia 17th of December 2014. 1 / 21 József Smidla, Péter Tar, István Maros A numerically adaptive implementation of the simplex method

Outline Introduction 1 Introduction Pannon Optimizer Numerical errors 2 Hilbert matrix Condition number Large condition number aware logic 3 Tests Solving the Hilbert matrix Primary large condition number detector 2 / 21 József Smidla, Péter Tar, István Maros A numerically adaptive implementation of the simplex method

Pannon Optimizer Introduction Pannon Optimizer Numerical errors Optimizer library: Linear algebraic kernel Auxiliary classes Primal and dual simplex implementation Alternative sub-algorithms Our simplex solver can solve the problems of the NETLIB Next steps: Improve the efficiency Develop a parallel simplex solver Implement more advanced algorithms Develop and test new solutions Solve excessively instable problems 3 / 21 József Smidla, Péter Tar, István Maros A numerically adaptive implementation of the simplex method

Linear algebraic kernel Pannon Optimizer Numerical errors Notations: Linear programming problem min c T x Ax = b x j 0, j = 1...n Linear algebraic kernel Provides linear algebraic algorithms and data structures: Vector operations (e.g. dot product) FTRAN: α = B 1 a BTRAN: π T = h T B 1 where B is the actual basis 4 / 21 József Smidla, Péter Tar, István Maros A numerically adaptive implementation of the simplex method

Numerical errors Introduction Pannon Optimizer Numerical errors Floating point numbers: ( 1) s 1.m 1 m 2...m n 2 e Errors s {0,1}: sign m i : i th bit of the mantissa e: exponent Rounding error: A» B, and B 0 A = A + B Cancellation: Given A and B 0, A -B C = A + B Expectation: C = 0 Error: C = ±ε These errors can create a lot of fake nonzeros, lead to wrong results and slow down the solution process. 5 / 21 József Smidla, Péter Tar, István Maros A numerically adaptive implementation of the simplex method

Relative errors Introduction Pannon Optimizer Numerical errors x and y are floating point numbers, x, y > 0 δ x : relative error of x Relative error of the summation: Relative error of the subtraction: δ x+y = max{δ x,δ y } δ x y = x x y δ x + y x y δ y, where x > y If x y < 1 the relative error is amplified! Relative errors can accumulate. 6 / 21 József Smidla, Péter Tar, István Maros A numerically adaptive implementation of the simplex method

Hilbert matrix Introduction Hilbert matrix Condition number Large condition number aware logic Hilbert matrix: H n,n, where h i,j = 1 Example: H 4,4 = i+j 1 1 1 2 1 1 2 3 1 1 3 4 1 1 4 5 1 3 1 4 1 5 1 6, i,j = 1,...,n 1 4 1 5 1 6 1 7 We can construct the following LP problem: min 0 H n,n x = b x j 0,j = 1...n, and b i = n j=1 1 i + j 1 7 / 21 József Smidla, Péter Tar, István Maros A numerically adaptive implementation of the simplex method

Hilbert matrix Condition number Large condition number aware logic Open source solvers and the Hilbert matrix It is clear that if and only if x j = 1,j = 1...n, the solution is optimal We have tested CLP and GLPK Size GLPK Exact GLPK CLP 3 3 x j = 1±3.997 10 15 x j = 1 x j = 1 4 4 x j = 1±8.271 10 13 x j = 1 x j = 1 5 5 x j = 1±1.75 10 11 x j = 1 x j = 1 6 6 x j = 1±2.661 10 10 x j = 1 INFEASIBLE 7 7 x j = 1±1.157 x j = 1 INFEASIBLE 8 8 x j = 1±1.6001 x j = 1±0.201 INFEASIBLE 20 20 x j = 1±6.298 x j = 1±4.124 INFEASIBLE 100 100 0 x j 24.009 x j = 1±21.682 INFEASIBLE We have used CLP ang GLPK as libraries, the models were generated and solved by C++ programs. 8 / 21 József Smidla, Péter Tar, István Maros A numerically adaptive implementation of the simplex method

Condition number Introduction Hilbert matrix Condition number Large condition number aware logic Measures, how much the output changes if the input changes ( ) κ(a) = A A, where A S 1 0 = V U T, 0 0 ( S 0 and the singular value decomposition of A = U 0 0 ) V T If κ(a) is large, computing A is difficult The condition number of the n*n Hilbert matrix is very large, it grows as ( (1+ ) 2) 4n O n κ(h 10,10 ) 3.536 10 13 κ(h 100,100 ) 2.42 10 148 9 / 21 József Smidla, Péter Tar, István Maros A numerically adaptive implementation of the simplex method

Exact solver Introduction Hilbert matrix Condition number Large condition number aware logic Idea: use an exact arithmetic solver For example: open source tools, like mpf_class or mpq_class Problem: too slow use adaptive methods! One hour on this planet is 7 years on Earth. Great, we ll wait here until the solver finishes. 10 / 21 József Smidla, Péter Tar, István Maros A numerically adaptive implementation of the simplex method

Compute the condition number Hilbert matrix Condition number Large condition number aware logic Computing the condition number is difficult Assume, there exists an efficient and reliable algorithm for computing the condition number The condition number of the following matrix is large, but the problem is stable: min 2n j=n+1 x j [I H] = b x j 0,j = 1...2n, and b i = 1 If the starting basis is the unit matrix, columns of H will never enter to the basis if the condition number of the matrix is large, it does not necessary causes troubles 11 / 21 József Smidla, Péter Tar, István Maros A numerically adaptive implementation of the simplex method

Control logic Introduction Hilbert matrix Condition number Large condition number aware logic Requirements: Recognize the instable bases Adjust the precision if necessary If the problem is stable, the overhead of monitoring the problem must be close to zero Solution: Return to lower precision arithmetic if the basis becomes stable Primary large condition number detector: heuristic, quick algorithm, indicates that the current basis is instable Secondary large condition number detector: slow, but exact sensitivity analysis The primary detector minimizes the frequency of running the secondary detector minimizes the overhead 12 / 21 József Smidla, Péter Tar, István Maros A numerically adaptive implementation of the simplex method

Hilbert matrix Condition number Large condition number aware logic Primary large condition number detector We can not compute the condition number directly However, we can detect the effect of the large condition number We propose: The input of the classic FTRAN is vector a: B 1 a = α Create the perturbed ā copy of a Use a modified FTRAN, which computes B 1 a = α and B 1 ā = ᾱ The modified FTRAN perturbs every sum during the computation of ᾱ If r = max{ α, ᾱ } min{ α, ᾱ } is greater than a threshold, it means that the condition number is too large primary alarm 13 / 21 József Smidla, Péter Tar, István Maros A numerically adaptive implementation of the simplex method

Large condition number aware logic Hilbert matrix Condition number Large condition number aware logic The primary detector is executed if an error occurs, for example: fallback to phase-1 If a primary alarm occurs, the algorithm performs primary detector in the following iterations If primary alarms occur in every next iteration and r does not decrease secondary alarm the algorithm terminates If a primary alarm occurs, the algorithm performs a sensitivity analysis If the sensitivity analysis finds that the result is extremely instable secondary alarm If a secondary alarm occurs, the software restarts from the last basis with modified parameters (enabled scaling, switching to LU decomposition, etc.) In the last resort: The software restarts from the last basis with enhanced precision arithmetic 14 / 21 József Smidla, Péter Tar, István Maros A numerically adaptive implementation of the simplex method

Tests Introduction Tests Solving the Hilbert matrix Primary large condition number detector The tests were performed on the following environment: CPU: Intel(R) Core(TM) i5-3210m CPU @ 2.50GHz Memory: 8 GiB Operating system: Debian 7, 64 bit Tests with the following Open MP types: multiple precision floating point arithmetic: mpf_class 128 bit mpf_class 256 bit mpf_class 512 bit rational number arithmetic: mpq_class The output of the primary detector has been tested, too 15 / 21 József Smidla, Péter Tar, István Maros A numerically adaptive implementation of the simplex method

Solving the Hilbert matrix: mpf_class Tests Solving the Hilbert matrix Primary large condition number detector 16 / 21 József Smidla, Péter Tar, István Maros A numerically adaptive implementation of the simplex method

Solving large scale Hilbert matrix Tests Solving the Hilbert matrix Primary large condition number detector time unit: seconds mpq_class: rational number arithmetic is the most precise but the slowest Size mpf_class 128 mpf_class 256 mpf_class 512 mpq_class 80 0.166 0.172 0.193 6.67 90 0.242 0.2428 0.273 9.92 100 0.324 0.3449 0.375 14.2 500 38.83 40.5 45.53 4038.9 1000 315 322.17 368.19? 17 / 21 József Smidla, Péter Tar, István Maros A numerically adaptive implementation of the simplex method

Solving the Hilbert matrix: solutions Tests Solving the Hilbert matrix Primary large condition number detector Size IEEE 754 mpf_class 128 bit 3 x j = 1±1.044 10 14 x j = 1±2.449 10 40 4 x j = 1±1.517 10 13 x j = 1±2.457 10 40 5 x j = 1±6.395 10 13 x j = 1±2.379 10 40 6 x j = 1±4.369 10 10 x j = 1±1.635 10 39 7 INFEASIBLE x j = 1±2.478 10 40 8 INFEASIBLE x j = 1±2.372 10 40 20 INFEASIBLE x j = 1±6.016 10 25 100 INFEASIBLE x j = 1±8.983 10 24 500 INFEASIBLE x j = 1±3.467 10 22 1000 INFEASIBLE x j = 1±7.340 10 22 18 / 21 József Smidla, Péter Tar, István Maros A numerically adaptive implementation of the simplex method

Primary large condition number detector Tests Solving the Hilbert matrix Primary large condition number detector Output of the detector: r = max{ α, ᾱ } min{ α, ᾱ } δ = r 1 Problem 25FV47.MPS STOCFOR3.MPS PILOT.MPS MAROS-R7.MPS Value of δ after the last iteration 3.66059e-08 3.07735e-08 9.22276e-06 1.39086e-10 Hilbert 7*7 0.0167145 Hilbert 8*8 0.524724 Hilbert 20*20 2.05845 Hilbert 26*26 5.45188 Hilbert 100*100 0.323612 19 / 21 József Smidla, Péter Tar, István Maros A numerically adaptive implementation of the simplex method

Conclusions, next steps Tests Solving the Hilbert matrix Primary large condition number detector The primary and secondary detectors can minimize the overhead of the adaptivity Multiple precision arithmetic can be used for the excessively instable problems We have to integrate the enhanced precision arithmetic to the Pannon Optimizer We have to integrate the large condition number recognizer algorithm The large condition number recognizer can be accelerated with low-level optimization (SIMD architecture) Our goal: Implement a solver which runs fast on the stable problems, but recognizes the excessively instable problems Switches to more precise arithmetic, and solves these problems too 20 / 21 József Smidla, Péter Tar, István Maros A numerically adaptive implementation of the simplex method

Tests Solving the Hilbert matrix Primary large condition number detector Thank you for your attention! The research and publication has been supported by the European Union and Hungary and co-financed by the European Social Fund through the project TAMOP-4.2.2.C-11/1/KONV-2012-0004 - National Research Center for Development and Market Introduction of Advanced Information and Communication Technologies. 21 / 21 József Smidla, Péter Tar, István Maros A numerically adaptive implementation of the simplex method