@@ -154,7 +154,7 @@ void HighsMipSolver::run() {
154154 }
155155 // If the presolved problem is not suitable for Ines, then it's
156156 // recorded as "other"
157- if (!mipdata_->mipIsInes ()) mipdata_->mipIsOther ();
157+ if (!mipdata_->mipIsInes ()) mipdata_->mipIsOther ();
158158
159159 analysis_.mipTimerStart (kMipClockSolve );
160160
@@ -890,101 +890,90 @@ void HighsMipSolver::cleanupSolve(const bool mip_logging) {
890890 (long long unsigned )mipdata_->sb_lp_iterations ,
891891 (long long unsigned )mipdata_->sepa_lp_iterations ,
892892 (long long unsigned )mipdata_->heuristic_lp_iterations );
893- const HighsKnapsackData& knapsack_data = this ->mipdata_ ->knapsack_data_ ;
894- std::stringstream ss;
895- ss.str (std::string ());
896- ss << highsFormatToString (" Knapsack MIPs %d" ,
897- int (knapsack_data.num_problem ));
898- if (knapsack_data.num_problem > 0 )
899- ss << highsFormatToString (
900- " (mean items %d; mean capacity %d)" ,
901- int ((1.0 * knapsack_data.sum_variables ) / knapsack_data.num_problem ),
902- int ((1.0 * knapsack_data.sum_capacity ) / knapsack_data.num_problem ));
903- highsLogUser (options_mip_->log_options , HighsLogType::kInfo , " %s\n " ,
904- ss.str ().c_str ());
905- const HighsInesData& ines_data = this ->mipdata_ ->ines_data_ ;
906- ss.str (std::string ());
907- ss << highsFormatToString (" Ines MIPs %d" ,
908- int (ines_data.num_problem ));
909- if (ines_data.num_problem > 0 )
910- ss << highsFormatToString (
911- " (mean columns %d; mean rows %d)" ,
912- int ((1.0 * ines_data.sum_col ) / ines_data.num_problem ),
913- int ((1.0 * ines_data.sum_row ) / ines_data.num_problem ));
914- highsLogUser (options_mip_->log_options , HighsLogType::kInfo , " %s\n " ,
915- ss.str ().c_str ());
916893
917- if (knapsack_data.num_problem > 0 || ines_data.num_problem > 0 )
918- highsLogUser (options_mip_->log_options , HighsLogType::kInfo ,
919- " grep-knapsack-ines,%s,%s,%d,%" PRId64 " ,%" PRId64
920- " ,%d,%" PRId64 " ,%" PRId64 " \n " ,
921- model_->model_name_ .c_str (), options_mip_->presolve .c_str (),
922- knapsack_data.num_problem , knapsack_data.sum_variables ,
923- knapsack_data.sum_capacity , ines_data.num_problem ,
924- ines_data.sum_col , ines_data.sum_row );
925-
926- const std::vector<HighsMipProblemData>& mip_problem_data = this ->mipdata_ ->mip_problem_data_ ;
894+ const std::vector<HighsMipProblemData>& mip_problem_data =
895+ this ->mipdata_ ->mip_problem_data_ ;
927896 HighsInt num_mip = static_cast <HighsInt>(mip_problem_data.size ());
928897 HighsInt num_knapsack_mip = 0 ;
929898 size_t sum_knapsack_num_col = 0 ;
930899 HighsInt num_ines_mip = 0 ;
931900 size_t sum_ines_num_col = 0 ;
932901 size_t sum_ines_num_row = 0 ;
933902 HighsInt lc_max_submip_level = -1 ;
903+ HighsInt min_submip_sum_dim = kHighsIInf ;
934904 HighsInt min_submip_num_col = kHighsIInf ;
935905 HighsInt min_submip_num_row = kHighsIInf ;
906+ const bool full_submip_logging = true ;
936907 for (HighsInt iMip = 0 ; iMip < num_mip; iMip++) {
937908 switch (mip_problem_data[iMip].type ) {
938- case HighsMipProblemType::kKnapsack :
939- num_knapsack_mip++;
940- sum_knapsack_num_col += mip_problem_data[iMip].num_binary ;
941- break ;
942- case HighsMipProblemType::kInes :
943- num_ines_mip++;
944- sum_ines_num_col += mip_problem_data[iMip].num_binary ;
945- sum_ines_num_row += mip_problem_data[iMip].num_row ;
946- break ;
947- case HighsMipProblemType::kOther :
948- default :
949- break ;
909+ case HighsMipProblemType::kKnapsack :
910+ num_knapsack_mip++;
911+ sum_knapsack_num_col += mip_problem_data[iMip].num_binary ;
912+ break ;
913+ case HighsMipProblemType::kInes :
914+ num_ines_mip++;
915+ sum_ines_num_col += mip_problem_data[iMip].num_binary ;
916+ sum_ines_num_row += mip_problem_data[iMip].num_row ;
917+ break ;
918+ case HighsMipProblemType::kOther :
919+ default :
920+ break ;
921+ }
922+ HighsInt lc_submip_level = mip_problem_data[iMip].submip_level ;
923+
924+ lc_max_submip_level = std::max (lc_submip_level, lc_max_submip_level);
925+ HighsInt submip_num_col = mip_problem_data[iMip].num_continuous +
926+ mip_problem_data[iMip].num_binary +
927+ mip_problem_data[iMip].num_general_integer +
928+ mip_problem_data[iMip].num_implied_integer ;
929+ HighsInt submip_num_row = mip_problem_data[iMip].num_row ;
930+ HighsInt submip_sum_dim = submip_num_col + submip_num_row;
931+ if (min_submip_sum_dim > submip_sum_dim) {
932+ min_submip_sum_dim = submip_sum_dim;
933+ min_submip_num_col = submip_num_col;
934+ min_submip_num_row = submip_num_row;
950935 }
951- lc_max_submip_level = std::max (mip_problem_data[iMip].submip_level , lc_max_submip_level);
952- HighsInt submip_num_col =
953- mip_problem_data[iMip].num_continuous +
954- mip_problem_data[iMip].num_binary +
955- mip_problem_data[iMip].num_general_integer +
956- mip_problem_data[iMip].num_implied_integer ;
957-
958- min_submip_num_col = std::min (submip_num_col, min_submip_num_col);
959- min_submip_num_row = std::min (mip_problem_data[iMip].num_row , min_submip_num_row);
936+ if (full_submip_logging)
937+ highsLogUser (options_mip_->log_options , HighsLogType::kInfo ,
938+ " MIP %3d (level = %2d; %3d conts; %3d bin; "
939+ " %3d gen; %3d impl; cols / rows: %3d / %3d; type %s)\n " ,
940+ int (iMip), int (lc_submip_level),
941+ int (mip_problem_data[iMip].num_continuous ),
942+ int (mip_problem_data[iMip].num_binary ),
943+ int (mip_problem_data[iMip].num_general_integer ),
944+ int (mip_problem_data[iMip].num_implied_integer ),
945+ int (submip_num_col), int (submip_num_row),
946+ mip_problem_data[iMip].type == HighsMipProblemType::kKnapsack
947+ ? " Knapsack"
948+ : mip_problem_data[iMip].type == HighsMipProblemType::kInes
949+ ? " Ines"
950+ : " Other" );
960951 }
961952 highsLogUser (options_mip_->log_options , HighsLogType::kInfo ,
962- " MIPs %d (%d knapsack; %d Ines)\n " ,
963- int (num_mip),
964- int (num_knapsack_mip),
965- int (num_ines_mip));
966-
953+ " MIPs %d (%d knapsack; %d Ines)\n " , int (num_mip),
954+ int (num_knapsack_mip), int (num_ines_mip));
955+
956+ std::stringstream ss;
967957 ss.str (std::string ());
968958 ss << highsFormatToString (" Max sub-MIP depth %d" , int (max_submip_level));
969- if (max_submip_level > 0 )
970- ss << highsFormatToString (" min cols/rows = %d/%d\n " );
959+ if (max_submip_level > 0 )
960+ ss << highsFormatToString (" (min cols/rows: %d/%d)\n " ,
961+ int (min_submip_num_col), int (min_submip_num_row));
971962 highsLogUser (options_mip_->log_options , HighsLogType::kInfo , " %s\n " ,
972- ss.str ().c_str ());
963+ ss.str ().c_str (), int (min_submip_num_col),
964+ int (min_submip_num_row));
973965
974966 if (num_knapsack_mip > 0 || num_ines_mip > 0 )
975967 highsLogUser (options_mip_->log_options , HighsLogType::kInfo ,
976- " grep-knapsack-ines,%s,%s,%d,%" PRId64 " %d,%" PRId64 " ,%" PRId64 " \n " ,
968+ " grep-knapsack-ines,%s,%s,%d,%" PRId64 " ,%d,%" PRId64
969+ " ,%" PRId64 " \n " ,
977970 model_->model_name_ .c_str (), options_mip_->presolve .c_str (),
978- num_knapsack_mip, sum_knapsack_num_col,
979- num_ines_mip, sum_ines_num_col, sum_ines_num_row);
971+ num_knapsack_mip, sum_knapsack_num_col, num_ines_mip,
972+ sum_ines_num_col, sum_ines_num_row);
980973
981974 if (max_submip_level > 0 ) {
982975 }
983-
984-
985-
986-
987-
976+
988977 if (!timeless_log) analysis_.reportMipTimer ();
989978
990979 assert (modelstatus_ != HighsModelStatus::kNotset );
0 commit comments