Stay organized with collections
Save and categorize content based on your preferences.
C++ Reference: class PathOperator
Note: This documentation is automatically generated.
Base class of the local search operators dedicated to path modifications
(a path is a set of nodes linked together by arcs).
This family of neighborhoods supposes they are handling next variables
representing the arcs (var[i] represents the node immediately after i on
a path).
Several services are provided:
- arc manipulators (SetNext(), ReverseChain(), MoveChain())
- path inspectors (Next(), Prev(), IsPathEnd())
- path iterators: operators need a given number of nodes to define a
neighbor; this class provides the iteration on a given number of (base)
nodes which can be used to define a neighbor (through the BaseNode method)
Subclasses only need to override MakeNeighbor to create neighbors using
the services above (no direct manipulation of assignments).
[[["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\u003e\u003ccode\u003ePathOperator\u003c/code\u003e is a base class for local search operators that modify paths represented by linked nodes.\u003c/p\u003e\n"],["\u003cp\u003eIt provides functionalities for manipulating arcs within paths (e.g., reversing, moving).\u003c/p\u003e\n"],["\u003cp\u003eIt offers methods for inspecting paths, such as determining the next or previous node.\u003c/p\u003e\n"],["\u003cp\u003eSubclasses can extend \u003ccode\u003ePathOperator\u003c/code\u003e by implementing \u003ccode\u003eMakeNeighbor\u003c/code\u003e to define specific path modifications.\u003c/p\u003e\n"],["\u003cp\u003eThe class supports efficient iteration over base nodes for defining neighbors.\u003c/p\u003e\n"]]],["The `PathOperator` class in C++ facilitates local search operations on paths within a network. It provides methods for modifying paths, including `SetNext`, `ReverseChain`, and `MoveChain`, and for inspecting paths, like `Next`, `Prev`, and `IsPathEnd`. It uses a base node iteration to define neighbors. The `MakeNeighbor` method is overriden in subclasses to generate neighbors. Key information includes the use of next variables to represent arcs, the number of next variables (`number_of_nexts`), and path identification (`Path`).\n"],null,["# PathOperator\n\nC++ Reference: class PathOperator\n=================================\n\n\nNote: This documentation is automatically generated.\nBase class of the local search operators dedicated to path modifications (a path is a set of nodes linked together by arcs). This family of neighborhoods supposes they are handling next variables representing the arcs (var\\[i\\] represents the node immediately after i on a path). Several services are provided: \n- arc manipulators (SetNext(), ReverseChain(), MoveChain()) \n- path inspectors (Next(), Prev(), IsPathEnd()) \n- path iterators: operators need a given number of nodes to define a neighbor; this class provides the iteration on a given number of (base) nodes which can be used to define a neighbor (through the BaseNode method) \nSubclasses only need to override MakeNeighbor to create neighbors using the services above (no direct manipulation of assignments).\n\n| Method ||\n|------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [`MakeNeighbor`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/constraint_solveri.h#L1349) | Return type: `virtual bool ` \u003cbr /\u003e |\n| [`Next`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/constraint_solveri.h#L1356) | Return type: `int64_t ` Arguments: `int64_t node` Returns the node after node in the current delta. |\n| [`number_of_nexts`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/constraint_solveri.h#L1375) | Return type: `int ` Number of next variables. |\n| [`Path`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/constraint_solveri.h#L1370) | Return type: `int64_t ` Arguments: `int64_t node` Returns the index of the path to which node belongs in the current delta. Only returns a valid value if path variables are taken into account. |\n| [`PathOperator`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/constraint_solveri.h#L1337) | \u003cbr /\u003e Arguments: `const std::vector\u003cIntVar*\u003e& next_vars, const std::vector\u003cIntVar*\u003e& path_vars, IterationParameters iteration_parameters` Builds an instance of PathOperator from next and path variables. |\n| [`PathOperator`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/constraint_solveri.h#L1340) | \u003cbr /\u003e Arguments: `const std::vector\u003cIntVar*\u003e& next_vars, const std::vector\u003cIntVar*\u003e& path_vars, int number_of_base_nodes, bool skip_locally_optimal_paths, bool accept_path_end_base, std::function\u003cint(int64_t)\u003e start_empty_path_class` \u003cbr /\u003e |\n| [`~PathOperator`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/constraint_solveri.h#L1348) | \u003cbr /\u003e |\n| [`Prev`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/constraint_solveri.h#L1362) | Return type: `int64_t ` Arguments: `int64_t node` Returns the node before node in the current delta. |\n| [`Reset`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/constraint_solveri.h#L1350) | Return type: `void ` \u003cbr /\u003e |\n| [`SkipUnchanged`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/constraint_solveri.h#L1353) | Return type: `bool ` Arguments: `int index` TODO(user): Make the following methods protected. |"]]