OKlibrary  0.2.1.6
IndependentSets.mac
Go to the documentation of this file.
```00001 /* Oliver Kullmann, 24.2.2008 (Swansea) */
00002 /* Copyright 2008 Oliver Kullmann
00003 This file is part of the OKlibrary. OKlibrary is free software; you can redistribute
00004 it and/or modify it under the terms of the GNU General Public License as published by
00005 the Free Software Foundation and included in this library; either version 3 of the
00006 License, or any later version. */
00007
00022 oklib_include("OKlib/ComputerAlgebra/TestSystem/Lisp/Asserts.mac");
00023 oklib_include("OKlib/ComputerAlgebra/Hypergraphs/Lisp/SetSystems.mac");
00024 oklib_include("OKlib/ComputerAlgebra/Graphs/Lisp/Basic.mac");
00025
00026 kill(f)\$
00027
00028 /* Example graph from [Handbook of Graph Theory], Figure 5.5.1 */
00029 exmp_551a : [setn(6), {{1,2},{1,5},{1,6},{2,3},{3,4},{3,6},{4,5}}]\$
00030 exmp_551b : comp_graph(exmp_551a)\$
00031
00032
00033 okltest_independence_number_gr_m(f) := block([G],
00034   assert(f([{},{}]) = 0),
00035   assert(f([{1},{}]) = 1),
00036   assert(f([{0,1},{}]) = 2),
00037   assert(f(exmp_551a) = 3),
00038   assert(f(exmp_551b) = 2),
00039   true)\$
00040
00041 okltest_partition_number_gr_m(f) := block(
00042   assert(f([{},{}]) = 0),
00043   assert(f([{1},{}]) = 1),
00044   assert(f([{0,1},{}]) = 2),
00045   assert(f(exmp_551a) = 3),
00046   assert(f(exmp_551b) = 3),
00047   true)\$
00048
00049
```