Schur_BHR.cpp File Reference

Program from [BHR 2006], adapted to C++. More...

#include <cstdio>
#include <algorithm>
#include <iostream>
#include <cassert>
#include <string>

Go to the source code of this file.


#define COLS   3
 number of colours
#define UPB   24
 maximal n
#define LOWB   23
 minimal n


int main ()

Detailed Description

Program from [BHR 2006], adapted to C++.

For enumerating all weak Schur-solutions for COLS colours and LOWB <= n < UPB with ascending n and in lexicograhical order, listing for each colour-equivalence-class the first element.

Code from [Partitions into sum-free sets; Peter F. Blanchard, Frank Harary, Rogerio Reis; INTEGERS: Electronic Journal of combinatorial number theory 6, 2006], http://www.integers-ejcnt.org/vol6.html .

To redefine the main parameters COLS, UPB, LOWB, set them via CPPFLAGS, e.g.,

    > CPPFLAGS="-DCOLS=2 -DUPB=9 -DLOWB=8" oklib all
  • COLS is the number of colours.
  • UPB is the maximal number n of vertices to be considered (should be at least wschur(COLS).
  • LOWB is the minimal number n of vertices where the solutions are output.
Assertion in add_col fails after enumerating some solutions for upb=24
  • Perhaps it must hold that upb-1 is a true upper bound on wschur(cols).
Rename to WSchur_BHR.cpp
Create complete specifications
  • The algorithm needs to be fully understood, and all functions and variables need to have full specifications.
Write modification to handle ordinary Schur-problems
  • Perhaps only add_col and del_col need to be changed.

Definition in file Schur_BHR.cpp.

Define Documentation

#define COLS   3

number of colours

Definition at line 70 of file Schur_BHR.cpp.

#define LOWB   23

minimal n

Definition at line 78 of file Schur_BHR.cpp.

#define UPB   24

maximal n

Definition at line 74 of file Schur_BHR.cpp.

Function Documentation

int main ( )

Definition at line 162 of file Schur_BHR.cpp.