routing: mv routing stuff from constraint_solver/ to routing/
* remove routing_ prefix to file * now have a pywrapcp and a pywraprouting binding.
This commit is contained in:
@@ -604,7 +604,7 @@ cc_binary(
|
||||
srcs = ["random_tsp.cc"],
|
||||
deps = [
|
||||
"//ortools/base",
|
||||
"//ortools/constraint_solver:routing",
|
||||
"//ortools/routing",
|
||||
"//ortools/util:random_engine",
|
||||
"@com_google_absl//absl/strings",
|
||||
"@com_google_protobuf//:protobuf",
|
||||
@@ -618,7 +618,7 @@ cc_binary(
|
||||
"//ortools/base",
|
||||
"//ortools/base:file",
|
||||
"//ortools/base:mathutil",
|
||||
"//ortools/constraint_solver:routing",
|
||||
"//ortools/routing",
|
||||
"//ortools/routing/parsers:lilim_parser",
|
||||
"@com_google_absl//absl/flags:flag",
|
||||
"@com_google_absl//absl/strings",
|
||||
@@ -1012,6 +1012,7 @@ cc_binary(
|
||||
"//ortools/pdlp:solvers_cc_proto",
|
||||
"//ortools/port:proto_utils",
|
||||
"//ortools/util:file_util",
|
||||
"//ortools/util:fp_roundtrip_conv",
|
||||
"//ortools/util:sigint",
|
||||
"@com_google_absl//absl/flags:flag",
|
||||
"@com_google_absl//absl/log:check",
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "absl/flags/flag.h"
|
||||
#include "ortools/base/init_google.h"
|
||||
#include "ortools/base/logging.h"
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "absl/flags/flag.h"
|
||||
#include "ortools/base/init_google.h"
|
||||
#include "ortools/base/logging.h"
|
||||
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
#include "ortools/pdlp/solvers.pb.h"
|
||||
#include "ortools/port/proto_utils.h"
|
||||
#include "ortools/util/file_util.h"
|
||||
#include "ortools/util/fp_roundtrip_conv.h"
|
||||
#include "ortools/util/sigint.h"
|
||||
|
||||
// TODO: .mps.gz files aren't working. As a workaround, use .mps.
|
||||
@@ -108,8 +109,9 @@ void Solve(const std::string& input, absl::string_view params_str,
|
||||
// TODO: In what format should we write the dual solution?
|
||||
if (!sol_file.empty() && convergence_information.has_value()) {
|
||||
std::string sol_string;
|
||||
absl::StrAppend(&sol_string,
|
||||
"=obj= ", convergence_information->primal_objective(),
|
||||
absl::StrAppend(
|
||||
&sol_string, "=obj= ",
|
||||
RoundTripDoubleFormat(convergence_information->primal_objective()),
|
||||
"\n");
|
||||
for (int64_t i = 0; i < result.primal_solution.size(); ++i) {
|
||||
std::string name;
|
||||
@@ -118,7 +120,8 @@ void Solve(const std::string& input, absl::string_view params_str,
|
||||
} else {
|
||||
name = absl::StrCat("var", i);
|
||||
}
|
||||
absl::StrAppend(&sol_string, name, " ", result.primal_solution(i), "\n");
|
||||
absl::StrAppend(&sol_string, name, " ",
|
||||
RoundTripDoubleFormat(result.primal_solution(i)), "\n");
|
||||
}
|
||||
LOG(INFO) << "Writing .sol solution to '" << sol_file << "'.\n";
|
||||
CHECK_OK(file::SetContents(sol_file, sol_string, file::Defaults()));
|
||||
|
||||
@@ -57,14 +57,14 @@
|
||||
#include "ortools/base/mathutil.h"
|
||||
#include "ortools/base/timer.h"
|
||||
#include "ortools/constraint_solver/constraint_solver.h"
|
||||
#include "ortools/constraint_solver/routing.h"
|
||||
#include "ortools/constraint_solver/routing_index_manager.h"
|
||||
#include "ortools/constraint_solver/routing_parameters.h"
|
||||
#include "ortools/constraint_solver/routing_types.h"
|
||||
#include "ortools/routing/enums.pb.h"
|
||||
#include "ortools/routing/index_manager.h"
|
||||
#include "ortools/routing/parameters.h"
|
||||
#include "ortools/routing/parameters.pb.h"
|
||||
#include "ortools/routing/parsers/lilim_parser.h"
|
||||
#include "ortools/routing/parsers/simple_graph.h"
|
||||
#include "ortools/routing/routing.h"
|
||||
#include "ortools/routing/types.h"
|
||||
|
||||
ABSL_FLAG(std::string, pdp_file, "",
|
||||
"File containing the Pickup and Delivery Problem to solve.");
|
||||
|
||||
@@ -33,10 +33,10 @@
|
||||
#include "absl/strings/str_cat.h"
|
||||
#include "google/protobuf/text_format.h"
|
||||
#include "ortools/base/logging.h"
|
||||
#include "ortools/constraint_solver/routing.h"
|
||||
#include "ortools/constraint_solver/routing_index_manager.h"
|
||||
#include "ortools/constraint_solver/routing_parameters.h"
|
||||
#include "ortools//routing/parameters.pb.h"
|
||||
#include "ortools/routing/index_manager.h"
|
||||
#include "ortools/routing/parameters.h"
|
||||
#include "ortools/routing/parameters.pb.h"
|
||||
#include "ortools/routing/routing.h"
|
||||
#include "ortools/util/random_engine.h"
|
||||
|
||||
ABSL_FLAG(int, tsp_size, 10, "Size of Traveling Salesman Problem instance.");
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "absl/flags/flag.h"
|
||||
#include "absl/flags/parse.h"
|
||||
#include "absl/flags/usage.h"
|
||||
#include "absl/log/initialize.h"
|
||||
|
||||
Reference in New Issue
Block a user