pentagon/pentagon.rs
1use graph_solver::*;
2
3// Notice that edges starts with `2`.
4const EDGE: Color = 2;
5
6fn main() {
7 let mut g = Graph::new();
8
9 // Create a node pattern.
10 let a = Node {
11 color: 0,
12 self_connected: false,
13 edges: vec![
14 Constraint {edge: EDGE, node: 0},
15 Constraint {edge: EDGE, node: 0},
16 ]
17 };
18
19 for _ in 0..5 {g.push(a.clone())}
20
21 let solve_settings = SolveSettings::new();
22 if let Some(solution) = g.solve(solve_settings) {
23 // solution.puzzle.print();
24 println!("{}", solution.puzzle.graphviz(
25 "sfdp",
26 &["black"],
27 &["black"]
28 ));
29 }
30}