Google OR-Tools v9.12
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
set_cover_solve.cc File Reference
#include <string>
#include <vector>
#include "absl/flags/flag.h"
#include "absl/log/check.h"
#include "absl/strings/match.h"
#include "absl/strings/str_join.h"
#include "absl/strings/string_view.h"
#include "absl/time/time.h"
#include "ortools/algorithms/set_cover_heuristics.h"
#include "ortools/algorithms/set_cover_invariant.h"
#include "ortools/algorithms/set_cover_model.h"
#include "ortools/algorithms/set_cover_reader.h"
#include "ortools/base/init_google.h"
#include "ortools/base/logging.h"
#include "ortools/base/timer.h"

Go to the source code of this file.

Namespaces

namespace  operations_research
 In SWIG mode, we don't want anything besides these top-level includes.
 

Enumerations

enum class  operations_research::FileFormat {
  operations_research::EMPTY , operations_research::ORLIB_SCP , operations_research::ORLIB_RAIL , operations_research::FIMI_DAT ,
  operations_research::PROTO , operations_research::PROTO_BIN , operations_research::TXT
}
 

Functions

 ABSL_FLAG (std::string, input, "", "REQUIRED: Input file name.")
 
 ABSL_FLAG (std::string, input_fmt, "", "REQUIRED: Input file format. Either proto, proto_bin, OrlibRail, " "OrlibScp or FimiDat.")
 
 ABSL_FLAG (std::string, hint_sol, "", "Input file name for solution.")
 
 ABSL_FLAG (std::string, hint_fmt, "", "Input file format for solution.")
 
 ABSL_FLAG (std::string, output, "", "If non-empty, write the returned solution to the given file.")
 
 ABSL_FLAG (std::string, output_fmt, "", "If out is non-empty, use the given format for the output.")
 
 ABSL_FLAG (std::string, output_model, "", "If non-empty, write the set cover model to the given file. ")
 
 ABSL_FLAG (bool, generate, false, "Generate a new model from the input model.")
 
 ABSL_FLAG (int, num_elements_wanted, 0, "Number of elements wanted in the new generated model.")
 
 ABSL_FLAG (int, num_subsets_wanted, 0, "Number of subsets wanted in the new generated model.")
 
 ABSL_FLAG (float, row_scale, 1.0, "Row scale for the new generated model.")
 
 ABSL_FLAG (float, column_scale, 1.0, "Column scale for the new generated model.")
 
 ABSL_FLAG (float, cost_scale, 1.0, "Cost scale for the new generated model.")
 
 ABSL_FLAG (std::string, generation, "", "First-solution generation method.")
 
 ABSL_FLAG (std::string, improvement, "", "Solution improvement method.")
 
 ABSL_FLAG (int, num_threads, 1, "Number of threads to use by the underlying solver.")
 
 ABSL_FLAG (bool, solve, false, "Solve the model.")
 
 ABSL_FLAG (bool, stats, false, "Log stats about the model.")
 
void operations_research::LogStats (std::string name, SetCoverModel *model)
 
void operations_research::LogCostAndTiming (std::string name, std::string algo, double cost, BaseInt solution_cardinality, const WallTimer &timer)
 
void operations_research::LogCostAndTiming (std::string name, std::string algo, const SetCoverInvariant &inv, const WallTimer &timer)
 
FileFormat operations_research::ParseFileFormat (const std::string &format_name)
 
SetCoverModel operations_research::ReadModel (absl::string_view input_file, FileFormat input_format)
 
SubsetBoolVector operations_research::ReadSolution (absl::string_view input_file, FileFormat input_format)
 
void operations_research::WriteModel (const SetCoverModel &model, const std::string &output_file, FileFormat output_format)
 
void operations_research::WriteSolution (const SetCoverModel &model, const SubsetBoolVector &solution, absl::string_view output_file, FileFormat output_format)
 
SetCoverInvariant operations_research::RunLazyElementDegree (std::string name, SetCoverModel *model)
 
void operations_research::Run ()
 
int main (int argc, char **argv)
 

Function Documentation

◆ ABSL_FLAG() [1/18]

ABSL_FLAG ( bool ,
generate ,
false ,
"Generate a new model from the input model."  )

◆ ABSL_FLAG() [2/18]

ABSL_FLAG ( bool ,
solve ,
false ,
"Solve the model."  )

◆ ABSL_FLAG() [3/18]

ABSL_FLAG ( bool ,
stats ,
false ,
"Log stats about the model."  )

◆ ABSL_FLAG() [4/18]

ABSL_FLAG ( float ,
column_scale ,
1. 0,
"Column scale for the new generated model."  )

◆ ABSL_FLAG() [5/18]

ABSL_FLAG ( float ,
cost_scale ,
1. 0,
"Cost scale for the new generated model."  )

◆ ABSL_FLAG() [6/18]

ABSL_FLAG ( float ,
row_scale ,
1. 0,
"Row scale for the new generated model."  )

◆ ABSL_FLAG() [7/18]

ABSL_FLAG ( int ,
num_elements_wanted ,
0 ,
"Number of elements wanted in the new generated model."  )

◆ ABSL_FLAG() [8/18]

ABSL_FLAG ( int ,
num_subsets_wanted ,
0 ,
"Number of subsets wanted in the new generated model."  )

◆ ABSL_FLAG() [9/18]

ABSL_FLAG ( int ,
num_threads ,
1 ,
"Number of threads to use by the underlying solver."  )

◆ ABSL_FLAG() [10/18]

ABSL_FLAG ( std::string ,
generation ,
"" ,
"First-solution generation method."  )

◆ ABSL_FLAG() [11/18]

ABSL_FLAG ( std::string ,
hint_fmt ,
"" ,
"Input file format for solution."  )

◆ ABSL_FLAG() [12/18]

ABSL_FLAG ( std::string ,
hint_sol ,
"" ,
"Input file name for solution."  )

◆ ABSL_FLAG() [13/18]

ABSL_FLAG ( std::string ,
improvement ,
"" ,
"Solution improvement method."  )

◆ ABSL_FLAG() [14/18]

ABSL_FLAG ( std::string ,
input ,
"" ,
"REQUIRED: Input file name."  )

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

◆ ABSL_FLAG() [15/18]

ABSL_FLAG ( std::string ,
input_fmt ,
"" ,
"REQUIRED: Input file format. Either proto,
proto_bin ,
OrlibRail ,
" "OrlibScp or FimiDat."  )

◆ ABSL_FLAG() [16/18]

ABSL_FLAG ( std::string ,
output ,
"" ,
"If non- empty,
write the returned solution to the given file."  )

◆ ABSL_FLAG() [17/18]

ABSL_FLAG ( std::string ,
output_fmt ,
"" ,
"If out is non- empty,
use the given format for the output."  )

◆ ABSL_FLAG() [18/18]

ABSL_FLAG ( std::string ,
output_model ,
"" ,
"If non- empty,
write the set cover model to the given file. "  )

◆ main()

int main ( int argc,
char ** argv )

Definition at line 272 of file set_cover_solve.cc.