@@ -32,7 +32,8 @@ for i=1:length(sequence)
3232 i != j && add_edge! (graph, i, j)
3333end
3434
35- show_graph (graph; locs= locations, texts= string .(sequence), edge_colors= [sequence[e. src] == sequence[e. dst] ? " blue" : " black" for e in edges (graph)])
35+ show_graph (graph; locs= locations, texts= string .(sequence), edge_colors=
36+ [sequence[e. src] == sequence[e. dst] ? " blue" : " black" for e in edges (graph)])
3637
3738# Vertices connected by blue edges must have different colors,
3839# and the goal becomes a min-cut problem defined on black edges.
@@ -80,25 +81,22 @@ max_config = solve(problem, GraphPolynomial())[]
8081# ```math
8182# D(G, x) = \sum_{k=0}^{\delta(G)} d_k x^k
8283# ```
83- # where ``2d_k `` is the number of possible coloring with number of color changes ``2m-1-k``.
84+ # where ``d_k `` is the number of possible coloring with number of color changes ``2m-1-k``.
8485paint_polynomial = solve (problem, GraphPolynomial ())[]
8586
8687# ### Configuration properties
8788# ##### finding best solutions
8889best_configs = solve (problem, ConfigsMax ())[]
8990
90- painting1 = paint_shop_coloring_from_config (best_configs. c. data[1 ]; initial= false )
91-
92- show_graph (graph; locs= locations, texts= string .(sequence), edge_colors= [sequence[e. src] == sequence[e. dst] ? " blue" : " black" for e in edges (graph)],
93- vertex_colors= [isone (c) ? " red" : " black" for c in painting1], vertex_text_color= " white" )
91+ # One can see to identical bitstrings corresponding two different vertex configurations, they are related to bit-flip symmetry.
9492
95- #
93+ painting1 = paint_shop_coloring_from_config (best_configs . c . data[ 1 ]; initial = false )
9694
97- painting2 = paint_shop_coloring_from_config (best_configs. c. data[2 ]; initial= false )
95+ show_graph (graph; locs= locations, texts= string .(sequence),
96+ edge_colors= [sequence[e. src] == sequence[e. dst] ? " blue" : " black" for e in edges (graph)],
97+ vertex_colors= [isone (c) ? " red" : " black" for c in painting1], vertex_text_color= " white" )
9898
99- show_graph (graph; locs= locations, texts= string .(sequence), edge_colors= [sequence[e. src] == sequence[e. dst] ? " blue" : " black" for e in edges (graph)],
100- vertex_colors= [isone (c) ? " red" : " black" for c in painting2], vertex_text_color= " white" )
99+ # Since we have different choices of initial color, the number of best solution is 2.
101100
102- # Since we have different choices of initial color, the number of best solution is 4.
103101# The following function will check the solution and return you the number of color switchs
104102num_paint_shop_color_switch (sequence, painting1)
0 commit comments