1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
//! # min2phase
//! ## Two-phase algorithm
//! See [Kociemba's page](http://kociemba.org/cube.htm)
//! ## `min2phase` Improvements compared with conventional two-phase algorithm
//! Conventional two-phase algorithm only find (sub-)optimal solutions to <U,R2,F2,D,L2,B2>. However, If we are able to find more phase1 solutions within a limited depth, the probability of finding a short solution will be increased.
//! - Try different axes: The target of phase1 can be either <U,R2,F2,D,L2,B2>, <U2,R,F2,D2,L,B2>, or <U2,R2,F,D2,L2,B>.
//! - Try the inverse of the state: We will try to solve the inverse state simultaneously to find more phase1 solutions.
//! - Try pre-scramble: We can also use pre-scramble technique (which is widely used in fewest-move challenge) to find more phase1 solutions. If PreMoves \* Scramble \* Phase1 \* Phase2 = Solved, then Scramble \* (Phase1 \* Phase2 \* PreMoves) = Solved, Solution = Phase1 \* Phase2 \* PreMoves.
/// Module for represent a cube on the cubie level(array model).
/// Module containing 3x3 cube constants.
/// Module for represent a cube on the coordinate level.
/// Module for represent a cube on the facelet level.
/// Impl `From<&ArrayCube>` for CubieCube.
/// Module for min2phase solver.
/// Module for data tables.
/// Module for misc utils and tables.
use crateFormula;
use crate::;
use Solver;
/// Min2PhaseSolver for solve a cube use min2phase method.
/// # Example
/// ```rust
/// use rcuber::cubie::CubieCube;
/// use rcuber::moves::Formula;
/// use rcuber::solver::min2phase::Min2PhaseSolver;
///
/// fn main() {
/// let cc = CubieCube::default();
/// let formula = Formula::scramble();
/// let cc = cc.apply_formula(&formula);
/// let mut solver = Min2PhaseSolver{cube: cc};
/// assert!(!solver.is_solved());
/// let solution = solver.solve();
/// assert!(solver.is_solved());
/// println!("Scramble: {:?}\nSolution: {:?}", formula, solution);
/// }
/// ```
/// For find a more optimal solution, use `min2phase::solver::solver::next`.
///