heuristics
Module summary
Implements several heuristics
to be used with a separate script to generate .csv
logs.
Heuristics for the original problem generally have orig_
prefix
in the name, for the simplified problem – simpl_
prefix.
The module also contains some code related to possible further research and testing.
(In the implementation details below, click on class/function names for additional documentation and links to the source code.)
❖❖❖
Implements functions (outside the classes above):
|
finds a good alignment target with greedy pairs of sifts |
|
Finds a good alignment target with greedy sifts. |
|
An experimental function implementing faster 'sift' operation. |
|
Best of A and B heuristic (simplified problem). |
|
Five random orders (original problem). |
|
Best of |
|
Greedy sifts heuristic for the original problem. |
|
Another experimental heuristic (further research). |
|
Experimental heuristic (further research). |
|
Another experimental heuristic (further research). |
|
Another experimental heuristic (further research). |
|
A heuristic for the original problem involving simplified problem. |
|
Implements 'Best of 5 random orders' heuristic. |
|
Experimental: greedy pairs of sifts (simplified problem), one pass. |
|
Experimental: greedy pairs of sifts (simplified problem), two passes. |
|
Finds a good alignment target with greedy pairs of sifts. |
|
Finds a good alignment target with greedy sifts |
|
finds a good alignment target with greedy swaps |
|
Greedy sifts: one pass. |
|
Greedy sifts: two passes. |
|
Greedy sifts: three passes. |
|
Greedy sifts: all passes. |
|
Helper: align to |
|
Helper: align to |
Attributes defined in the module:
- heuristics.SIMPL_HEU = [['simpl_minAB', <function minAB>, 'Best of A and B'], ['simpl_gswaps', <function simpl_greedy_swaps>, 'Greedy swaps'], ['simpl_5random', <function simpl_5random>, 'Best/five random orders'], ['simpl_gsifts_1p', <function simpl_gsifts_1p>, 'Greedy sifts (one pass)'], ['simpl_gsifts_2p', <function simpl_gsifts_2p>, 'Greedy sifts (two passes)'], ['simpl_gsifts_inf', <function simpl_gsifts_inf>, 'Greedy sifts (all)']]
List of heuristics for the simplified problem.
- heuristics.ORIG_HEU = [['orig_simpl', <function orig_simpl>, 'Simplified problem'], ['orig_gsifts1p', <function orig_gsifts1p>, 'Greedy BDD sifts (one pass)'], ['orig_bestAB', <function orig_bestAB>, 'Best of A and B'], ['orig_5random', <function orig_5random>, 'Best of five random orders']]
List of heuristics for the original problem.
❖❖❖
Implementation details
❖❖❖
Functions
- heuristics.fast_greedy_2sifts(A, B)[source]
finds a good alignment target with greedy pairs of sifts
Makes sifts while it can improve the objective (picking the best improvement at each step)
- heuristics.fast_greedy_sifts(A, B)[source]
Finds a good alignment target with greedy sifts.
Makes sifts while it can improve the objective (picking the best improvement at each step)
- heuristics.fastslide(X, a, p)[source]
An experimental function implementing faster ‘sift’ operation.
- heuristics.orig_interleave_when_diverge(A, B, simpl)[source]
Another experimental heuristic (further research).
- heuristics.orig_simpl(A, B, simpl)[source]
A heuristic for the original problem involving simplified problem.
- heuristics.simpl_g2sifts_1p(A, B)[source]
Experimental: greedy pairs of sifts (simplified problem), one pass.
- heuristics.simpl_g2sifts_2p(A, B)[source]
Experimental: greedy pairs of sifts (simplified problem), two passes.
- heuristics.simpl_greedy_2sifts(A, B, passes=-1)[source]
Finds a good alignment target with greedy pairs of sifts.
Makes sifts while it can improve the objective, or for a given number of passes, picking the best improvement at each step. (one pass = examining all the variables.)
- heuristics.simpl_greedy_sifts(A, B, passes=-1)[source]
Finds a good alignment target with greedy sifts
Makes sifts while it can improve the objective or for a given number of passes, picking the best improvement at each step. (one pass = examining all the variables)