Stay organized with collections
Save and categorize content based on your preferences.
C++ Reference: class RelaxRandomConstraintsGenerator
Note: This documentation is automatically generated.
Pick a random subset of constraints and relax all the variables of these
constraints. Note that to satisfy the difficulty, we might not relax all the
variable of the "last" constraint.
TODO(user): In the presence of connected components, this should just work
on one of them.
Method |
Generate | Return type: Neighborhood Arguments: const CpSolverResponse& initial_solution,
double difficulty, absl::BitGenRef random |
RelaxRandomConstraintsGenerator | Return type: explicit Arguments:
NeighborhoodGeneratorHelper const* helper, const std::string& name |
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-08-06 UTC.
[null,null,["Last updated 2024-08-06 UTC."],[[["\u003cp\u003eRelaxRandomConstraintsGenerator randomly selects a subset of constraints and relaxes their variables to explore different solutions.\u003c/p\u003e\n"],["\u003cp\u003eThe relaxation process may not apply to all variables within the final constraint to meet specified difficulty levels.\u003c/p\u003e\n"],["\u003cp\u003eThis generator currently operates on the entire problem, but future improvements aim to focus on individual connected components for enhanced efficiency.\u003c/p\u003e\n"],["\u003cp\u003eUsers can customize the generation process using the \u003ccode\u003eGenerate\u003c/code\u003e method with parameters like initial solution, difficulty, and random number generation.\u003c/p\u003e\n"]]],["The `RelaxRandomConstraintsGenerator` class in C++ randomly selects a subset of constraints and relaxes their variables. The `Generate` method, taking the initial solution, a difficulty parameter, and a random number generator as input, produces a `Neighborhood`. The `RelaxRandomConstraintsGenerator` constructor takes a `NeighborhoodGeneratorHelper` and a name. It might not relax all variables in the \"last\" constraint, to ensure a given difficulty is met. In connected components, it operates on one of them.\n"],null,["# RelaxRandomConstraintsGenerator\n\nC++ Reference: class RelaxRandomConstraintsGenerator\n====================================================\n\n\nNote: This documentation is automatically generated.\nPick a random subset of constraints and relax all the variables of these constraints. Note that to satisfy the difficulty, we might not relax all the variable of the \"last\" constraint. \n\nTODO(user): In the presence of connected components, this should just work on one of them.\n\n| Method ||\n|-------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------|\n| [`Generate`](https://github.com/google/or-tools/blob/v9.4/ortools/sat/cp_model_lns.h#L492) | Return type: `Neighborhood ` Arguments: `const CpSolverResponse& initial_solution, double difficulty, absl::BitGenRef random` \u003cbr /\u003e |\n| [`RelaxRandomConstraintsGenerator`](https://github.com/google/or-tools/blob/v9.4/ortools/sat/cp_model_lns.h#L489) | Return type: `explicit ` Arguments: ` NeighborhoodGeneratorHelper const* helper, const std::string& name` \u003cbr /\u003e |"]]