Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
set_cover_reader.h
Go to the documentation of this file.
1// Copyright 2010-2024 Google LLC
2// Licensed under the Apache License, Version 2.0 (the "License");
3// you may not use this file except in compliance with the License.
4// You may obtain a copy of the License at
5//
6// http://www.apache.org/licenses/LICENSE-2.0
7//
8// Unless required by applicable law or agreed to in writing, software
9// distributed under the License is distributed on an "AS IS" BASIS,
10// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11// See the License for the specific language governing permissions and
12// limitations under the License.
13
14#ifndef OR_TOOLS_ALGORITHMS_SET_COVER_READER_H_
15#define OR_TOOLS_ALGORITHMS_SET_COVER_READER_H_
16
17#include "absl/strings/string_view.h"
19
20namespace operations_research {
21
22// Readers for set covering problems at
23// http://people.brunel.ac.uk/~mastjjb/jeb/orlib/scpinfo.html
24// All the instances have either the Beasley or the rail format.
25
26// There is currently NO error handling, as the files are in a limited number.
27// TODO(user): add proper error handling.
28
29// Also, note that the indices in the files, when mentioned, start from 1, while
30// SetCoverModel starts from 0, The translation is done at read time.
31
32// Reads a rail set cover problem create by Beasley and returns a SetCoverModel.
33// The format of all of these 80 data files is:
34// number of rows (m), number of columns (n)
35// for each column j, (j=1,...,n): the cost of the column c(j)
36// for each row i (i=1,...,m): the number of columns which cover
37// row i followed by a list of the columns which cover row i
38SetCoverModel ReadBeasleySetCoverProblem(absl::string_view filename);
39
40// Reads a rail set cover problem and returns a SetCoverModel.
41// The format of these test problems is:
42// number of rows (m), number of columns (n)
43// for each column j (j=1,...,n): the cost of the column, the
44// number of rows that it covers followed by a list of the rows
45// that it covers.
46SetCoverModel ReadRailSetCoverProblem(absl::string_view filename);
47
48} // namespace operations_research
49
50#endif // OR_TOOLS_ALGORITHMS_SET_COVER_READER_H_
In SWIG mode, we don't want anything besides these top-level includes.
SetCoverModel ReadBeasleySetCoverProblem(absl::string_view filename)
SetCoverModel ReadRailSetCoverProblem(absl::string_view filename)