Show / Hide Table of Contents

    Presolve removed variables

    Solvers are pretty clever and usually find spots in the model that are not relevant to the solution. These spots will be removed and therefore the matrix shrinks.

    You might want to have a closer look at the solver's work and check if your model or data has a general defect. For example, a group of variables (a VariableCollection) is completely removed: is it really unnecessary? Have constraints been forgotten?

    Solver-output as shown in the getting-started example

    Presolve removed 22 rows and 12 columns
    Presolve time: 0.00s
    

    Get more information

    Before creating the ModelScope, the settings have to be configured in order to compute the removed variables.
    Insert this configuration into the example.

    var scopeSettings = new Configuration()
    {
        NameHandling = NameHandlingStyle.UniqueLongNames,
        ComputeRemovedVariables = true;
    };
    

    The Statistics will then include a column RemovedInPreprocess in the the export. Just export the Statistics by using:

    // Write Statistics to AppDomain.CurrentDomain.BaseDirectory
    designModel.Model.VariableStatistics.WriteCSV(AppDomain.CurrentDomain.BaseDirectory);
    

    The Statistics in this case will be:

    VariableNameInModel VariableLongName LB UB SubjectivePrice SolutionValue RemovedInPreprocess NumberOfTermsInRestrictions Index0
    A Flow Paderborn to New York_A 0.00 Infinity 3.00 100.00 True 4 Edge Paderborn to New York
    AQ Flow Paderborn to São Paulo_AQ 0.00 Infinity 5.00 0.00 True 4 Edge Paderborn to São Paulo
    Ag Flow Beijing to Paderborn_Ag 0.00 50.00 1.00 50.00 True 4 Edge Beijing to Paderborn
    Aw Flow New York to Beijing_Aw 0.00 Infinity 2.00 0.00 True 4 Edge New York to Beijing
    B Flow Beijing to São Paulo_B 0.00 75.00 1.00 0.00 True 4 Edge Beijing to São Paulo
    BQ Flow São Paulo to San Francisco_BQ 0.00 Infinity 4.00 50.00 True 4 Edge São Paulo to San Francisco

    Which actually means that this model is so easy to solve, that the solver does all the work in preprocessing and removes all the variables. (Usually just some variables are removed.)

    Note: Use any text editor like notepad or similar to view the csv-files. depending on your machine's region-settings, Microsoft Excel will read the file as a worksheet and split the lines into columns.

    Back to top Copyright © OPTANO GmbH generated with DocFX
    Privacy Policy | Impressum – Legal Notice