Stay organized with collections
Save and categorize content based on your preferences.
C++ Reference: class VariableGraphNeighborhoodGenerator
Note: This documentation is automatically generated.
Pick a random subset of variables that are constructed by a BFS in the
variable <-> constraint graph. That is, pick a random variable, then all the
variable connected by some constraint to the first one, and so on. The
variable of the last "level" are selected randomly.
Note that in the presence of connected component, this works correctly
already.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-08-06 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eVariableGraphNeighborhoodGenerator\u003c/code\u003e selects a random subset of variables using a Breadth-First Search (BFS) approach in the variable-constraint graph.\u003c/p\u003e\n"],["\u003cp\u003eVariables are chosen iteratively, starting with a random variable, then expanding to include all variables connected by constraints, with the final "level" variables selected randomly.\u003c/p\u003e\n"],["\u003cp\u003eIt functions effectively even when dealing with connected components within the graph.\u003c/p\u003e\n"],["\u003cp\u003eThis generator can be used to create neighborhoods for local search, aiding in the exploration of the solution space for constraint satisfaction problems.\u003c/p\u003e\n"]]],["The `VariableGraphNeighborhoodGenerator` class constructs a random subset of variables via a Breadth-First Search (BFS) in a variable-constraint graph. It selects an initial random variable, then all connected variables, and so forth. Variables from the last BFS level are chosen randomly. The `Generate` method returns a `Neighborhood`, taking the current `CpSolverResponse`, a difficulty parameter, and a random bit generator as arguments. The `VariableGraphNeighborhoodGenerator` method is a constructor, taking a `NeighborhoodGeneratorHelper` and a name.\n"],null,["# VariableGraphNeighborhoodGenerator\n\nC++ Reference: class VariableGraphNeighborhoodGenerator\n=======================================================\n\n\nNote: This documentation is automatically generated.\nPick a random subset of variables that are constructed by a BFS in the variable \\\u003c-\\\u003e constraint graph. That is, pick a random variable, then all the variable connected by some constraint to the first one, and so on. The variable of the last \"level\" are selected randomly. \n\nNote that in the presence of connected component, this works correctly already.\n\n| Method ||\n|----------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------|\n| [`Generate`](https://github.com/google/or-tools/blob/v9.4/ortools/sat/cp_model_lns.h#L508) | Return type: `Neighborhood ` Arguments: `const CpSolverResponse& initial_solution, double difficulty, absl::BitGenRef random` \u003cbr /\u003e |\n| [`VariableGraphNeighborhoodGenerator`](https://github.com/google/or-tools/blob/v9.4/ortools/sat/cp_model_lns.h#L505) | Return type: `explicit ` Arguments: ` NeighborhoodGeneratorHelper const* helper, const std::string& name` \u003cbr /\u003e |"]]