Generated on Thu Apr 5 2018 19:44:19 for Gecode by doxygen 1.8.13
bab.hh
Go to the documentation of this file.
1 /* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
2 /*
3  * Main authors:
4  * Christian Schulte <schulte@gecode.org>
5  *
6  * Contributing authors:
7  * Guido Tack <tack@gecode.org>
8  *
9  * Copyright:
10  * Christian Schulte, 2004
11  * Guido Tack, 2004
12  *
13  * Last modified:
14  * $Date$ by $Author$
15  * $Revision$
16  *
17  * This file is part of Gecode, the generic constraint
18  * development environment:
19  * http://www.gecode.org
20  *
21  * Permission is hereby granted, free of charge, to any person obtaining
22  * a copy of this software and associated documentation files (the
23  * "Software"), to deal in the Software without restriction, including
24  * without limitation the rights to use, copy, modify, merge, publish,
25  * distribute, sublicense, and/or sell copies of the Software, and to
26  * permit persons to whom the Software is furnished to do so, subject to
27  * the following conditions:
28  *
29  * The above copyright notice and this permission notice shall be
30  * included in all copies or substantial portions of the Software.
31  *
32  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
33  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
34  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
35  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
36  * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
37  * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
38  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
39  *
40  */
41 
42 #ifndef __GECODE_SEARCH_SEQ_BAB_HH__
43 #define __GECODE_SEARCH_SEQ_BAB_HH__
44 
45 #include <gecode/search.hh>
46 #include <gecode/search/support.hh>
47 #include <gecode/search/worker.hh>
49 
50 namespace Gecode { namespace Search { namespace Seq {
51 
53  template<class Tracer>
54  class BAB : public Worker {
55  private:
57  Tracer tracer;
59  Options opt;
61  Path<Tracer> path;
63  Space* cur;
65  unsigned int d;
67  int mark;
69  Space* best;
70  public:
72  BAB(Space* s, const Options& o);
74  Space* next(void);
76  Statistics statistics(void) const;
78  void constrain(const Space& b);
80  void reset(Space* s);
82  NoGoods& nogoods(void);
84  ~BAB(void);
85  };
86 
87 }}}
88 
90 
91 #endif
92 
93 // STATISTICS: search-seq
Search engine statistics
Definition: search.hh:149
Search engine options
Definition: search.hh:748
BAB(Space *s, const Options &o)
Initialize with space s and search options o.
Definition: bab.hpp:46
void constrain(const Space &b)
Constrain future solutions to be better than b.
Definition: bab.hpp:165
Computation spaces.
Definition: core.hpp:1668
~BAB(void)
Destructor.
Definition: bab.hpp:207
NoGoods & nogoods(void)
Return no-goods.
Definition: bab.hpp:201
Search worker statistics
Definition: worker.hh:48
Depth-first path (stack of edges) supporting recomputation.
Definition: path.hh:64
struct Gecode::@585::NNF::@62::@63 b
For binary nodes (and, or, eqv)
No-goods recorded from restarts.
Definition: core.hpp:1514
Statistics statistics(void) const
Return statistics.
Definition: bab.hpp:159
Tracer.
Definition: tracer.hpp:153
Space * next(void)
Search for next better solution
Definition: bab.hpp:65
Implementation of depth-first branch-and-bound search engine.
Definition: bab.hh:54
Gecode toplevel namespace
void reset(void)
Reset.
Definition: statistics.hpp:43