5. Defining search primitives: the n-Queens Problem — or-tools User's Manual
This chapter is about the customization of the search. What stategy(ies) to use to branch, i.e. what variables to select and what value(s) to assign to them? How to use nested searches, i.e. searches in subtrees? And so on.
The or-tools CP solver is quite flexible and comes with several tools (Decisions, DecisionBuilders, ...) that we call search primitives. Some are predefined and can be used right out of the box while others can be customized thanks to callbacks. You can also combine different search strategies. If needed, you can define your own search primitive classes by inheriting from base classes.
To efficiently use your tools, you need to know them a little and this chapter introduces you in a gentle manner to the inner working of the solver. The covered material is enough for you to understand how you can customize your search primitives without being drowned in the often tedious details of the implementation[1].
To illustrate the customization of the search, we try to solve the n-Queen Problem that we have introduced in the chapter Introduction to constraint programming.
Read full article from 5. Defining search primitives: the n-Queens Problem — or-tools User's Manual
No comments:
Post a Comment