|
2 | 2 | # |
3 | 3 | #! @Chapter Equitable Graphs |
4 | 4 | #! |
| 5 | +#! @Section Making a partition equitable |
5 | 6 | #! |
| 7 | +#! During search, the partition must be refined with respect to the |
| 8 | +#! current graph stack until it is <E>equitable</E>: informally, until no |
| 9 | +#! cell can be split by looking at how its points connect to the cells of |
| 10 | +#! the partition. &GraphBacktracking; offers several methods of differing |
| 11 | +#! strength and cost. A stronger method splits the partition at least as |
| 12 | +#! much as a weaker one, prunes the search tree more, but costs more per |
| 13 | +#! node. Which one is used is controlled by the <C>consolidator</C> field |
| 14 | +#! of the configuration record passed to the search functions (see |
| 15 | +#! <Ref Chap="Chapter_Executing_a_search"/>); the default is |
| 16 | +#! <Ref Oper="GB_MakeEquitableStrong" Label="for IsPartitionStack, IsTracer, IsList"/>. |
6 | 17 | #! |
7 | | -#! @Section Example Methods |
8 | | -#! |
9 | | -#! This section will describe the methods which can |
10 | | -#! be used to make equitable partitions |
| 18 | +#! Each method takes a partition stack <A>ps</A>, a tracer <A>tracer</A> |
| 19 | +#! (see <Ref Chap="Ordered tracers" BookName="BacktrackKit"/>), and a list |
| 20 | +#! <A>graphs</A> of digraphs. It refines <A>ps</A> in place, recording the |
| 21 | +#! splits in <A>tracer</A>, and returns <K>true</K> on success or |
| 22 | +#! <K>false</K> if a split contradicted the tracer (a dead branch). |
11 | 23 |
|
| 24 | +#! @Arguments ps, tracer, graphs |
12 | 25 | #! @Description |
13 | | -#! Given a partition stack, and a list of graphs, |
14 | | -#! make the partition equitable. |
| 26 | +#! Does nothing and returns <K>true</K>: the partition is left |
| 27 | +#! unchanged. Provided as a baseline (it makes graph backtracking behave |
| 28 | +#! like ordinary backtracking with respect to the graphs). |
15 | 29 | DeclareOperation("GB_MakeEquitableNone", [IsPartitionStack, IsTracer, IsList]); |
| 30 | + |
| 31 | +#! @Arguments ps, tracer, graphs |
| 32 | +#! @Description |
| 33 | +#! Refines <A>ps</A> by repeatedly splitting each cell according to the |
| 34 | +#! multiset of cells reached along out- and in-edges of each graph, |
| 35 | +#! iterating to a fixed point. This is the classical equitable-partition |
| 36 | +#! refinement applied to each graph in turn. |
16 | 37 | DeclareOperation("GB_MakeEquitableWeak", [IsPartitionStack, IsTracer, IsList]); |
| 38 | + |
| 39 | +#! @Arguments ps, tracer, graphs |
| 40 | +#! @Description |
| 41 | +#! A stronger refinement than <Ref Oper="GB_MakeEquitableWeak" Label="for IsPartitionStack, IsTracer, IsList"/>: it |
| 42 | +#! distinguishes points using the combined edge information across all |
| 43 | +#! graphs simultaneously, rather than one graph at a time. This is the |
| 44 | +#! default consolidator. |
17 | 45 | DeclareOperation("GB_MakeEquitableStrong", [IsPartitionStack, IsTracer, IsList]); |
| 46 | + |
| 47 | +#! @Arguments ps, tracer, graphs |
| 48 | +#! @Description |
| 49 | +#! The strongest (and most expensive) refinement: it builds a single |
| 50 | +#! digraph encoding the whole graph stack, computes its automorphism |
| 51 | +#! group and orbits, and splits the partition by those orbits. This can |
| 52 | +#! prune branches the cheaper methods miss, at a substantial cost per |
| 53 | +#! node. |
18 | 54 | DeclareOperation("GB_MakeEquitableFull", [IsPartitionStack, IsTracer, IsList]); |
0 commit comments