Generated on: Thu Mar 29 07:46:58 PDT 2012 for custom file set
// doxy/ or-tools/ examples/ cpp/

or-tools/examples/cpp/golomb.cc File Reference

#include <cstdio>
#include "base/commandlineflags.h"
#include "base/integral_types.h"
#include "base/logging.h"
#include "base/scoped_ptr.h"
#include "base/stringprintf.h"
#include "constraint_solver/constraint_solver.h"

Go to the source code of this file.

Namespaces

namespace  operations_research

Functions

 DEFINE_bool (print, false,"If true, print the minimal solution.")
 Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
 DEFINE_int32 (size, 0,"Size of the problem. If equal to 0, will test several increasing sizes.")
void operations_research::GolombRuler (int size)
int main (int argc, char **argv)
 namespace operations_research

Variables

static const int kBestSolutions []
static const int kKnownSolutions = 19


Function Documentation

DEFINE_bool ( print  ,
false  ,
"If   true,
print the minimal solution."   
)

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.

You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Golomb ruler problem

find minimal ruler so that the differences between ticks are unique.

First solutions: 0, 1 0, 1, 3 0, 1, 4, 6 0, 1, 4, 9, 11 0, 1, 4, 10, 12, 17 0, 1, 4, 10, 18, 23, 25

DEFINE_int32 ( size  ,
,
"Size of the problem. If equal to   0,
will test several increasing sizes."   
)

int main ( int  argc,
char **  argv 
)

namespace operations_research

Definition at line 97 of file golomb.cc.


Variable Documentation

const int kBestSolutions[] [static]

Initial value:

 {
  0, 1, 3, 6, 11, 17, 25, 34, 44, 55, 72, 85,
  
  106, 127, 151, 177, 199, 216, 246
}

Definition at line 40 of file golomb.cc.

const int kKnownSolutions = 19 [static]

Definition at line 46 of file golomb.cc.