ПН - упорядкування (Smallest-last order of graph vertices) :: vector sl_ordered_vertices = boost :: smallest_last_vertex_ordering (graph); :: clog <<"Smallest-last vertex ordering: "; :: for_each (sl_ordered_vertices.rbegin (), sl_ordered_vertices.rend (), [& graph] (graph_vertex_t & v) {std :: clog <
{:: clog <<"Coloring vertex" <
// минимальныйотсутствующийцветнасмежнойвершинеm = minimal_missing_incident_color (* current_vertex, graph); (m> 0); (m <= j)
{[* current_vertex]. color = m;
}
else
{
// кольору, використовувані один раз на суміжних вершинах
ncp; (pair_non_connected_by_two_colored_chain (ncp, once_colored_vertices, * current_vertex, graph)) // парасуществует
{_two_colored_component (* current_vertex, graph); // перекраскакомпонентграфа [* current_vertex]. color = graph [ncp.first]. color; p>
}
{
+ + j; [* current_vertex]. color = j;
}
}
# ifdef _DEBUG
{:: ofstream output ("latest_coloring.dot"); (! output.is_open ())
{:: cerr <<"Can't open output file
} :: write_graphviz_dp (output, graph, dp, "id");. close ();
}
# endif
} _tend_time = clock (); _time = diff_clock_sec (start_time, end_time); :: map color_usage; :: for_each (boost :: vertices (graph). first, boost: : vertices (graph). second, [& color_usage, & graph] (constgraph_vertex_t & v) {+ + color_usage [graph [v]. color];});
// Вивестірезультат
// Виводвконсоль
std :: cout.precision (3);
std :: cout <
<<"Output graph filename:" <
<<"Used colors:" <
<<"Colors usage:"; :: for_each (color_usage.begin (), color_usage.end (), - "<
<<"Time (sec):" <
// csv file :: ofstream results (report_filename, std :: fstream :: ap...