16namespace layer5_applications {
17namespace apps_graph_theory {
20static void graph_classify_test_function(
long int *S,
int len,
21 long int *candidates,
int nb_candidates,
22 long int *good_candidates,
int &nb_good_candidates,
23 void *data,
int verbose_level);
24static void graph_classify_print_set(std::ostream &ost,
25 int len,
long int *S,
void *data);
84 int f_v = (verbose_level >= 1);
87 cout <<
"graph_classify::init" << endl;
105 cout <<
"graph_classify::init tournaments "
106 "on " <<
Descr->
n <<
" vertices" << endl;
108 sprintf(prefix,
"tournament_%d",
Descr->
n);
110 sprintf(prefix + strlen(prefix),
"_no_superking");
115 cout <<
"graph_classify::init graphs "
116 "on " <<
Descr->
n <<
" vertices" << endl;
118 sprintf(prefix,
"graph_%d",
Descr->
n);
128 sprintf(prefix + strlen(prefix),
"_g%d",
Descr->
girth);
132 cout <<
"prefix=" << prefix << endl;
138 cout <<
"n2=" <<
n2 << endl;
142 int f_no_base =
FALSE;
146 cout <<
"A_base->init_symmetric_group done" << endl;
150 cout <<
"!A_base->f_has_sims" << endl;
154 cout <<
"generators for the symmetric group are:" << endl;
162 cout <<
"A_on_edges->induced_action_on_ordered_pairs "
163 "done, created the following action:" << endl;
165 cout <<
"generators for the symmetric group in the "
166 "action on ordered_pairs are:" << endl;
174 cout <<
"A_on_edges->induced_action_on_pairs done, "
175 "created the following action:" << endl;
177 cout <<
"generators for the symmetric group in the action "
178 "on pairs are:" << endl;
184 cout <<
"After lex_least_base, we have the following "
187 cout <<
"generators for the symmetric group in the "
188 "induced action are:" << endl;
202 cout <<
"n * regularity must be even" << endl;
228 cout <<
"graph_classify::init target_depth = "
229 << target_depth << endl;
234 cout <<
"please use -poset_classification_control ... -end" << endl;
243 graph_classify_test_function,
263 cout <<
"graph_classify::init before gen->main" << endl;
271 cout <<
"graph_classify::init after gen->main" << endl;
272 cout <<
"gen->main returns depth=" << depth << endl;
276 cout <<
"graph_classify::init done" << endl;
283 long int *S,
int verbose_level)
288 int f_not_regular =
FALSE;
289 int f_bad_girth =
FALSE;
290 int f_v = (verbose_level >= 1);
293 cout <<
"graph_classify::check_conditions checking set ";
297 f_not_regular =
TRUE;
308 cout <<
"OK" << endl;
314 cout <<
"not OK because of ";
316 cout <<
"regularity test";
319 cout <<
"girth test";
328 int len,
long int *S,
335 int f_v = (verbose_level >= 1);
336 int f_vv = (verbose_level >= 2);
337 int a, a2, swap, swap2, b2, b, i, idx;
343 cout <<
"graph_classify::check_conditions_tournament "
352 for (i = 0; i < len; i++) {
361 cout <<
"graph_classify::check_conditions_tournament "
362 "elements " << a <<
" and " << b
363 <<
" cannot both exist" << endl;
377 for (i = 0; i < len && f_OK; i++) {
384 if (score[v] ==
Descr->
n - 1) {
390 if (score[u] ==
Descr->
n - 1) {
402 cout <<
"OK" << endl;
408 cout <<
"not OK" << endl;
416 long int *S,
int len,
420 int f_v = (verbose_level >= 1);
423 cout <<
"check_regularity for ";
430 cout <<
"regularity test violated" << endl;
433 cout <<
"regularity test OK" << endl;
446 cout <<
"graph_classify::compute_degree_sequence "
447 "tournament is TRUE" << endl;
451 for (h = 0; h < len; h++) {
470 int f_v = (verbose_level >= 1);
471 int f_vv = (verbose_level >= 2);
474 cout <<
"girth check for ";
478 for (i = 0; i <
Descr->
n; i++) {
483 cout <<
"girth check fails for vertex " << i << endl;
490 cout <<
"girth check fails" << endl;
493 cout <<
"girth check OK" << endl;
500 int vertex,
int girth,
503 int f_v = (verbose_level >= 1);
504 int l, i, cur = 0, a, b, da, db, g;
507 for (i = 0; i <
Descr->
n; i++) {
517 for (b = 0; b <
Descr->
n; b++) {
524 cout <<
"found a cycle of length "
525 << g <<
" < " << girth << endl;
526 cout << vertex <<
" - " << a
527 <<
" - " << b << endl;
528 cout << da <<
" + " << 1
529 <<
" + " << db << endl;
535 cout <<
"da + 1 < db, this "
536 "should not happen" << endl;
537 cout <<
"vertex=" << vertex << endl;
538 cout <<
"a=" << a << endl;
539 cout <<
"b=" << b << endl;
540 cout <<
"da=" << da << endl;
541 cout <<
"db=" << db << endl;
563 int f_v = (verbose_level >= 1);
572 for (h = 0; h < len; h++) {
588 for (h = 0; h < len; h++) {
596 for (i = 0; i <
Descr->
n; i++) {
597 for (j = 0; j <
Descr->
n; j++) {
609 ost <<
"graph_classify::print" << endl;
611 for (i = 0; i < len; i++) {
616 for (i = 0; i <
Descr->
n; i++) {
617 for (j = 0; j <
Descr->
n; j++) {
626 int level,
int verbose_level)
628 int f_v = (verbose_level >= 1);
634 cout <<
"graph_classify::print_score_sequences "
635 "level = " << level << endl;
641 for (h = 0; h < nb_orbits; h++) {
654 cout <<
" : " << go <<
" : ";
670 long int *set,
int sz,
long int *score,
int verbose_level)
672 int i, a, swap, a2, u, v;
676 for (i = 0; i < sz; i++) {
683 Combi.
k2ij(a2, u, v, n);
702 int f_v = (verbose_level >= 1);
708 cout <<
"graph_classify::draw_graphs level = " << level << endl;
716 cout <<
"graph_classify::draw_graphs nb_orbits = " << nb_orbits << endl;
719 for (h = 0; h < nb_orbits; h++) {
730 for (i = 0; i < level; i++) {
737 for (i = 0; i <
n2; i++) {
740 cout <<
" : " << go << endl;
748 sprintf(str,
"_rep_%d_%d.mp", level, h);
750 fname_full.append(str);
753 int x_min = 0, x_max = draw_options->
xin;
754 int y_min = 0, y_max = draw_options->
yin;
757 x = (x_max - x_min) >> 1;
758 y = (y_max - y_min) >> 1;
767 G.
init(fname_full, draw_options, verbose_level - 1);
770 mp_graphics G(fname_full, draw_options, verbose_level - 1);
781 cout <<
"graph_classify::draw_graphs before G.draw_tournament" << endl;
784 cout <<
"graph_classify::draw_graphs after G.draw_tournament" << endl;
787 cout <<
"graph_classify::draw_graphs before G.draw_graph" << endl;
790 cout <<
"graph_classify::draw_graphs after G.draw_graph" << endl;
798 cout <<
"written file " << fname_full
799 <<
" of size " << Fio.
file_size(fname_full) << endl;
801 cout <<
"before FREE_OBJECT(Strong_gens)" << endl;
803 cout <<
"after FREE_OBJECT(Strong_gens)" << endl;
808 cout <<
"graph_classify::draw_graphs level = " << level <<
" done" << endl;
818static void graph_classify_test_function(
long int *S,
int len,
819 long int *candidates,
int nb_candidates,
820 long int *good_candidates,
int &nb_good_candidates,
821 void *data,
int verbose_level)
827 nb_good_candidates = 0;
828 for (i = 0; i < nb_candidates; i++) {
829 Gen->
S1[len] = candidates[i];
832 len + 1, Gen->
S1, verbose_level);
838 good_candidates[nb_good_candidates++] = candidates[i];
843static void graph_classify_print_set(ostream &ost,
844 int len,
long int *S,
void *data)
846 graph_classify *Gen = (graph_classify *) data;
849 Gen->
print(ost, S, len);
a collection of combinatorial functions
void k2ij(int k, int &i, int &j, int n)
long int int_n_choose_k(int n, int k)
void k2ij_lint(long int k, long int &i, long int &j, long int n)
void zero(long int *v, long int len)
a collection of functions related to sorted vectors
int lint_vec_search(long int *v, int len, long int a, int &idx, int verbose_level)
void lint_vec_heapsort(long int *v, int len)
options for drawing an object of type layered_graph
a general 2D graphical output interface (metapost, tikz, postscript)
void init(std::string &file_name, layered_graph_draw_options *Draw_options, int verbose_level)
void draw_tournament(int x, int y, int dx, int dy, int nb_V, long int *Edges, int nb_E, int radius, int verbose_level)
void begin_figure(int factor_1000)
void draw_graph(int x, int y, int dx, int dy, int nb_V, long int *Edges, int nb_E, int radius, int verbose_level)
a collection of functions related to file io
long int file_size(std::string &fname)
data_structures::lint_vec * Lint_vec
interface to system functions
a class to represent arbitrary precision integers
a permutation group in a fixed action.
void induced_action_on_ordered_pairs(action &old_action, groups::sims *old_G, int verbose_level)
void init_symmetric_group(int degree, int f_no_base, int verbose_level)
void induced_action_on_pairs(action &old_action, groups::sims *old_G, int verbose_level)
void lex_least_base_in_place(int verbose_level)
groups::strong_generators * Strong_gens
a strong generating set for a permutation group with respect to a fixed action
void group_order(ring_theory::longinteger_object &go)
the poset classification algorithm
void initialize_and_allocate_root_node(poset_classification_control *PC_control, poset_with_group_action *Poset, int depth, int verbose_level)
int main(int t0, int schreier_depth, int f_use_invariant_subset_if_available, int f_debug, int verbose_level)
int nb_orbits_at_level(int level)
std::string & get_problem_label_with_path()
void get_set_by_level(int level, int node, long int *set)
void get_stabilizer_generators(groups::strong_generators *&gens, int level, int orbit_at_level, int verbose_level)
a poset with a group action on it
void * print_function_data
void init_subset_lattice(actions::action *A, actions::action *A2, groups::strong_generators *Strong_gens, int verbose_level)
void add_testing_without_group(void(*func)(long int *S, int len, long int *candidates, int nb_candidates, long int *good_candidates, int &nb_good_candidates, void *data, int verbose_level), void *data, int verbose_level)
void(* print_function)(std::ostream &ost, int len, long int *S, void *data)
classification of graphs and tournaments
poset_classification::poset_classification_control * Control
classification of graphs and tournaments
int check_regularity(long int *S, int len, int verbose_level)
void score_sequence(int n, long int *set, int sz, long int *score, int verbose_level)
void print_score_sequences(int level, int verbose_level)
void draw_graphs(int level, graphics::layered_graph_draw_options *draw_options, int verbose_level)
poset_classification::poset_classification * gen
int girth_check(long int *S, int len, int verbose_level)
poset_classification::poset_with_group_action * Poset
actions::action * A_on_edges
int girth_test_vertex(long int *S, int len, int vertex, int girth, int verbose_level)
void print(std::ostream &ost, long int *S, int len)
int check_conditions_tournament(int len, long int *S, int verbose_level)
int check_conditions(int len, long int *S, int verbose_level)
void get_adjacency(long int *S, int len, int verbose_level)
void init(graph_classify_description *Descr, int verbose_level)
int compute_degree_sequence(long int *S, int len)
graph_classify_description * Descr
#define Lint_vec_copy(A, B, C)
#define Int_vec_zero(A, B)
#define Lint_vec_print(A, B, C)
orbiter_kernel_system::orbiter_session * Orbiter
global Orbiter session
the orbiter library for the classification of combinatorial objects